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

Commit

Permalink
Migrate pytest config to pyproject.toml #361
Browse files Browse the repository at this point in the history
  • Loading branch information
TezRomacH committed Aug 23, 2021
1 parent b1d4ff8 commit 275d563
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 132 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ formatting: codestyle
#* Linting
.PHONY: test
test:
poetry run pytest
poetry run pytest -c pyproject.toml

.PHONY: check-codestyle
check-codestyle:
Expand Down
143 changes: 72 additions & 71 deletions poetry.lock

Large diffs are not rendered by default.

25 changes: 20 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "python-package-template"
version = "1.0.11"
version = "1.1.0"
description = "Cookiecutter template for Python cli/packages"
readme = "README.md"
authors = ["Roman Tezikov <[email protected]>"]
Expand Down Expand Up @@ -40,11 +40,11 @@ darglint = "^1.8.0"
isort = {extras = ["colors"], version = "^5.9.3"}
mypy = "^0.910"
mypy-extensions = "^0.4.3"
pre-commit = "^2.13.0"
pre-commit = "^2.14.0"
pydocstyle = "^6.1.1"
pylint = "^2.9.6"
pylint = "^2.10.2"
pytest = "^6.2.4"
pyupgrade = "^2.23.3"
pyupgrade = "^2.24.0"
safety = "^1.10.3"

[tool.black]
Expand Down Expand Up @@ -84,7 +84,7 @@ color_output = true


[tool.mypy]
# mypy configurations: https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
# https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
python_version = 3.7
pretty = true
show_traceback = true
Expand All @@ -108,3 +108,18 @@ warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true


[tool.pytest.ini_options]
# https://docs.pytest.org/en/6.2.x/customize.html#pyproject-toml
# Directories that are not visited by pytest collector:
norecursedirs =["{{ cookiecutter.project_name }}", "hooks", "*.egg", ".eggs", "dist", "build", "docs", ".tox", ".git", "__pycache__"]
doctest_optionflags = ["NUMBER", "NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]

# Extra options:
addopts = [
"--strict-markers",
"--tb=short",
"--doctest-modules",
"--doctest-continue-on-failure",
]
22 changes: 0 additions & 22 deletions requirements.txt

This file was deleted.

14 changes: 1 addition & 13 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
[darglint]
# darglint configuration: https://github.com/terrencepreilly/darglint
# https://github.com/terrencepreilly/darglint
strictness = long
docstring_style = google

[tool:pytest]
# Directories that are not visited by pytest collector:
norecursedirs = "{{ cookiecutter.project_name }}" hooks *.egg .eggs dist build docs .tox .git __pycache__
doctest_optionflags = NUMBER NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL

# Extra options:
addopts =
--strict-markers
--tb=short
--doctest-modules
--doctest-continue-on-failure
2 changes: 1 addition & 1 deletion {{ cookiecutter.project_name }}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ formatting: codestyle
#* Linting
.PHONY: test
test:
poetry run pytest
poetry run pytest -c pyproject.toml

.PHONY: check-codestyle
check-codestyle:
Expand Down
27 changes: 21 additions & 6 deletions {{ cookiecutter.project_name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ python = "^{{ cookiecutter.minimal_python_version }}"
{% if cookiecutter.minimal_python_version == '3.7' -%}importlib_metadata = {version = "^4.5.0", python = "<3.8"}{%- endif -%}
{%+ if cookiecutter.create_example_template == 'cli' %}
typer = {extras = ["all"], version = "^0.3.2"}
rich = "^10.6.0"
rich = "^10.7.0"
{% endif %}
[tool.poetry.dev-dependencies]
bandit = "^1.7.0"
Expand All @@ -53,11 +53,11 @@ darglint = "^1.8.0"
isort = {extras = ["colors"], version = "^5.9.3"}
mypy = "^0.910"
mypy-extensions = "^0.4.3"
pre-commit = "^2.13.0"
pre-commit = "^2.14.0"
pydocstyle = "^6.1.1"
pylint = "^2.9.6"
pylint = "^2.10.2"
pytest = "^6.2.4"
pyupgrade = "^2.23.3"
pyupgrade = "^2.24.0"
safety = "^1.10.3"

[tool.black]
Expand Down Expand Up @@ -96,7 +96,7 @@ indent = 4
color_output = true

[tool.mypy]
# mypy configurations: https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
# https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
python_version = {{ cookiecutter.minimal_python_version }}
pretty = true
show_traceback = true
Expand All @@ -119,4 +119,19 @@ warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
warn_unused_ignores = true


[tool.pytest.ini_options]
# https://docs.pytest.org/en/6.2.x/customize.html#pyproject-toml
# Directories that are not visited by pytest collector:
norecursedirs =["hooks", "*.egg", ".eggs", "dist", "build", "docs", ".tox", ".git", "__pycache__"]
doctest_optionflags = ["NUMBER", "NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]

# Extra options:
addopts = [
"--strict-markers",
"--tb=short",
"--doctest-modules",
"--doctest-continue-on-failure",
]
14 changes: 1 addition & 13 deletions {{ cookiecutter.project_name }}/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
[darglint]
# darglint configuration: https://github.com/terrencepreilly/darglint
# https://github.com/terrencepreilly/darglint
strictness = long
docstring_style = google

[tool:pytest]
# Directories that are not visited by pytest collector:
norecursedirs = *.egg .eggs dist build docs .tox .git __pycache__
doctest_optionflags = NUMBER NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL

# Extra options:
addopts =
--strict-markers
--tb=short
--doctest-modules
--doctest-continue-on-failure

0 comments on commit 275d563

Please sign in to comment.