forked from mendix/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Poetry in generated project
- Loading branch information
1 parent
513b134
commit 1c95841
Showing
10 changed files
with
105 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import os | ||
import subprocess | ||
|
||
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir) | ||
|
||
|
||
if __name__ == "__main__": | ||
if "{{ cookiecutter.use_pylint }}" != "y": | ||
os.remove(os.path.join(PROJECT_DIRECTORY, "pylintrc")) | ||
# if " cookiecutter.use_sometool }}" != "y": | ||
# os.remove(os.path.join(PROJECT_DIRECTORY, "sometoolrc")) | ||
# The above couple lines are left as an example for the future. | ||
|
||
subprocess.call(["poetry", "lock"], stderr=subprocess.STDOUT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
[tool.poetry] | ||
name = "{{cookiecutter.package_name}}" | ||
version = "0.1.0" | ||
description = "{{cookiecutter.short_description}}" | ||
readme = "README.md" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"Framework :: Pytest", | ||
"Typing :: Typed", | ||
] | ||
authors = ["{{cookiecutter.author_name}} <{{cookiecutter.author_email}}>"] | ||
packages = [{ include = "{{cookiecutter.package_name}}" }] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
|
||
[tool.poetry.group.lint.dependencies] | ||
flake8 = "^6" | ||
black = "^23" | ||
isort = "^5" | ||
pylint = "^3" | ||
mypy = "^1" | ||
|
||
[tool.poetry.group.test.dependencies] | ||
pytest = "^7" | ||
pytest-cov = "^4" | ||
|
||
[build-system] | ||
requires = ["poetry-core<2"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.black] | ||
line-length = 79 | ||
|
||
[tool.isort] | ||
ensure_newline_before_comments = true | ||
include_trailing_comma = true | ||
line_length = 79 | ||
multi_line_output = 3 | ||
split_on_trailing_comma = true | ||
|
||
[tool.mypy] | ||
strict = true | ||
pretty = true | ||
|
||
warn_redundant_casts = true | ||
warn_unused_ignores = true | ||
warn_no_return = true | ||
|
||
[tool.pylint.BASIC] | ||
module-rgx = "[a-z_][a-z0-9_]{2,32}$" | ||
const-rgx = "[a-zA-Z_][a-zA-Z0-9_]{2,32}$" | ||
class-rgx = "[A-Z_][a-zA-Z0-9]+$" | ||
function-rgx = "([a-z_][a-z0-9_]{2,32}|(assert|test_|__)[a-z_][a-z0-9_]{2,80})$" | ||
method-rgx = "([a-z_][a-z0-9_]{2,32}|(assert|test_|__)[a-z_][a-z0-9_]{2,80})$" | ||
attr-rgx = "[a-z_][a-z0-9_]{2,32}$" | ||
argument-rgx = "[a-z_][a-z0-9_]{2,32}$" | ||
variable-rgx = "[a-z_][a-z0-9_]{2,32}$" | ||
class-attribute-rgx = "([A-Za-z_][A-Za-z0-9_]{2,32}|(__.*__))$" | ||
inlinevar-rgx = "[A-Za-z_][A-Za-z0-9_]*$" | ||
|
||
[tool.pylint."MESSAGES CONTROL"] | ||
disable = [ | ||
"missing-docstring", | ||
"locally-disabled", | ||
"too-few-public-methods", | ||
"fixme", | ||
] | ||
msg-template = "{module}:{line} [{msg_id}: {symbol}] - {msg}" | ||
|
||
[tool.pylint.REPORTS] | ||
reports = "yes" | ||
|
||
[tool.pylint.FORMAT] | ||
max-line-length = 79 | ||
|
||
[tool.pylint.SIMILARITIES] | ||
min-similarity-lines = 6 | ||
ignore-comments = "yes" | ||
ignore-docstrings = "yes" | ||
ignore-imports = "yes" |
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
{{cookiecutter.package_name}}/{{cookiecutter.package_name}}/metadata.py
This file was deleted.
Oops, something went wrong.