2022-08-10 12:15:32 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2018-06-23 09:50:49 +00:00
|
|
|
[build-system]
|
2023-12-31 05:39:56 +00:00
|
|
|
requires = ["hatchling", "hatch-vcs", "hatch-fancy-pypi-readme>=23.2.0"]
|
2023-01-11 15:50:27 +00:00
|
|
|
build-backend = "hatchling.build"
|
|
|
|
|
|
|
|
|
|
|
|
[project]
|
|
|
|
name = "attrs"
|
|
|
|
authors = [{ name = "Hynek Schlawack", email = "hs@ox.cx" }]
|
2024-08-23 21:50:30 +00:00
|
|
|
license = { text = "MIT" }
|
2024-08-29 15:35:04 +00:00
|
|
|
requires-python = ">=3.8"
|
2023-01-11 15:50:27 +00:00
|
|
|
description = "Classes Without Boilerplate"
|
|
|
|
keywords = ["class", "attribute", "boilerplate"]
|
|
|
|
classifiers = [
|
2023-08-16 04:03:13 +00:00
|
|
|
"Development Status :: 5 - Production/Stable",
|
|
|
|
"License :: OSI Approved :: MIT License",
|
|
|
|
"Programming Language :: Python :: 3.8",
|
|
|
|
"Programming Language :: Python :: 3.9",
|
|
|
|
"Programming Language :: Python :: 3.10",
|
|
|
|
"Programming Language :: Python :: 3.11",
|
|
|
|
"Programming Language :: Python :: 3.12",
|
2024-03-07 10:26:21 +00:00
|
|
|
"Programming Language :: Python :: 3.13",
|
2023-08-16 04:03:13 +00:00
|
|
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
|
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
|
|
"Typing :: Typed",
|
2023-01-11 15:50:27 +00:00
|
|
|
]
|
2024-08-29 15:35:04 +00:00
|
|
|
dependencies = []
|
2023-01-29 10:21:20 +00:00
|
|
|
dynamic = ["version", "readme"]
|
2023-01-11 15:50:27 +00:00
|
|
|
|
|
|
|
[project.optional-dependencies]
|
2023-10-17 03:48:35 +00:00
|
|
|
tests-mypy = [
|
2024-10-14 13:33:12 +00:00
|
|
|
'pytest-mypy-plugins; platform_python_implementation == "CPython" and python_version >= "3.9"',
|
2023-10-17 03:48:35 +00:00
|
|
|
# Since the mypy error messages keep changing, we have to keep updating this
|
|
|
|
# pin.
|
2024-08-03 13:51:38 +00:00
|
|
|
'mypy>=1.11.1; platform_python_implementation == "CPython" and python_version >= "3.9"',
|
2023-10-17 03:48:35 +00:00
|
|
|
]
|
2024-03-16 21:15:47 +00:00
|
|
|
tests = [
|
2023-08-16 04:03:13 +00:00
|
|
|
# For regression test to ensure cloudpickle compat doesn't break.
|
2024-02-16 09:12:37 +00:00
|
|
|
'cloudpickle; platform_python_implementation == "CPython"',
|
2023-08-16 04:03:13 +00:00
|
|
|
"hypothesis",
|
|
|
|
"pympler",
|
|
|
|
# 4.3.0 dropped last use of `convert`
|
2024-03-02 06:40:36 +00:00
|
|
|
"pytest>=4.3.0",
|
2023-08-16 04:03:13 +00:00
|
|
|
"pytest-xdist[psutil]",
|
2023-10-17 03:48:35 +00:00
|
|
|
"attrs[tests-mypy]",
|
2023-01-11 15:50:27 +00:00
|
|
|
]
|
|
|
|
cov = [
|
2023-08-16 04:03:13 +00:00
|
|
|
"attrs[tests]",
|
|
|
|
# Ensure coverage is new enough for `source_pkgs`.
|
|
|
|
"coverage[toml]>=5.3",
|
2023-01-11 15:50:27 +00:00
|
|
|
]
|
2024-08-16 05:10:48 +00:00
|
|
|
benchmark = ["pytest-codspeed", "pytest-xdist[psutil]", "attrs[tests]"]
|
2023-01-11 15:50:27 +00:00
|
|
|
docs = [
|
2024-07-17 13:27:30 +00:00
|
|
|
"cogapp",
|
2023-08-16 04:03:13 +00:00
|
|
|
"furo",
|
|
|
|
"myst-parser",
|
2023-09-08 14:29:45 +00:00
|
|
|
"sphinx",
|
2023-08-16 04:03:13 +00:00
|
|
|
"sphinx-notfound-page",
|
|
|
|
"sphinxcontrib-towncrier",
|
2024-08-16 05:10:48 +00:00
|
|
|
# See https://github.com/sphinx-contrib/sphinxcontrib-towncrier/issues/92
|
|
|
|
# Pin also present in tox.ini
|
2024-07-31 08:00:21 +00:00
|
|
|
"towncrier<24.7",
|
2023-01-11 15:50:27 +00:00
|
|
|
]
|
2024-10-14 06:46:51 +00:00
|
|
|
dev = ["attrs[tests]", "pre-commit-uv"]
|
2023-01-11 15:50:27 +00:00
|
|
|
|
|
|
|
[project.urls]
|
|
|
|
Documentation = "https://www.attrs.org/"
|
|
|
|
Changelog = "https://www.attrs.org/en/stable/changelog.html"
|
2023-08-15 08:10:08 +00:00
|
|
|
GitHub = "https://github.com/python-attrs/attrs"
|
2023-01-11 15:50:27 +00:00
|
|
|
Funding = "https://github.com/sponsors/hynek"
|
|
|
|
Tidelift = "https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=pypi"
|
|
|
|
|
|
|
|
|
2023-01-29 10:21:20 +00:00
|
|
|
[tool.hatch.version]
|
|
|
|
source = "vcs"
|
|
|
|
raw-options = { local_scheme = "no-local-version" }
|
|
|
|
|
2023-01-11 15:50:27 +00:00
|
|
|
[tool.hatch.build.targets.wheel]
|
|
|
|
packages = ["src/attr", "src/attrs"]
|
|
|
|
|
|
|
|
[tool.hatch.metadata.hooks.fancy-pypi-readme]
|
|
|
|
content-type = "text/markdown"
|
|
|
|
|
|
|
|
# PyPI doesn't support the <picture> tag.
|
|
|
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
|
|
|
|
text = """<p align="center">
|
|
|
|
<a href="https://www.attrs.org/">
|
|
|
|
<img src="https://raw.githubusercontent.com/python-attrs/attrs/main/docs/_static/attrs_logo.svg" width="35%" alt="attrs" />
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
"""
|
|
|
|
|
|
|
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
|
|
|
|
path = "README.md"
|
|
|
|
start-after = "<!-- teaser-begin -->"
|
|
|
|
|
|
|
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
|
|
|
|
text = """
|
|
|
|
|
|
|
|
## Release Information
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
|
|
|
|
path = "CHANGELOG.md"
|
|
|
|
pattern = "\n(###.+?\n)## "
|
|
|
|
|
|
|
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
|
|
|
|
text = """
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2024-03-16 13:53:19 +00:00
|
|
|
[Full changelog →](https://www.attrs.org/en/stable/changelog.html)
|
2023-01-11 15:50:27 +00:00
|
|
|
"""
|
|
|
|
|
2023-12-31 05:39:56 +00:00
|
|
|
# Point sponsor image URLs to versions.
|
|
|
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
|
2024-07-17 13:27:30 +00:00
|
|
|
pattern = 'docs\/_static\/sponsors'
|
|
|
|
replacement = 'https://www.attrs.org/en/$HFPR_VERSION/_static/sponsors'
|
|
|
|
|
|
|
|
[[tool.sponcon.sponsors]]
|
|
|
|
title = "Variomedia AG"
|
|
|
|
url = "https://www.variomedia.de/"
|
|
|
|
img = "Variomedia.svg"
|
|
|
|
|
|
|
|
[[tool.sponcon.sponsors]]
|
|
|
|
title = "Tidelift"
|
|
|
|
url = "https://tidelift.com/?utm_source=lifter&utm_medium=referral&utm_campaign=hynek"
|
|
|
|
img = "Tidelift.svg"
|
|
|
|
|
|
|
|
[[tool.sponcon.sponsors]]
|
|
|
|
title = "Klaviyo"
|
|
|
|
url = "https://klaviyo.com/"
|
|
|
|
img = "Klaviyo.svg"
|
|
|
|
|
|
|
|
[[tool.sponcon.sponsors]]
|
|
|
|
title = "FilePreviews"
|
|
|
|
url = "https://filepreviews.io/"
|
|
|
|
img = "FilePreviews.svg"
|
2023-12-31 05:39:56 +00:00
|
|
|
|
2024-08-26 05:09:06 +00:00
|
|
|
[[tool.sponcon.sponsors]]
|
|
|
|
title = "Polar"
|
|
|
|
url = "https://polar.sh/"
|
|
|
|
img = "Polar.svg"
|
|
|
|
|
2023-01-11 15:50:27 +00:00
|
|
|
|
2022-08-10 12:15:32 +00:00
|
|
|
[tool.pytest.ini_options]
|
|
|
|
addopts = ["-ra", "--strict-markers", "--strict-config"]
|
|
|
|
xfail_strict = true
|
|
|
|
testpaths = "tests"
|
|
|
|
filterwarnings = ["once::Warning", "ignore:::pympler[.*]"]
|
|
|
|
|
|
|
|
|
2020-01-06 08:14:24 +00:00
|
|
|
[tool.coverage.run]
|
|
|
|
parallel = true
|
|
|
|
branch = true
|
2022-08-21 07:38:37 +00:00
|
|
|
source_pkgs = ["attr", "attrs"]
|
2020-01-06 08:14:24 +00:00
|
|
|
|
|
|
|
[tool.coverage.paths]
|
2022-12-19 11:03:21 +00:00
|
|
|
source = ["src", ".tox/py*/**/site-packages"]
|
2020-01-06 08:14:24 +00:00
|
|
|
|
|
|
|
[tool.coverage.report]
|
|
|
|
show_missing = true
|
2022-01-31 05:21:18 +00:00
|
|
|
skip_covered = true
|
2020-11-04 10:02:15 +00:00
|
|
|
exclude_lines = [
|
2023-08-16 04:03:13 +00:00
|
|
|
"pragma: no cover",
|
|
|
|
# PyPy is unacceptably slow under coverage.
|
|
|
|
"if PYPY:",
|
|
|
|
# not meant to be executed
|
|
|
|
': \.\.\.$',
|
|
|
|
'^ +\.\.\.$',
|
2020-11-04 10:02:15 +00:00
|
|
|
]
|
2020-01-06 08:14:24 +00:00
|
|
|
|
|
|
|
|
2020-08-25 07:54:28 +00:00
|
|
|
[tool.interrogate]
|
2023-09-08 07:02:46 +00:00
|
|
|
omit-covered-files = true
|
2020-08-25 07:54:28 +00:00
|
|
|
verbose = 2
|
|
|
|
fail-under = 100
|
|
|
|
whitelist-regex = ["test_.*"]
|
|
|
|
|
|
|
|
|
2021-12-25 14:15:10 +00:00
|
|
|
[tool.check-wheel-contents]
|
|
|
|
toplevel = ["attr", "attrs"]
|
|
|
|
|
|
|
|
|
2023-08-15 08:10:08 +00:00
|
|
|
[tool.ruff]
|
|
|
|
src = ["src", "tests", "conftest.py", "docs"]
|
2024-09-05 06:58:23 +00:00
|
|
|
line-length = 79
|
2023-08-15 08:10:08 +00:00
|
|
|
|
2024-02-27 15:18:59 +00:00
|
|
|
[tool.ruff.lint]
|
2023-08-20 10:03:53 +00:00
|
|
|
select = ["ALL"]
|
|
|
|
ignore = [
|
|
|
|
"A001", # shadowing is fine
|
|
|
|
"A002", # shadowing is fine
|
|
|
|
"A003", # shadowing is fine
|
|
|
|
"ANN", # Mypy is better at this
|
|
|
|
"ARG", # unused arguments are normal when implementing interfaces
|
2024-08-16 05:23:14 +00:00
|
|
|
"C901", # we're complex software
|
2024-09-05 06:58:23 +00:00
|
|
|
"COM", # ruff format takes care of our commas
|
2023-08-20 10:03:53 +00:00
|
|
|
"D", # We prefer our own docstring style.
|
2024-09-05 06:58:23 +00:00
|
|
|
"E501", # leave line-length enforcement to ruff format
|
2024-08-16 05:23:14 +00:00
|
|
|
"ERA001", # we need to keep around some notes
|
2023-08-20 10:03:53 +00:00
|
|
|
"FBT", # we don't hate bool args around here
|
|
|
|
"FIX", # Yes, we want XXX as a marker.
|
2024-09-05 06:58:23 +00:00
|
|
|
"ISC001", # conflicts with ruff format
|
2024-08-16 05:23:14 +00:00
|
|
|
"N", # we need more naming freedom
|
|
|
|
"PD", # we're not pandas
|
|
|
|
"PLR0912", # we're complex software
|
2023-08-20 10:03:53 +00:00
|
|
|
"PLR0913", # yes, many arguments, but most have defaults
|
2024-08-16 05:23:14 +00:00
|
|
|
"PLR0915", # we're complex software
|
2023-08-20 10:03:53 +00:00
|
|
|
"PLR2004", # numbers are sometimes fine
|
2024-08-16 05:23:14 +00:00
|
|
|
"PLW0603", # sometimes we need globals
|
|
|
|
"S307", # eval FTW
|
2023-08-20 10:03:53 +00:00
|
|
|
"SLF001", # private members are accessed by friendly functions
|
|
|
|
"TCH", # TYPE_CHECKING blocks break autodocs
|
|
|
|
"TD", # we don't follow other people's todo style
|
|
|
|
"TRY301", # I'm sorry, but this makes not sense for us.
|
2024-08-16 05:23:14 +00:00
|
|
|
"UP031", # format() is slow as molasses; % and f'' FTW.
|
2023-08-20 10:03:53 +00:00
|
|
|
]
|
|
|
|
|
2024-02-02 16:53:31 +00:00
|
|
|
[tool.ruff.lint.per-file-ignores]
|
2024-07-18 09:00:27 +00:00
|
|
|
"bench/**" = [
|
|
|
|
"INP001", # Benchmarks don't have to be importable.
|
|
|
|
]
|
2023-08-20 10:03:53 +00:00
|
|
|
"**/test_*" = [
|
|
|
|
"B015", # pointless comparison in tests aren't pointless
|
2024-08-16 05:10:48 +00:00
|
|
|
"B017", # pytest.raises(Exception) is fine
|
2023-08-20 10:03:53 +00:00
|
|
|
"B018", # pointless expressions in tests aren't pointless
|
|
|
|
"DTZ", # datetime best practices don't matter in tests
|
2024-08-16 05:23:14 +00:00
|
|
|
"EM", # no need for exception msg hygiene in tests
|
2024-08-16 05:10:48 +00:00
|
|
|
"PLE0309", # hash doesn't have to return anything in tests
|
|
|
|
"PLR0124", # pointless comparison in tests aren't pointless
|
|
|
|
"PT011", # broad is fine
|
2023-08-20 10:03:53 +00:00
|
|
|
"PT012", # sometimes we need more than a single stmt
|
|
|
|
"RUF012", # we don't do ClassVar annotations in tests
|
2024-08-16 05:23:14 +00:00
|
|
|
"S", # security concerns don't matter in tests
|
2024-08-16 05:10:48 +00:00
|
|
|
"SIM201", # sometimes we need to check `not ==`
|
|
|
|
"SIM202", # sometimes we need to check `not ==`
|
|
|
|
"SIM300", # Yoda rocks in asserts
|
|
|
|
"TRY", # exception best practices don't matter in tests
|
2023-08-20 10:03:53 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
"src/*/*.pyi" = ["ALL"] # TODO
|
|
|
|
"tests/test_annotations.py" = ["FA100"]
|
2023-08-15 08:10:08 +00:00
|
|
|
"tests/typing_example.py" = [
|
2023-08-20 10:03:53 +00:00
|
|
|
"E741", # ambiguous variable names don't matter in type checks
|
|
|
|
"B018", # useless expressions aren't useless in type checks
|
|
|
|
"B015", # pointless comparison in type checks aren't pointless
|
|
|
|
"UP037", # we test some older syntaxes on purpose
|
2023-08-15 08:10:08 +00:00
|
|
|
]
|
|
|
|
|
2024-02-02 16:53:31 +00:00
|
|
|
[tool.ruff.lint.isort]
|
2023-08-20 10:03:53 +00:00
|
|
|
lines-between-types = 1
|
|
|
|
lines-after-imports = 2
|
|
|
|
|
2023-08-15 08:10:08 +00:00
|
|
|
|
2017-08-20 05:58:08 +00:00
|
|
|
[tool.towncrier]
|
2022-08-10 12:15:32 +00:00
|
|
|
name = "attrs"
|
|
|
|
directory = "changelog.d"
|
2022-12-07 08:15:46 +00:00
|
|
|
filename = "CHANGELOG.md"
|
2022-12-21 08:10:43 +00:00
|
|
|
start_string = "<!-- towncrier release notes start -->\n"
|
2022-12-07 08:15:46 +00:00
|
|
|
template = "changelog.d/towncrier_template.md.jinja"
|
|
|
|
title_format = ""
|
|
|
|
issue_format = "[#{issue}](https://github.com/python-attrs/attrs/issues/{issue})"
|
|
|
|
underlines = ["", "", ""]
|
2022-08-10 12:15:32 +00:00
|
|
|
|
|
|
|
[[tool.towncrier.section]]
|
|
|
|
path = ""
|
|
|
|
|
|
|
|
[[tool.towncrier.type]]
|
|
|
|
directory = "breaking"
|
|
|
|
name = "Backwards-incompatible Changes"
|
|
|
|
showcontent = true
|
|
|
|
|
|
|
|
[[tool.towncrier.type]]
|
|
|
|
directory = "deprecation"
|
|
|
|
name = "Deprecations"
|
|
|
|
showcontent = true
|
|
|
|
|
|
|
|
[[tool.towncrier.type]]
|
|
|
|
directory = "change"
|
|
|
|
name = "Changes"
|
|
|
|
showcontent = true
|
2022-07-28 05:55:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
[tool.mypy]
|
2024-03-11 09:13:28 +00:00
|
|
|
pretty = true
|
2022-07-28 05:55:37 +00:00
|
|
|
disallow_untyped_defs = true
|
|
|
|
check_untyped_defs = true
|