forked from Unstructured-IO/unstructured-ingest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
121 lines (93 loc) · 2.42 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
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-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-pandoc
install-pandoc:
ARCH=${ARCH} ./scripts/install-pandoc.sh
.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 test