Skip to content

Commit

Permalink
Migrate setuptools to use pyproject.toml (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz authored Oct 25, 2023
1 parent d665cc4 commit c1bb1fa
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 80 deletions.
9 changes: 0 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ repos:
rev: 1.2.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
args:
- --include-version-classifiers
- --max-py-version
- '3.12'
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.1
hooks:
Expand Down Expand Up @@ -69,7 +61,6 @@ repos:
- flake8-bugbear
- flake8-comprehensions
- flake8-tidy-imports
- flake8-typing-imports
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
hooks:
Expand Down
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@ requires = [
"setuptools",
]

[project]
name = "blacken-docs"
version = "1.16.0"
description = "Run Black on Python code blocks in documentation files."
readme = {file = "README.rst", content-type = "text/x-rst"}
license = {text = "MIT"}
maintainers = [{name = "Adam Johnson", email = "me@adamj.eu"}]
authors = [{name = "Anthony Sottile", email = "asottile@umich.edu"}]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"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",
"Typing :: Typed",
]
dependencies = [
"black>=22.1",
]
[project.urls]
Changelog = "https://github.com/adamchainz/blacken-docs/blob/main/CHANGELOG.rst"
Repository = "https://github.com/asottile/blacken-docs"
[project.scripts]
blacken-docs = "blacken_docs:main"

[tool.black]
target-version = ['py38']

Expand All @@ -13,6 +45,23 @@ addopts = """\
--strict-markers
"""

[tool.coverage.run]
branch = true
parallel = true
source = [
"blacken_docs",
"tests",
]

[tool.coverage.paths]
source = [
"src",
".tox/**/site-packages",
]

[tool.coverage.report]
show_missing = true

[tool.mypy]
mypy_path = "src/"
namespace_packages = false
Expand Down
3 changes: 2 additions & 1 deletion requirements/py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via black
coverage==7.3.2 \
coverage[toml]==7.3.2 \
--hash=sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1 \
--hash=sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63 \
--hash=sha256:149de1d2401ae4655c436a3dced6dd153f4c3309f599c3d4bd97ab172eaf02d9 \
Expand Down Expand Up @@ -127,6 +127,7 @@ tomli==2.0.1 \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
# via
# black
# coverage
# pytest
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
Expand Down
2 changes: 1 addition & 1 deletion requirements/py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via black
coverage==7.3.2 \
coverage[toml]==7.3.2 \
--hash=sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1 \
--hash=sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63 \
--hash=sha256:149de1d2401ae4655c436a3dced6dd153f4c3309f599c3d4bd97ab172eaf02d9 \
Expand Down
2 changes: 1 addition & 1 deletion requirements/py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via black
coverage==7.3.2 \
coverage[toml]==7.3.2 \
--hash=sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1 \
--hash=sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63 \
--hash=sha256:149de1d2401ae4655c436a3dced6dd153f4c3309f599c3d4bd97ab172eaf02d9 \
Expand Down
3 changes: 2 additions & 1 deletion requirements/py38.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via black
coverage==7.3.2 \
coverage[toml]==7.3.2 \
--hash=sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1 \
--hash=sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63 \
--hash=sha256:149de1d2401ae4655c436a3dced6dd153f4c3309f599c3d4bd97ab172eaf02d9 \
Expand Down Expand Up @@ -131,6 +131,7 @@ tomli==2.0.1 \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
# via
# black
# coverage
# pytest
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
Expand Down
3 changes: 2 additions & 1 deletion requirements/py39.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via black
coverage==7.3.2 \
coverage[toml]==7.3.2 \
--hash=sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1 \
--hash=sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63 \
--hash=sha256:149de1d2401ae4655c436a3dced6dd153f4c3309f599c3d4bd97ab172eaf02d9 \
Expand Down Expand Up @@ -131,6 +131,7 @@ tomli==2.0.1 \
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
# via
# black
# coverage
# pytest
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black>=22.1.0
coverage
coverage[toml]
pytest
pytest-randomly
65 changes: 0 additions & 65 deletions setup.cfg

This file was deleted.

4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ commands =
-W error::PendingDeprecationWarning \
-m coverage run \
-m pytest {posargs:tests}

[flake8]
max-line-length = 88
extend-ignore = E203

0 comments on commit c1bb1fa

Please sign in to comment.