|
| 1 | +PROJECT_NAME := unstructured_platform_plugins |
| 2 | +PROJECT_SRC_DIR := $(subst -,_,${PROJECT_NAME}) |
| 3 | +SHELL_FILES := $(shell find . -name '*.sh' -type f | grep -v venv) |
1 | 4 | ########### |
2 | 5 | # INSTALL # |
3 | 6 | ########### |
4 | 7 |
|
5 | | -.PHONY: pip-compile |
6 | | -pip-compile: |
7 | | - ./scripts/pip-compile.sh |
| 8 | +.PHONY: install-dependencies |
| 9 | +install-dependencies: |
| 10 | + @uv sync --all-groups |
8 | 11 |
|
9 | | -.PHONY: install |
10 | | -install: install-cli install-lint install-test |
11 | | - |
12 | | -.PHONY: install-cli |
13 | | -install-cli: |
14 | | - pip install -r requirements/cli.txt |
15 | | - |
16 | | -.PHONY: install-lint |
17 | | -install-lint: |
18 | | - pip install -r requirements/lint.txt |
19 | | - |
20 | | -.PHONY: install-test |
21 | | -install-test: |
22 | | - pip install -r requirements/test.txt |
23 | | - |
24 | | -.PHONY: install-release |
25 | | -install-release: |
26 | | - pip install -r requirements/release.txt |
| 12 | +.PHONY: upgrade-dependencies |
| 13 | +upgrade-dependencies: |
| 14 | + @uv sync --all-groups --upgrade |
27 | 15 |
|
28 | 16 | ########### |
29 | 17 | # TIDY # |
30 | 18 | ########### |
31 | 19 |
|
32 | 20 | .PHONY: tidy |
33 | | -tidy: tidy-black tidy-ruff tidy-autoflake tidy-shell |
34 | | - |
35 | | -.PHONY: tidy_shell |
36 | | -tidy-shell: |
37 | | - shfmt -l -w . |
| 21 | +tidy: tidy-ruff |
38 | 22 |
|
39 | 23 | .PHONY: tidy-ruff |
40 | 24 | tidy-ruff: |
41 | | - ruff check --fix-only --show-fixes . |
42 | | - |
43 | | -.PHONY: tidy-black |
44 | | -tidy-black: |
45 | | - black . |
| 25 | + uv run ruff format . |
| 26 | + uv run ruff check --fix-only --show-fixes . |
46 | 27 |
|
47 | | -.PHONY: tidy-autoflake |
48 | | -tidy-autoflake: |
49 | | - autoflake --in-place . |
50 | | - |
51 | | -.PHONY: version-sync |
52 | | -version-sync: |
53 | | - scripts/version-sync.sh \ |
54 | | - -f "unstructured_platform_plugins/__version__.py" semver |
| 28 | +.PHONY: tidy-shell |
| 29 | +tidy-shell: |
| 30 | + shfmt -l -w ${SHELL_FILES} |
55 | 31 |
|
56 | 32 | ########### |
57 | 33 | # CHECK # |
58 | 34 | ########### |
59 | 35 |
|
60 | 36 | .PHONY: check |
61 | | -check: check-python check-shell |
62 | | - |
63 | | -.PHONY: check-python |
64 | | -check-python: check-black check-flake8 check-ruff check-autoflake check-version |
65 | | - |
66 | | -.PHONY: check-black |
67 | | -check-black: |
68 | | - black . --check |
69 | | - |
70 | | -.PHONY: check-flake8 |
71 | | -check-flake8: |
72 | | - flake8 . |
| 37 | +check: check-ruff check-shell |
73 | 38 |
|
74 | 39 | .PHONY: check-ruff |
75 | 40 | check-ruff: |
76 | | - ruff check . |
77 | | - |
78 | | -.PHONY: check-autoflake |
79 | | -check-autoflake: |
80 | | - autoflake --check-diff . |
| 41 | + uv run ruff check . |
81 | 42 |
|
82 | 43 | .PHONY: check-shell |
83 | 44 | check-shell: |
84 | | - shfmt -d . |
| 45 | + shfmt -d ${SHELL_FILES} |
85 | 46 |
|
86 | 47 | .PHONY: check-version |
87 | 48 | check-version: |
88 | 49 | # Fail if syncing version would produce changes |
89 | 50 | scripts/version-sync.sh -c \ |
90 | | - -f "unstructured_platform_plugins/__version__.py" semver |
| 51 | + -f "${PROJECT_SRC_DIR}/__version__.py" semver |
91 | 52 |
|
92 | 53 | ########### |
93 | 54 | # TEST # |
94 | 55 | ########### |
95 | 56 |
|
96 | 57 | .PHONY: test |
97 | 58 | test: |
98 | | - PYTHONPATH=. pytest |
| 59 | + PYTHONPATH=. pytest --cov-config=pyproject.toml --cov-report=json --cov-report=term --cov=${PROJECT_SRC_DIR} -sv |
0 commit comments