Skip to content

Commit

Permalink
Drop 3.6 & switch to 100% static packaging configuration (#993)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
hynek committed Jan 11, 2023
1 parent c02d993 commit d4934b1
Show file tree
Hide file tree
Showing 10 changed files with 336 additions and 279 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -22,13 +22,12 @@ permissions:
jobs:
tests:
name: tox on ${{ matrix.python-version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
Expand Down Expand Up @@ -133,7 +132,7 @@ jobs:
python-version: "3.10"

- run: python -m pip install --upgrade wheel tox
- run: python -m tox -e docs
- run: python -m tox -e docs,changelog

pyright:
name: Check types using pyright
Expand Down
25 changes: 0 additions & 25 deletions MANIFEST.in

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -7,8 +7,6 @@
</a>
</p>

<!-- logo-end -->

<p align="center">
<a href="https://www.attrs.org/en/stable/">
<img src="https://img.shields.io/badge/Docs-RTD-black" alt="Documentation" />
Expand Down
122 changes: 120 additions & 2 deletions pyproject.toml
@@ -1,8 +1,126 @@
# SPDX-License-Identifier: MIT

[build-system]
requires = ["setuptools>=40.6.0", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"


[project]
name = "attrs"
version = "23.1.0.dev0"
authors = [{ name = "Hynek Schlawack", email = "hs@ox.cx" }]
license = "MIT"
requires-python = ">=3.7"
description = "Classes Without Boilerplate"
keywords = ["class", "attribute", "boilerplate"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = ["importlib_metadata;python_version<'3.8'"]
dynamic = ["readme"]

[project.optional-dependencies]
tests-no-zope = [
# For regression test to ensure cloudpickle compat doesn't break.
'cloudpickle; python_implementation == "CPython"',
"hypothesis",
"pympler",
# 4.3.0 dropped last use of `convert`
"pytest>=4.3.0",
"pytest-xdist[psutil]",
# Since the mypy error messages keep changing, we have to keep updating this
# pin.
'mypy>=0.971,<0.990; python_implementation == "CPython"',
'pytest-mypy-plugins; python_implementation == "CPython" and python_version<"3.11"',
]
tests = ["attrs[tests-no-zope]", "zope.interface"]
cov = [
"attrs[tests]",
# Ensure coverage is new enough for `source_pkgs`.
"coverage>=5.3",
]
docs = [
"furo",
"myst-parser",
"sphinx",
"zope.interface",
"sphinx-notfound-page",
"sphinxcontrib-towncrier",
"towncrier",
]
dev = ["attrs[tests,docs]", "pre-commit"]

[project.urls]
Documentation = "https://www.attrs.org/"
Changelog = "https://www.attrs.org/en/stable/changelog.html"
"Bug Tracker" = "https://github.com/python-attrs/attrs/issues"
"Source Code" = "https://github.com/python-attrs/attrs"
Funding = "https://github.com/sponsors/hynek"
Tidelift = "https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=pypi"
Ko-fi = "https://ko-fi.com/the_hynek"


[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 = """
---
[Full changelog](https://www.attrs.org/en/stable/changelog.html)
"""


# Make coverage play nicely with pytest-xdist.
[tool.hatch.build.targets.wheel.hooks.autorun]
dependencies = ["hatch-autorun"]
code = """
import coverage
coverage.process_startup()
"""
enable-by-default = false


[tool.pytest.ini_options]
Expand Down
163 changes: 0 additions & 163 deletions setup.py

This file was deleted.

0 comments on commit d4934b1

Please sign in to comment.