-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathMakefile
175 lines (132 loc) · 4.26 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
PACKAGE_NAME := unstructured_ingest
PIP_VERSION := 23.2.1
ARCH := $(shell uname -m)
###########
# INSTALL #
###########
.PHONY: pip-compile
pip-compile:
./scripts/pip-compile.sh
.PHONY: install-lint
install-lint:
pip install -r requirements/lint.txt
.PHONY: install-client
install-client:
pip install -r requirements/remote/client.txt
.PHONY: install-test
install-test:
pip install -r requirements/test.txt
.PHONY: install-release
install-release:
pip install -r requirements/release.txt
.PHONY: install-base
install-base:
pip install -r requirements/common/base.txt
.PHONY: install-all-connectors
install-all-connectors:
find requirements/connectors -type f -name "*.txt" -exec pip install -r '{}' ';'
.PHONY: install-all-embedders
install-all-embedders:
find requirements/embed -type f -name "*.txt" -exec pip install -r '{}' ';'
.PHONY: install-all-deps
install-all-deps:
find requirements -type f -name "*.txt" ! -name "constraints.txt" -exec pip install -r '{}' ';'
.PHONY: install-docker-compose
install-docker-compose:
ARCH=${ARCH} ./scripts/install-docker-compose.sh
.PHONY: install-ci
install-ci: install-all-connectors install-all-embedders
pip install -r requirements/local_partition/pdf.txt
pip install -r requirements/local_partition/docx.txt
pip install -r requirements/local_partition/pptx.txt
pip install -r requirements/local_partition/xlsx.txt
pip install -r requirements/local_partition/md.txt
###########
# TIDY #
###########
.PHONY: tidy
tidy: tidy-black tidy-ruff tidy-autoflake tidy-shell
.PHONY: tidy-shell
tidy-shell:
shfmt -i 2 -l -w .
.PHONY: tidy-ruff
tidy-ruff:
ruff check --fix-only --show-fixes .
.PHONY: tidy-black
tidy-black:
black .
.PHONY: tidy-autoflake
tidy-autoflake:
autoflake --in-place .
###########
# CHECK #
###########
.PHONY: check
check: check-python check-shell
.PHONY: check-python
check-python: check-black check-flake8 check-ruff check-autoflake check-version
.PHONY: check-black
check-black:
black . --check
.PHONY: check-flake8
check-flake8:
flake8 .
.PHONY: check-ruff
check-ruff:
ruff check .
.PHONY: check-autoflake
check-autoflake:
autoflake --check-diff .
.PHONY: check-shell
check-shell:
shfmt -i 2 -d .
.PHONY: check-version
check-version:
# Fail if syncing version would produce changes
scripts/version-sync.sh -c \
-f "unstructured_ingest/__version__.py" semver
###########
# TEST #
###########
.PHONY: unit-test
unit-test:
PYTHONPATH=. pytest -sv --cov unstructured_ingest/ test/unit --ignore test/unit/unstructured
.PHONY: unit-test-unstructured
unit-test-unstructured:
PYTHONPATH=. pytest -sv --cov unstructured_ingest/ test/unit/unstructured
.PHONY: integration-test
integration-test:
PYTHONPATH=. pytest -sv test/integration
.PHONY: integration-test-partitioners
integration-test-partitioners:
PYTHONPATH=. pytest -sv test/integration/partitioners --json-report
.PHONY: integration-test-chunkers
integration-test-chunkers:
PYTHONPATH=. pytest -sv test/integration/chunkers --json-report
.PHONY: integration-test-embedders
integration-test-embedders:
PYTHONPATH=. pytest -sv test/integration/embedders --json-report
.PHONY: integration-test-connectors-blob-storage
integration-test-connectors-blob-storage:
PYTHONPATH=. pytest --tags blob_storage -sv test/integration/connectors --json-report
.PHONY: integration-test-connectors-sql
integration-test-connectors-sql:
PYTHONPATH=. pytest --tags sql -sv test/integration/connectors --json-report
.PHONY: integration-test-connectors-nosql
integration-test-connectors-nosql:
PYTHONPATH=. pytest --tags nosql -sv test/integration/connectors --json-report
.PHONY: integration-test-connectors-vector-db
integration-test-connectors-vector-db:
PYTHONPATH=. pytest --tags vector_db -sv test/integration/connectors --json-report
.PHONY: integration-test-connectors-graph-db
integration-test-connectors-graph-db:
PYTHONPATH=. pytest --tags graph_db -sv test/integration/connectors --json-report
.PHONY: integration-test-connectors-uncategorized
integration-test-connectors-uncategorized:
PYTHONPATH=. pytest --tags uncategorized -sv test/integration/connectors --json-report
.PHONY: parse-skipped-tests
parse-skipped-tests:
PYTHONPATH=. python ./scripts/parse_pytest_report.py
.PHONY: check-untagged-tests
check-untagged-tests:
./scripts/check_untagged_tests.sh