|
| 1 | +[build-system] |
| 2 | +requires = ["setuptools", "wheel"] |
| 3 | +build-backend = "setuptools.build_meta" |
| 4 | + |
| 5 | +[project] |
| 6 | +name = "module-name" |
| 7 | +version = "0.1.0" |
| 8 | +requires-python = ">=3.7" |
| 9 | +description = "Module Description" |
| 10 | +readme = "README.md" |
| 11 | +license = { file = "LICENSE" } |
| 12 | +authors = [ |
| 13 | + { email = "yourname@email.invalid", name = "[YOUR NAME]" } |
| 14 | +] |
| 15 | +maintainers = [] |
| 16 | +keywords = [] |
| 17 | +classifiers = [ |
| 18 | + "License :: OSI Approved :: MIT License", |
| 19 | + "Programming Language :: Python :: 3", |
| 20 | + "Programming Language :: Python :: 3 :: Only", |
| 21 | + "Programming Language :: Python :: Implementation :: CPython" |
| 22 | +] |
| 23 | + |
| 24 | +dependencies = [] |
| 25 | + |
| 26 | +[project.optional-dependencies] |
| 27 | +dev = [ |
| 28 | + "pre-commit", |
| 29 | + "black", |
| 30 | + "mypy", |
| 31 | + "flake8", |
| 32 | + "flake8-builtins", |
| 33 | + "flake8-pep585", |
| 34 | +] |
| 35 | +test = [ |
| 36 | + "pytest", |
| 37 | + "pytest-randomly", |
| 38 | + "coverage", |
| 39 | + "tox" |
| 40 | +] |
| 41 | + |
| 42 | +[project.urls] |
| 43 | +homepage = "https://github.com/[ORG NAME]/[REPO NAME]" |
| 44 | +# documentation = "" |
| 45 | +# repository = "" |
| 46 | +# changelog = "" |
| 47 | + |
| 48 | +# CLI scripts if needed |
| 49 | +# [project.scripts] |
| 50 | +# python-src-example = "module_name.sample:main" |
| 51 | + |
| 52 | +[tool.setuptools.package-data] |
| 53 | +"module_name" = ["py.typed"] |
| 54 | + |
| 55 | +[tool.mypy] |
| 56 | +check_untyped_defs = true |
| 57 | +disallow_any_generics = true |
| 58 | +disallow_incomplete_defs = true |
| 59 | +disallow_untyped_defs = true |
| 60 | +no_implicit_optional = true |
| 61 | +warn_redundant_casts = true |
| 62 | +warn_unused_ignores = true |
| 63 | + |
| 64 | +[[tool.mypy.overrides]] |
| 65 | +module = "tests.*" |
| 66 | +disallow_incomplete_defs = false |
| 67 | +disallow_untyped_defs = false |
| 68 | +warn_unused_ignores = false |
| 69 | + |
| 70 | +[tool.coverage.run] |
| 71 | +branch = true |
| 72 | +source = [ |
| 73 | + "tests", |
| 74 | +] |
| 75 | +source_pkgs = [ |
| 76 | + "module_name", |
| 77 | +] |
| 78 | + |
| 79 | +[tool.coverage.paths] |
| 80 | +source = [ |
| 81 | + "src/", |
| 82 | + "*/site-packages", |
| 83 | +] |
| 84 | +test = [ |
| 85 | + "tests/", |
| 86 | + "*/tests", |
| 87 | +] |
| 88 | + |
| 89 | +[tool.coverage.report] |
| 90 | +exclude_lines =[ |
| 91 | + "pragma: no cover", |
| 92 | + "raise NotImplementedError", |
| 93 | + "if __name__ == .__main__.:", |
| 94 | + "\\.\\.\\.", |
| 95 | + "if TYPE_CHECKING:", |
| 96 | +] |
| 97 | + |
| 98 | +# This is ignored by flake8, here in case they decide to add it in the future |
| 99 | +[tool.flake8] |
| 100 | +ignore = "W503,E203" |
| 101 | +max-line-length = 88 |
| 102 | + |
| 103 | +[tool.tox] |
| 104 | +legacy_tox_ini = """ |
| 105 | +[tox] |
| 106 | +envlist = py37,py38,py39,py310,py311,py312,coverage,mypy |
| 107 | +skip_missing_interpreters = true |
| 108 | +isolated_build = True |
| 109 | +
|
| 110 | +[testenv] |
| 111 | +deps = |
| 112 | + .[test] |
| 113 | +commands = |
| 114 | + coverage run -p -m pytest tests/ |
| 115 | +
|
| 116 | +[testenv:coverage] |
| 117 | +depends = py37,py38,py39,py310,py311,py312 |
| 118 | +parallel_show_output = true |
| 119 | +commands = |
| 120 | + python -m coverage combine |
| 121 | + python -m coverage report -m --fail-under=50 |
| 122 | + python -m coverage json |
| 123 | +
|
| 124 | +[testenv:mypy] |
| 125 | +deps = |
| 126 | + mypy |
| 127 | +commands = |
| 128 | + mypy -p module_name --no-incremental |
| 129 | +""" |
0 commit comments