1- .PHONY : clean clean-test clean-pyc clean-build docs help
1+ .PHONY : clean clean-test clean-pyc clean-build docs help init install lint test test-all coverage dist pypi export-requirements
22.DEFAULT_GOAL := help
33define BROWSER_PYSCRIPT
44import os, webbrowser, sys
@@ -26,6 +26,8 @@ BROWSER := python -c "$$BROWSER_PYSCRIPT"
2626help :
2727 @python -c " $$ PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST )
2828
29+ UV := uv
30+
2931clean : clean-build clean-pyc clean-test # # remove all build, test, coverage and Python artifacts
3032
3133
@@ -47,21 +49,22 @@ clean-test: ## remove test and coverage artifacts
4749 rm -f .coverage
4850 rm -fr htmlcov/
4951
50- lint : # # check style with flake8
51- flake8 ioc_finder tests
52+ lint : # # check style with ruff and mypy
53+ $(UV ) run ruff check ioc_finder tests
54+ $(UV ) run mypy ioc_finder tests
5255
5356test : # # run tests quickly with the default Python
54- py.test
57+ $( UV ) run pytest
5558
5659
5760test-all : # # run tests on every Python version with tox
58- tox
61+ $( UV ) run pytest
5962
6063coverage : # # check code coverage quickly with the default Python
61- coverage run --source ioc_finder -m pytest
64+ $( UV ) run coverage run --source ioc_finder -m pytest
6265
63- coverage report -m
64- coverage html
66+ $( UV ) run coverage report -m
67+ $( UV ) run coverage html
6568 $(BROWSER ) htmlcov/index.html
6669
6770docs : # # generate Sphinx HTML documentation, including API docs
@@ -76,26 +79,26 @@ servedocs: docs ## compile the docs watching for changes
7679 watchmedo shell-command -p ' *.rst' -c ' $(MAKE) -C docs html' -R -D .
7780
7881release : clean # # package and upload a release
79- python setup.py sdist upload
80- python setup.py bdist_wheel upload
82+ $( UV ) build
83+ $( UV ) publish
8184
8285dist : clean # # builds source and wheel package
83- python setup.py sdist
84- python setup.py bdist_wheel
86+ $(UV ) build
8587 ls -l dist
8688
8789install : clean # # install the package to the active Python's site-packages
88- python setup.py install
90+ $( UV ) sync --locked --group dev
8991
9092upstream : # # set the upstream for the repository
9193 git remote set-upstream https://github.com/fhightower/ioc-finder.git
9294
93- init : # # install the development requirements with pip (related to python2.x)
94- pip install -r requirements_dev.txt
95+ init : # # install the project and development requirements with uv
96+ $( UV ) sync --locked --group dev
9597
96- init3 : # # install the development requirements with pip3 (related to python3.x)
97- pip3 install -r requirements_dev.txt
98+ export-requirements : # # regenerate compatibility requirements files from pyproject.toml
99+ $(UV ) export --frozen --no-hashes --no-emit-project --format requirements-txt --no-dev -o requirements.txt
100+ $(UV ) export --frozen --no-hashes --no-emit-project --format requirements-txt --all-groups -o requirements_dev.txt
98101
99102pypi : clean # # upload the code to pypi
100- python3 setup.py sdist bdist_wheel
101- python3 -m twine upload dist/ *
103+ $( UV ) build
104+ $( UV ) publish
0 commit comments