Skip to content

Commit 117b771

Browse files
committed
build: move setup.* into pyproject.toml
1 parent 9603e51 commit 117b771

File tree

8 files changed

+144
-149
lines changed

8 files changed

+144
-149
lines changed

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy
5656
$(PIP_COMPILE) -o requirements/quality.txt requirements/quality.in
5757
$(PIP_COMPILE) -o requirements/tox.txt requirements/tox.in
5858
$(PIP_COMPILE) -o requirements/dev.txt requirements/dev.in
59-
# Splice requirements/base.in into setup.cfg
60-
sed -n -e '1,/begin_install_requires/p' < setup.cfg > setup.tmp
61-
sed -n -e '/^[a-zA-Z]/s/^/ /p' < requirements/base.in >> setup.tmp
62-
sed -n -e '/end_install_requires/,$$p' < setup.cfg >> setup.tmp
63-
mv setup.tmp setup.cfg
6459

6560
diff_upgrade: ## summarize the last `make upgrade`
6661
@# The sort flags sort by the package name first, then by the -/+, and

pyproject.toml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,131 @@
1+
# scriv's pyproject.toml
2+
3+
[project]
4+
name = "scriv"
5+
description = "Scriv changlog management tool"
6+
authors = [
7+
{name = "Ned Batchelder", email = "[email protected]"},
8+
]
9+
license.text = "Apache-2.0"
10+
classifiers = [
11+
"Development Status :: 5 - Production/Stable",
12+
"Intended Audience :: Developers",
13+
"License :: OSI Approved :: Apache Software License",
14+
"Programming Language :: Python",
15+
"Programming Language :: Python :: 3",
16+
"Programming Language :: Python :: 3.9",
17+
"Programming Language :: Python :: 3.10",
18+
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
20+
"Programming Language :: Python :: 3.13",
21+
]
22+
23+
requires-python = ">= 3.9"
24+
25+
dynamic = ["readme", "version", "dependencies"]
26+
27+
[project.urls]
28+
"Mastodon" = "https://hachyderm.io/@nedbat"
29+
"Funding" = "https://github.com/sponsors/nedbat"
30+
"Issues" = "https://github.com/nedbat/scriv/issues"
31+
"Source" = "https://github.com/nedbat/scriv"
32+
"Home" = "https://github.com/nedbat/scriv"
33+
"Documentation" = "https://scriv.readthedocs.io"
34+
35+
[project.scripts]
36+
scriv = "scriv.cli:cli"
37+
38+
[project.optional-dependencies]
39+
toml = [
40+
"tomli; python_version < \"3.11\""
41+
]
42+
yaml = [
43+
"pyyaml"
44+
]
45+
146
[build-system]
247
requires = ["setuptools"]
348
build-backend = "setuptools.build_meta"
49+
50+
[tool.setuptools.packages.find]
51+
where = ["src"]
52+
53+
[tool.setuptools.package-data]
54+
scriv = [
55+
"templates/*.*",
56+
]
57+
58+
[tool.setuptools.dynamic]
59+
version.attr = "scriv.__version__"
60+
readme.file = ["README.rst", "CHANGELOG.rst"]
61+
dependencies.file = ["requirements/core.txt"]
62+
63+
[tool.scriv]
64+
ghrel_template = "file: ghrel_template.md.j2"
65+
rst_header_chars = "-."
66+
version = "literal: src/scriv/__init__.py: __version__"
67+
68+
[tool.isort]
69+
indent = " "
70+
line_length = 80
71+
multi_line_output = 3
72+
include_trailing_comma = true
73+
74+
[tool.pytest]
75+
addopts = "-rfe"
76+
norecursedirs = [".*", "docs", "requirements"]
77+
78+
[tool.coverage.run]
79+
branch = true
80+
source = [
81+
"scriv",
82+
"tests",
83+
]
84+
omit = [
85+
"*/__main__.py",
86+
]
87+
88+
[tool.coverage.report]
89+
precision = 2
90+
exclude_also = [
91+
"def __repr__",
92+
]
93+
94+
[tool.coverage.paths]
95+
source = [
96+
"src",
97+
"*/site-packages",
98+
]
99+
100+
others = [
101+
".",
102+
"*/scriv",
103+
]
104+
105+
[tool.mypy]
106+
python_version = "3.9"
107+
show_column_numbers = true
108+
show_error_codes = true
109+
ignore_missing_imports = true
110+
check_untyped_defs = true
111+
warn_return_any = true
112+
113+
[tool.doc8]
114+
max-line-length = 80
115+
116+
[tool.pycodestyle]
117+
exclude = [".git", ".tox"]
118+
# E203 = whitespace before ':'
119+
# E501 line too long
120+
# W503 line break before binary operator
121+
ignore = ["E203", "E501", "W503"]
122+
123+
[tool.pydocstyle]
124+
# D105 = Missing docstring in magic method
125+
# D200 = One-line docstring should fit on one line with quotes
126+
# D203 = 1 blank line required before class docstring
127+
# D212 = Multi-line docstring summary should start at the first line
128+
# D406 = Section name should end with a newline (numpy style)
129+
# D407 = Missing dashed underline after section (numpy style)
130+
# D413 = Missing blank line after last section (numpy style)
131+
ignore = ["D105", "D200", "D203", "D212", "D406", "D407", "D413"]

requirements/base.in

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
# Core requirements for using this application
22

33
-c constraints.txt
4-
5-
attrs
6-
click
7-
click-log
8-
jinja2>=2.7
9-
markdown-it-py
10-
requests
4+
-r core.txt

requirements/base.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
# make upgrade
66
#
77
attrs==25.3.0
8-
# via -r requirements/base.in
8+
# via -r requirements/core.txt
99
certifi==2025.1.31
1010
# via requests
1111
charset-normalizer==3.4.1
1212
# via requests
1313
click==8.1.8
1414
# via
15-
# -r requirements/base.in
15+
# -r requirements/core.txt
1616
# click-log
1717
click-log==0.4.0
18-
# via -r requirements/base.in
18+
# via -r requirements/core.txt
1919
idna==3.10
2020
# via requests
2121
jinja2==3.1.6
22-
# via -r requirements/base.in
22+
# via -r requirements/core.txt
2323
markdown-it-py==3.0.0
24-
# via -r requirements/base.in
24+
# via -r requirements/core.txt
2525
markupsafe==3.0.2
2626
# via jinja2
2727
mdurl==0.1.2
2828
# via markdown-it-py
2929
requests==2.32.3
30-
# via -r requirements/base.in
30+
# via -r requirements/core.txt
3131
urllib3==2.3.0
3232
# via requests

requirements/core.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Core requirements for using this application
2+
3+
attrs
4+
click
5+
click-log
6+
jinja2>=2.7
7+
markdown-it-py
8+
requests

setup.cfg

Lines changed: 0 additions & 124 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ setenv =
2828
no_extras: SCRIV_TEST_NO_EXTRAS=1
2929
commands =
3030
no_extras: python -m pip uninstall -q -y tomli
31-
coverage run -p -m pytest -Wd -c setup.cfg {posargs}
31+
coverage run -p -m pytest -Wd {posargs}
3232

3333
[testenv:deps]
3434
allowlist_externals =

0 commit comments

Comments
 (0)