Skip to content

Instantly share code, notes, and snippets.

@os-ia
Last active June 17, 2022 07:49
Show Gist options
  • Save os-ia/ae829810b7d31cd21cb2a6fa25086be9 to your computer and use it in GitHub Desktop.
Save os-ia/ae829810b7d31cd21cb2a6fa25086be9 to your computer and use it in GitHub Desktop.
Example configuration files for Python packages
[build-system]
requires = [
"setuptools",
"wheel",
]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 120
skip-string-normalization = true
[tool.mypy]
check_untyped_defs = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
no_implicit_optional = true
no_implicit_reexport = true
[[tool.mypy.overrides]]
module = [
"testing.*",
"tests.*",
]
disallow_untyped_defs = false
[tool.pytest.ini_options]
addopts = [
"-vvv",
]
minversion = "6.0"
testpaths = [
"tests",
]
filterwarnings = [
"ignore::DeprecationWarning",
]
[tool.coverage.run]
source = ["package_name"]
plugins = ["covdefaults"]
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py36, py37, py38, py39
[testenv]
deps = pytest pytest-cov
commands = pytest tests
"""
[metadata]
name = <package_name>
version = attr: <package_name>.__version__
description = <description>
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/<user>/<package>
author = <author>
author_email = <email>
classifiers =
Operating System :: POSIX :: Linux
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: Implementation :: CPython
Typing :: Typed
keywords = <keywords>
[options]
packages = find:
install_requires =
rich>=10.10.0
toml
python_requires = >=3.6.1
include_package_data = True
[options.packages.find]
exclude =
tests*
[options.entry_points]
console_scripts =
brunbot = <package_name>.main:cli
[options.extras_require]
dev =
flake8
mypy
types-toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment