Skip to content

Commit d4934b1

Browse files
authored
Drop 3.6 & switch to 100% static packaging configuration (#993)
* Drop 3.6 & move to Hatch + static metadata Use ubuntu-latest again * Use hatch-autorun instead of coverage-enable-subprocess * Fix hostname * Simplify tox.ini * Move changelog check to docs jobs * Hatchling supports PEP 639 just fine
1 parent c02d993 commit d4934b1

File tree

10 files changed

+336
-279
lines changed

10 files changed

+336
-279
lines changed

.github/workflows/ci.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ permissions:
2222
jobs:
2323
tests:
2424
name: tox on ${{ matrix.python-version }}
25-
runs-on: ubuntu-20.04
25+
runs-on: ubuntu-latest
2626

2727
strategy:
2828
fail-fast: false
2929
matrix:
3030
python-version:
31-
- "3.6"
3231
- "3.7"
3332
- "3.8"
3433
- "3.9"
@@ -133,7 +132,7 @@ jobs:
133132
python-version: "3.10"
134133

135134
- run: python -m pip install --upgrade wheel tox
136-
- run: python -m tox -e docs
135+
- run: python -m tox -e docs,changelog
137136

138137
pyright:
139138
name: Check types using pyright

MANIFEST.in

-25
This file was deleted.

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
</a>
88
</p>
99

10-
<!-- logo-end -->
11-
1210
<p align="center">
1311
<a href="https://www.attrs.org/en/stable/">
1412
<img src="https://img.shields.io/badge/Docs-RTD-black" alt="Documentation" />

pyproject.toml

+120-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,126 @@
11
# SPDX-License-Identifier: MIT
22

33
[build-system]
4-
requires = ["setuptools>=40.6.0", "wheel"]
5-
build-backend = "setuptools.build_meta"
4+
requires = ["hatchling", "hatch-fancy-pypi-readme"]
5+
build-backend = "hatchling.build"
6+
7+
8+
[project]
9+
name = "attrs"
10+
version = "23.1.0.dev0"
11+
authors = [{ name = "Hynek Schlawack", email = "hs@ox.cx" }]
12+
license = "MIT"
13+
requires-python = ">=3.7"
14+
description = "Classes Without Boilerplate"
15+
keywords = ["class", "attribute", "boilerplate"]
16+
classifiers = [
17+
"Development Status :: 5 - Production/Stable",
18+
"Intended Audience :: Developers",
19+
"Natural Language :: English",
20+
"License :: OSI Approved :: MIT License",
21+
"Operating System :: OS Independent",
22+
"Programming Language :: Python",
23+
"Programming Language :: Python :: 3",
24+
"Programming Language :: Python :: 3.7",
25+
"Programming Language :: Python :: 3.8",
26+
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3.10",
28+
"Programming Language :: Python :: 3.11",
29+
"Programming Language :: Python :: Implementation :: CPython",
30+
"Programming Language :: Python :: Implementation :: PyPy",
31+
"Topic :: Software Development :: Libraries :: Python Modules",
32+
]
33+
dependencies = ["importlib_metadata;python_version<'3.8'"]
34+
dynamic = ["readme"]
35+
36+
[project.optional-dependencies]
37+
tests-no-zope = [
38+
# For regression test to ensure cloudpickle compat doesn't break.
39+
'cloudpickle; python_implementation == "CPython"',
40+
"hypothesis",
41+
"pympler",
42+
# 4.3.0 dropped last use of `convert`
43+
"pytest>=4.3.0",
44+
"pytest-xdist[psutil]",
45+
# Since the mypy error messages keep changing, we have to keep updating this
46+
# pin.
47+
'mypy>=0.971,<0.990; python_implementation == "CPython"',
48+
'pytest-mypy-plugins; python_implementation == "CPython" and python_version<"3.11"',
49+
]
50+
tests = ["attrs[tests-no-zope]", "zope.interface"]
51+
cov = [
52+
"attrs[tests]",
53+
# Ensure coverage is new enough for `source_pkgs`.
54+
"coverage>=5.3",
55+
]
56+
docs = [
57+
"furo",
58+
"myst-parser",
59+
"sphinx",
60+
"zope.interface",
61+
"sphinx-notfound-page",
62+
"sphinxcontrib-towncrier",
63+
"towncrier",
64+
]
65+
dev = ["attrs[tests,docs]", "pre-commit"]
66+
67+
[project.urls]
68+
Documentation = "https://www.attrs.org/"
69+
Changelog = "https://www.attrs.org/en/stable/changelog.html"
70+
"Bug Tracker" = "https://github.com/python-attrs/attrs/issues"
71+
"Source Code" = "https://github.com/python-attrs/attrs"
72+
Funding = "https://github.com/sponsors/hynek"
73+
Tidelift = "https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=pypi"
74+
Ko-fi = "https://ko-fi.com/the_hynek"
75+
76+
77+
[tool.hatch.build.targets.wheel]
78+
packages = ["src/attr", "src/attrs"]
79+
80+
[tool.hatch.metadata.hooks.fancy-pypi-readme]
81+
content-type = "text/markdown"
82+
83+
# PyPI doesn't support the <picture> tag.
84+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
85+
text = """<p align="center">
86+
<a href="https://www.attrs.org/">
87+
<img src="https://raw.githubusercontent.com/python-attrs/attrs/main/docs/_static/attrs_logo.svg" width="35%" alt="attrs" />
88+
</a>
89+
</p>
90+
"""
91+
92+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
93+
path = "README.md"
94+
start-after = "<!-- teaser-begin -->"
95+
96+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
97+
text = """
98+
99+
## Release Information
100+
101+
"""
102+
103+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
104+
path = "CHANGELOG.md"
105+
pattern = "\n(###.+?\n)## "
106+
107+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
108+
text = """
109+
110+
---
111+
112+
[Full changelog](https://www.attrs.org/en/stable/changelog.html)
113+
"""
114+
115+
116+
# Make coverage play nicely with pytest-xdist.
117+
[tool.hatch.build.targets.wheel.hooks.autorun]
118+
dependencies = ["hatch-autorun"]
119+
code = """
120+
import coverage
121+
coverage.process_startup()
122+
"""
123+
enable-by-default = false
6124

7125

8126
[tool.pytest.ini_options]

setup.py

-163
This file was deleted.

0 commit comments

Comments
 (0)