Add pytest to dev dependencies;

upgrade dev dependencies;
remove unnecessary main test script entrypoint;
remove unnecessary line from `.gitignore`;
put repo description variable into top-level `__init__.py`;
introduce syntax-error as a reminder to fix copyright;
add CSS fix for broken inline-code segments;
update `index.md` layout;
reorder linting script calls and add a bit more output;
support Python 3.8+ by default;
fix wrong dependency file reference in `pyproject.toml`;
add `pytest` config to `pyproject.toml`;
call `pytest` in `coverage` config;
add a few sensible rule-ignores to `ruff` config
This commit is contained in:
2023-10-27 12:20:41 +02:00
parent 1a293563d1
commit c50cfe88d6
8 changed files with 48 additions and 39 deletions

View File

@ -2,7 +2,10 @@
# Python packaging: #
[build-system]
requires = ["setuptools", "setuptools-scm"]
requires = [
"setuptools",
"setuptools-scm",
]
build-backend = "setuptools.build_meta"
[project]
@ -14,7 +17,7 @@ authors = [
maintainers = [
{ name = ..., email = ... },
]
requires-python = ">=3.9, <4.0"
requires-python = ">=3.8, <4.0"
keywords = [
...
]
@ -41,14 +44,15 @@ dynamic = [
[project.optional-dependencies]
full = []
dev = [
"black==23.9.1",
"black==23.10.1",
"build==1.0.3",
"coverage[toml]==7.3.2",
"isort==5.12.0",
"mkdocs-material==9.4.6",
"mkdocstrings[python]==0.23.0",
"mypy==1.5.1",
"ruff==0.0.292",
"pytest==7.4.3",
"ruff==0.1.3",
]
[project.urls]
@ -57,9 +61,9 @@ dev = [
"Documentation" = "http://${REPO_OWNER_LOWER}.github.io/${REPO_NAME_LOWER}"
[tool.setuptools.dynamic]
dependencies = { file = "requirements/common.txt" }
dependencies = { file = "requirements/base.txt" }
readme = { file = ["README.md"], content-type = "text/markdown" }
version = {attr = ..."${REPO_NAME}.__version__"}
version = { attr = ..."${REPO_NAME}.__version__" }
#########################
# Static type checking: #
@ -75,6 +79,16 @@ strict = true
show_error_codes = true
plugins = []
############
# Testing: #
[tool.pytest.ini_options]
cache_dir = ".cache/pytest"
addopts = "-ra -v"
testpaths = [
"tests",
]
#######################
# Unit test coverage: #
@ -84,7 +98,7 @@ source = [
"src/",
]
branch = true
command_line = "-m tests"
command_line = "-m pytest -qq"
omit = [
".venv*/*",
]
@ -140,6 +154,7 @@ ignore = [
"ANN101", # Missing type annotation for self in method -> unnecessary
"ANN102", # Missing type annotation for cls in classmethod -> unnecessary
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed -> we'll use it sparingly
"N818", # Exception name should be named with an Error suffix -> absolutely not
]
[tool.ruff.per-file-ignores]
@ -152,7 +167,11 @@ ignore = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"S101", # Use of `assert` detected
"FBT", # flake8-boolean-trap
"TRY", # tryceratops
]
####################