From 12f63c5f8134d55ea0cd239e76ae5abc0d863492 Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Thu, 9 Dec 2021 17:44:47 +0100 Subject: [PATCH] =?UTF-8?q?[enh]=20Makefile:=20Update=20commands,=20since?= =?UTF-8?q?=20it=20wasn=E2=80=99t=20maintained?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Call pre-commit Remove 'check-format' not much interesting with pre-commit build: keep dist directory, this is not hurting Fix 'deploy' cmd publishing to pypi_test Switch to 'poetry deploy' prompting for PyPI credentials --- Makefile | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index b0adaf6..ee756ad 100644 --- a/Makefile +++ b/Makefile @@ -1,45 +1,35 @@ -.PHONY: docs check check-format mypy pylint format build deploy deploy_test +.PHONY: docs check mypy pylint format build deploy deploy_test .SILENT: deploy deploy_test # do not echo commands with password # generate documentation docs: - cd docs && rm duniterpy.*; poetry run sphinx-apidoc -o . ../duniterpy && poetry run make clean && poetry run make html && cd .. + poetry run sphinx-apidoc -o docs . && poetry run sphinx-build -b html docs public # check -check: mypy pylint check-format +check: + pre-commit run --all-files # check static typing mypy: - poetry run mypy duniterpy --ignore-missing-imports - poetry run mypy tests --ignore-missing-imports - poetry run mypy examples --ignore-missing-imports + pre-commit run --all-files mypy # check code errors pylint: - poetry run pylint duniterpy tests examples - -# check format -check-format: - black --check duniterpy - black --check tests - black --check examples + pre-commit run --all-files pylint # format code format: - black duniterpy - black tests - black examples + pre-commit run --all-files black # build a wheel package in dist folder build: - if [ -d "./dist" ]; then rm -r dist/*; fi poetry build # upload on PyPi repository deploy: - poetry publish --build --username ${PYPI_LOGIN} --password ${PYPI_PASSWORD} --repository pypi_test + poetry publish --build # upload on PyPi test repository deploy_test: poetry config repositories.pypi_test https://test.pypi.org/legacy/ - poetry publish --build --username ${PYPI_TEST_LOGIN} --password ${PYPI_TEST_PASSWORD} --repository pypi_test + poetry publish --build --repository pypi_test -- GitLab