2016-11-01 11:49:44 +03:00
|
|
|
VERSION := $(shell python setup.py --version)
|
|
|
|
|
2024-11-10 08:01:30 +03:00
|
|
|
export COVERAGE_RCFILE := pyproject.toml
|
2016-10-30 15:41:33 +03:00
|
|
|
|
2016-10-31 00:59:42 +03:00
|
|
|
clean:
|
|
|
|
# Clean sources
|
2016-11-02 23:58:30 +03:00
|
|
|
find src -name '*.py[cod]' -delete
|
|
|
|
find src -name '__pycache__' -delete
|
|
|
|
find src -name '*.c' -delete
|
2016-11-11 18:35:58 +03:00
|
|
|
find src -name '*.h' -delete
|
2016-11-02 23:58:30 +03:00
|
|
|
find src -name '*.so' -delete
|
|
|
|
find src -name '*.html' -delete
|
2016-10-31 00:59:42 +03:00
|
|
|
# Clean tests
|
|
|
|
find tests -name '*.py[co]' -delete
|
|
|
|
find tests -name '__pycache__' -delete
|
|
|
|
# Clean examples
|
|
|
|
find examples -name '*.py[co]' -delete
|
|
|
|
find examples -name '__pycache__' -delete
|
|
|
|
|
2024-11-10 08:01:30 +03:00
|
|
|
build: clean
|
|
|
|
# Compile C extensions
|
|
|
|
python setup.py build_ext --inplace
|
2016-10-31 12:30:57 +03:00
|
|
|
# Move all Cython html reports
|
|
|
|
mkdir -p reports/cython/
|
2016-11-02 23:58:30 +03:00
|
|
|
find src -name '*.html' -exec mv {} reports/cython/ \;
|
2016-10-31 12:30:57 +03:00
|
|
|
|
2020-06-17 04:39:11 +03:00
|
|
|
docs-live:
|
2020-06-15 00:35:25 +03:00
|
|
|
sphinx-autobuild docs docs/_build/html
|
|
|
|
|
2024-11-10 08:01:30 +03:00
|
|
|
install: uninstall clean build
|
2016-11-03 01:56:30 +03:00
|
|
|
pip install -ve .
|
2016-11-02 23:58:30 +03:00
|
|
|
|
2016-11-03 00:17:50 +03:00
|
|
|
uninstall:
|
|
|
|
- pip uninstall -y -q dependency-injector 2> /dev/null
|
|
|
|
|
2021-10-18 23:19:03 +03:00
|
|
|
test:
|
2016-10-31 00:59:42 +03:00
|
|
|
# Unit tests with coverage report
|
|
|
|
coverage erase
|
2024-11-10 08:01:30 +03:00
|
|
|
coverage run -m pytest -c tests/.configs/pytest.ini
|
|
|
|
coverage report
|
|
|
|
coverage html
|
2016-11-01 11:49:44 +03:00
|
|
|
|
|
|
|
check:
|
2020-06-26 01:01:15 +03:00
|
|
|
flake8 src/dependency_injector/
|
|
|
|
flake8 examples/
|
2020-08-27 05:24:20 +03:00
|
|
|
|
2016-11-03 00:55:14 +03:00
|
|
|
pydocstyle src/dependency_injector/
|
2016-10-31 00:59:42 +03:00
|
|
|
pydocstyle examples/
|
|
|
|
|
2020-08-27 05:24:20 +03:00
|
|
|
mypy tests/typing
|
|
|
|
|
2024-11-10 08:01:30 +03:00
|
|
|
test-publish: build
|
2020-06-30 23:40:30 +03:00
|
|
|
# Create distributions
|
2024-11-10 08:01:30 +03:00
|
|
|
python -m build --sdist
|
2020-06-30 23:40:30 +03:00
|
|
|
# Upload distributions to PyPI
|
|
|
|
twine upload --repository testpypi dist/dependency-injector-$(VERSION)*
|
|
|
|
|
2020-07-02 06:20:28 +03:00
|
|
|
publish:
|
2017-06-09 01:45:12 +03:00
|
|
|
# Merge release to master branch
|
|
|
|
git checkout master
|
2017-06-09 01:53:14 +03:00
|
|
|
git merge --no-ff release/$(VERSION) -m "Merge branch 'release/$(VERSION)' into master"
|
2017-06-09 01:45:12 +03:00
|
|
|
git push origin master
|
2016-10-31 00:59:42 +03:00
|
|
|
# Create and upload tag
|
2016-10-30 15:41:33 +03:00
|
|
|
git tag -a $(VERSION) -m 'version $(VERSION)'
|
|
|
|
git push --tags
|