Skip to content

Commit

Permalink
chore: update python project template
Browse files Browse the repository at this point in the history
  • Loading branch information
lyz-code committed Dec 10, 2020
1 parent 24cd4d4 commit 2bb0790
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .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",
Expand Down
35 changes: 35 additions & 0 deletions Makefile
Expand Up @@ -120,13 +120,48 @@ 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 "--------------------------"
@echo "- Building documentation -"
@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
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Expand Up @@ -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
]
Expand All @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion src/autoimport/__init__.py
Expand Up @@ -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"]

0 comments on commit 2bb0790

Please sign in to comment.