@@ -7,56 +7,60 @@ help: # Preview Makefile commands
77 @awk ' BEGIN { FS = ":.*#"; print "Usage: make <target>\n\nTargets:" } \
88/^[-_[ :alpha:]]+:.?* # / { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)
99
10- # ######################
11- # Dependency commands
12- # ######################
10+ # ensure OS binaries aren't called if naming conflict with Make recipes
11+ .PHONY : help install venv update test coveralls lint lint-fix security minio-start
1312
14- install : # Install Python dependencies
15- pipenv install --dev
16- pipenv run pre-commit install
13+ # #############################################
14+ # Python Environment and Dependency commands
15+ # #############################################
1716
18- update : install # Update Python dependencies
19- pipenv clean
20- pipenv update --dev
17+ install : .venv .git/hooks/pre-commit .git/hooks/pre-push # Install Python dependencies and create virtual environment if not exists
18+ uv sync --dev
19+
20+ .venv : # Creates virtual environment if not found
21+ @echo " Creating virtual environment at .venv..."
22+ uv venv .venv
23+
24+ .git/hooks/pre-commit : # Sets up pre-commit commit hooks if not setup
25+ @echo " Installing pre-commit commit hooks..."
26+ uv run pre-commit install --hook-type pre-commit
27+
28+ .git/hooks/pre-push : # Sets up pre-commit push hooks if not setup
29+ @echo " Installing pre-commit push hooks..."
30+ uv run pre-commit install --hook-type pre-push
31+
32+ venv : .venv # Create the Python virtual environment
33+
34+ update : # Update Python dependencies
35+ uv lock --upgrade
36+ uv sync --dev
2137
2238# #####################
2339# Unit test commands
2440# #####################
2541
2642test : # Run tests and print a coverage report
27- pipenv run coverage run --source=timdex_dataset_api -m pytest -vv
28- pipenv run coverage report -m
43+ uv run coverage run --source=timdex_dataset_api -m pytest -vv
44+ uv run coverage report -m
2945
3046coveralls : test # Write coverage data to an LCOV report
31- pipenv run coverage lcov -o ./coverage/lcov.info
47+ uv run coverage lcov -o ./coverage/lcov.info
3248
3349# ###################################
34- # Code quality and safety commands
50+ # Code linting and formatting
3551# ###################################
3652
37- lint : black mypy ruff safety # Run linters
38-
39- black : # Run 'black' linter and print a preview of suggested changes
40- pipenv run black --check --diff .
41-
42- mypy : # Run 'mypy' linter
43- pipenv run mypy .
44-
45- ruff : # Run 'ruff' linter and print a preview of errors
46- pipenv run ruff check .
47-
48- safety : # Check for security vulnerabilities and verify Pipfile.lock is up-to-date
49- pipenv run pip-audit
50- pipenv verify
51-
52- lint-apply : black-apply ruff-apply # Apply changes with 'black' and resolve 'fixable errors' with 'ruff'
53-
54- black-apply : # Apply changes with 'black'
55- pipenv run black .
53+ lint : # Run linting, alerts only, no code changes
54+ uv run ruff format --diff
55+ uv run mypy .
56+ uv run ruff check .
5657
57- ruff-apply : # Resolve 'fixable errors' with 'ruff'
58- pipenv run ruff check --fix .
58+ lint-fix : # Run linting, auto fix behaviors where supported
59+ uv run ruff format .
60+ uv run ruff check --fix .
5961
62+ security : # Run security / vulnerability checks
63+ uv run pip-audit
6064
6165# #####################
6266# Minio S3 Instance
@@ -69,4 +73,4 @@ minio-start:
6973 -v $(MINIO_DATA ) :/data \
7074 -e " MINIO_ROOT_USER=$( MINIO_USERNAME) " \
7175 -e " MINIO_ROOT_PASSWORD=$( MINIO_PASSWORD) " \
72- quay.io/minio/minio server /data --console-address " :9001"
76+ quay.io/minio/minio server /data --console-address " :9001"
0 commit comments