1
1
.DEFAULT_GOAL := help
2
2
.PHONY : help build test
3
3
4
+ PYPI_TOKEN := $(shell echo ${PYPI_TOKEN})
5
+ PYPI_TEST_TOKEN := $(shell echo ${PYPI_TEST_TOKEN})
6
+
7
+
4
8
build : # # Build an application
5
- @pipenv run python -m build --no-isolation
9
+ @poetry build
10
+
11
+ configure_pypi_publishing : # # Configure publishing to PyPI
12
+ @if [ -z " ${PYPI_TOKEN} " ] ; then echo " you need to export PYPI_TOKEN before running this command" ; false ; fi
13
+ @if [ -z " ${PYPI_TOKEN} " ] ; then echo " you need to export PYPI_TEST_TOKEN before running this command" ; false ; fi
14
+ @poetry config repositories.test-pypi https://test.pypi.org/legacy/
15
+ @poetry config pypi-token.test-pypi $(PYPI_TEST_TOKEN )
16
+ @poetry config pypi-token.pypi $(PYPI_TOKEN )
6
17
7
18
publish-test : # # Upload package to test PyPI
8
- @pipenv run twine upload --repository testpypi dist/ *
19
+ @poetry publish -r test-pypi
9
20
10
21
publish : build # # Upload package to PyPI
11
- @pipenv run twine upload dist/ *
22
+ @poetry publish
12
23
@make clean
13
24
14
- install : build # # Install application to Pip environment
15
- @pipenv run python -m pip install
16
-
17
- install-dev : # # Install application to Pip development environment
18
- @pipenv run python -m pip install -e
19
- @make clean
25
+ install : build # # Install application to Poetry environment
26
+ @poetry install
20
27
21
28
clean : # # Remove build files
22
29
@rm -Rf build/ dist/ * .egg-info .pytest_cache/ .mypy_cache/ .pytype/ .eggs/ src/* .egg-info
23
30
@echo " Temporary files were clear"
24
31
25
32
test : # # Run code tests
26
- @pipenv run python -m pytest -q
27
-
28
- sync : # # Sync with Pipfile packages list
29
- @pipenv sync
33
+ @poetry run pytest
30
34
31
35
lint : # # Run code linters
32
36
@echo " Run code linters..."
33
- @pipenv run mypy ./src
37
+ @poetry run mypy ./src
34
38
35
39
help : # # Show this message
36
40
@echo " Application management"
37
41
@echo
38
- @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
42
+ @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
0 commit comments