Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 7641822

Browse files
authored
Merge pull request #365 from TezRomacH:I-361
Migrate pytest config to pyproject.toml #361
2 parents b1d4ff8 + 275d563 commit 7641822

File tree

8 files changed

+117
-132
lines changed

8 files changed

+117
-132
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ formatting: codestyle
3535
#* Linting
3636
.PHONY: test
3737
test:
38-
poetry run pytest
38+
poetry run pytest -c pyproject.toml
3939

4040
.PHONY: check-codestyle
4141
check-codestyle:

poetry.lock

Lines changed: 72 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
55

66
[tool.poetry]
77
name = "python-package-template"
8-
version = "1.0.11"
8+
version = "1.1.0"
99
description = "Cookiecutter template for Python cli/packages"
1010
readme = "README.md"
1111
authors = ["Roman Tezikov <[email protected]>"]
@@ -40,11 +40,11 @@ darglint = "^1.8.0"
4040
isort = {extras = ["colors"], version = "^5.9.3"}
4141
mypy = "^0.910"
4242
mypy-extensions = "^0.4.3"
43-
pre-commit = "^2.13.0"
43+
pre-commit = "^2.14.0"
4444
pydocstyle = "^6.1.1"
45-
pylint = "^2.9.6"
45+
pylint = "^2.10.2"
4646
pytest = "^6.2.4"
47-
pyupgrade = "^2.23.3"
47+
pyupgrade = "^2.24.0"
4848
safety = "^1.10.3"
4949

5050
[tool.black]
@@ -84,7 +84,7 @@ color_output = true
8484

8585

8686
[tool.mypy]
87-
# mypy configurations: https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
87+
# https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
8888
python_version = 3.7
8989
pretty = true
9090
show_traceback = true
@@ -108,3 +108,18 @@ warn_return_any = true
108108
warn_unreachable = true
109109
warn_unused_configs = true
110110
warn_unused_ignores = true
111+
112+
113+
[tool.pytest.ini_options]
114+
# https://docs.pytest.org/en/6.2.x/customize.html#pyproject-toml
115+
# Directories that are not visited by pytest collector:
116+
norecursedirs =["{{ cookiecutter.project_name }}", "hooks", "*.egg", ".eggs", "dist", "build", "docs", ".tox", ".git", "__pycache__"]
117+
doctest_optionflags = ["NUMBER", "NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]
118+
119+
# Extra options:
120+
addopts = [
121+
"--strict-markers",
122+
"--tb=short",
123+
"--doctest-modules",
124+
"--doctest-continue-on-failure",
125+
]

requirements.txt

Lines changed: 0 additions & 22 deletions
This file was deleted.

setup.cfg

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
[darglint]
2-
# darglint configuration: https://github.com/terrencepreilly/darglint
2+
# https://github.com/terrencepreilly/darglint
33
strictness = long
44
docstring_style = google
5-
6-
[tool:pytest]
7-
# Directories that are not visited by pytest collector:
8-
norecursedirs = "{{ cookiecutter.project_name }}" hooks *.egg .eggs dist build docs .tox .git __pycache__
9-
doctest_optionflags = NUMBER NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL
10-
11-
# Extra options:
12-
addopts =
13-
--strict-markers
14-
--tb=short
15-
--doctest-modules
16-
--doctest-continue-on-failure

{{ cookiecutter.project_name }}/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ formatting: codestyle
3939
#* Linting
4040
.PHONY: test
4141
test:
42-
poetry run pytest
42+
poetry run pytest -c pyproject.toml
4343

4444
.PHONY: check-codestyle
4545
check-codestyle:

{{ cookiecutter.project_name }}/pyproject.toml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ python = "^{{ cookiecutter.minimal_python_version }}"
4444
{% if cookiecutter.minimal_python_version == '3.7' -%}importlib_metadata = {version = "^4.5.0", python = "<3.8"}{%- endif -%}
4545
{%+ if cookiecutter.create_example_template == 'cli' %}
4646
typer = {extras = ["all"], version = "^0.3.2"}
47-
rich = "^10.6.0"
47+
rich = "^10.7.0"
4848
{% endif %}
4949
[tool.poetry.dev-dependencies]
5050
bandit = "^1.7.0"
@@ -53,11 +53,11 @@ darglint = "^1.8.0"
5353
isort = {extras = ["colors"], version = "^5.9.3"}
5454
mypy = "^0.910"
5555
mypy-extensions = "^0.4.3"
56-
pre-commit = "^2.13.0"
56+
pre-commit = "^2.14.0"
5757
pydocstyle = "^6.1.1"
58-
pylint = "^2.9.6"
58+
pylint = "^2.10.2"
5959
pytest = "^6.2.4"
60-
pyupgrade = "^2.23.3"
60+
pyupgrade = "^2.24.0"
6161
safety = "^1.10.3"
6262

6363
[tool.black]
@@ -96,7 +96,7 @@ indent = 4
9696
color_output = true
9797

9898
[tool.mypy]
99-
# mypy configurations: https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
99+
# https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
100100
python_version = {{ cookiecutter.minimal_python_version }}
101101
pretty = true
102102
show_traceback = true
@@ -119,4 +119,19 @@ warn_redundant_casts = true
119119
warn_return_any = true
120120
warn_unreachable = true
121121
warn_unused_configs = true
122-
warn_unused_ignores = true
122+
warn_unused_ignores = true
123+
124+
125+
[tool.pytest.ini_options]
126+
# https://docs.pytest.org/en/6.2.x/customize.html#pyproject-toml
127+
# Directories that are not visited by pytest collector:
128+
norecursedirs =["hooks", "*.egg", ".eggs", "dist", "build", "docs", ".tox", ".git", "__pycache__"]
129+
doctest_optionflags = ["NUMBER", "NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]
130+
131+
# Extra options:
132+
addopts = [
133+
"--strict-markers",
134+
"--tb=short",
135+
"--doctest-modules",
136+
"--doctest-continue-on-failure",
137+
]
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
[darglint]
2-
# darglint configuration: https://github.com/terrencepreilly/darglint
2+
# https://github.com/terrencepreilly/darglint
33
strictness = long
44
docstring_style = google
5-
6-
[tool:pytest]
7-
# Directories that are not visited by pytest collector:
8-
norecursedirs = *.egg .eggs dist build docs .tox .git __pycache__
9-
doctest_optionflags = NUMBER NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL
10-
11-
# Extra options:
12-
addopts =
13-
--strict-markers
14-
--tb=short
15-
--doctest-modules
16-
--doctest-continue-on-failure

0 commit comments

Comments
 (0)