From 2bb07907e0c07802ae7c3f995299bd3e98e5edff Mon Sep 17 00:00:00 2001 From: Lyz Date: Thu, 10 Dec 2020 11:39:20 +0100 Subject: [PATCH] chore: update python project template --- .cruft.json | 2 +- Makefile | 35 +++++++++++++++++++++++++++++++++++ pyproject.toml | 6 +++++- src/autoimport/__init__.py | 6 +++++- 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.cruft.json b/.cruft.json index e8a56b5..a5e67cc 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "git@github.com:lyz-code/cookiecutter-python-project.git", - "commit": "aeb5f07f519356cac882e856ff1eb2ae9a9ee408", + "commit": "4e53342a9fc1ec503ad4a71d1e90158eb9c8df5a", "context": { "cookiecutter": { "project_name": "Autoimport", diff --git a/Makefile b/Makefile index d67f4d8..e93b045 100644 --- a/Makefile +++ b/Makefile @@ -120,6 +120,19 @@ docs: test-examples @echo "" +.PHONY: bump +build: bump-version, build-package, upload-pypi, clean + +.PHONY: build-package +build-package: + @echo "------------------------" + @echo "- Building the package -" + @echo "------------------------" + + python -m pep517.build --source --binary --out-dir dist/ . + + @echo "" + .PHONY: build-docs build-docs: test-examples @echo "--------------------------" @@ -127,6 +140,28 @@ build-docs: test-examples @echo "--------------------------" mkdocs build + + @echo "" + +.PHONY: upload-pypi +upload-pypi: + @echo "-----------------------------" + @echo "- Uploading package to pypi -" + @echo "-----------------------------" + + twine upload -r pypi dist/* + + @echo "" + +.PHONY: bump-version +bump-version: + @echo "---------------------------" + @echo "- Bumping program version -" + @echo "---------------------------" + + cz bump --changelog --no-verify + git push --tags + @echo "" .PHONY: version diff --git a/pyproject.toml b/pyproject.toml index 7a25778..19beedd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,7 +110,6 @@ pyflakes = ["+*"] [tool.flakehell.exceptions."tests/"] flake8-docstrings = [ - "-D103", # Missing docstring in public function "-D400", # First line should end with a period "-D205" # 1 blank line required between summary line and description ] @@ -122,6 +121,11 @@ pylint = [ # don't use the self object, which is not wrong. ] +[tool.flakehell.exceptions."tests/factories.py"] +pylint = [ + "-R0903", # Too few methods warning, but is the way to define factoryboy factories. +] + # --------- Pylint ------------- [tool.pylint.'TYPECHECK'] generated-members = "sh" diff --git a/src/autoimport/__init__.py b/src/autoimport/__init__.py index ad5fcb0..0152812 100644 --- a/src/autoimport/__init__.py +++ b/src/autoimport/__init__.py @@ -5,4 +5,8 @@ fix_files: Fix the python source code of a list of files. """ -from .services import fix_code, fix_files # noqa W0611 +from typing import List + +from .services import fix_code, fix_files + +__all__: List[str] = ["fix_code", "fix_files"]