Skip to content

Commit 0dfdbfb

Browse files
committed
Migrate project metadata to pyproject.toml
- Migrate all project metadata from setup.cfg to pyproject.toml - Convert dev dependencies to PEP 735 dependency-groups - Remove dev extra from optional-dependencies - Update all requirements files to remove dev extra - Update tox.ini to remove dev extra and specify deps explicitly - Simplify setup.cfg to only contain bumpversion and flake8 configs - Fix entry point syntax (remove invalid [cli] extra notation) - Migrate pytest configuration to pyproject.toml This modernizes the project structure following current Python packaging best practices (PEP 621, PEP 735).
1 parent ceadd0b commit 0dfdbfb

9 files changed

Lines changed: 86 additions & 85 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Migrate project metadata to pyproject.toml and convert dev dependencies to PEP 735 dependency group

pyproject.toml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,82 @@
22
requires = ["setuptools>80", "wheel", "setuptools_scm[toml]>9"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
name = "prance"
7+
description = "Resolving Swagger/OpenAPI 2.0 and 3.0.0 Parser"
8+
readme = {file = "README.rst", content-type = "text/x-rst"}
9+
requires-python = ">=3.10"
10+
license = {text = "MITNFA"}
11+
authors = [
12+
{name = "Jens Finkhaeuser", email = "jens@finkhaeuser.de"}
13+
]
14+
maintainers = [
15+
{name = "Ronny Pfannschmidt", email = "opensource@ronnypfannschmidt.de"}
16+
]
17+
keywords = ["swagger", "openapi", "parsing"]
18+
classifiers = [
19+
"Development Status :: 4 - Beta",
20+
"Environment :: Plugins",
21+
"Intended Audience :: Developers",
22+
"Natural Language :: English",
23+
"Operating System :: OS Independent",
24+
"Programming Language :: Python :: 3",
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.12",
28+
"Programming Language :: Python :: 3.13",
29+
"Programming Language :: Python :: 3.14",
30+
"Topic :: Internet :: WWW/HTTP",
31+
"Topic :: Software Development :: Libraries :: Python Modules",
32+
]
33+
dependencies = [
34+
"chardet>=5.2",
35+
"ruamel.yaml>=0.18.16",
36+
"requests>=2.32.5",
37+
"packaging>=25.0",
38+
]
39+
dynamic = ["version"]
40+
41+
[project.urls]
42+
Homepage = "https://github.com/RonnyPfannschmidt/prance"
43+
44+
[project.optional-dependencies]
45+
icu = ["PyICU~=2.14"]
46+
ssv = ["swagger-spec-validator~=3.0.4"]
47+
osv = ["openapi-spec-validator~=0.7.1"]
48+
flex = ["flex~=6.14.1"]
49+
cli = ["click>=8.3.0"]
50+
51+
[project.scripts]
52+
prance = "prance.cli:cli"
53+
54+
[dependency-groups]
55+
dev = [
56+
"tox>=4.32.0",
57+
"bumpversion>=0.6.0",
58+
"pytest>=9.0.1",
59+
"pytest-cov>=7.0.0",
60+
"sphinx>=8.1.3,<8.2",
61+
"towncrier>=25.8.0",
62+
]
63+
64+
[tool.setuptools]
65+
zip-safe = true
66+
include-package-data = true
67+
68+
[tool.setuptools.packages.find]
69+
exclude = ["ez_setup", "examples", "tests"]
570

671
[tool.setuptools_scm]
772
write_to = "prance/_version.py"
873

74+
[tool.pytest.ini_options]
75+
addopts = "--verbose --cov=prance --cov-report=term-missing --cov-fail-under=89"
76+
testpaths = ["tests"]
77+
markers = [
78+
"requires_network: Marks test as requiring network connections (deselect with '-m \"not requires_network\"')",
79+
]
80+
981
[tool.towncrier]
1082
package = "prance"
1183
package_dir = "."

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-e .[dev,ssv,osv,icu,cli]
1+
-e .[ssv,osv,icu,cli]

requirements_bare.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-e .[dev]
1+
-e .

requirements_flex.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-e .[dev,flex,icu]
1+
-e .[flex,icu]

requirements_no_icu.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-e .[dev,ssv,osv,cli]
1+
-e .[ssv,osv,cli]

requirements_no_osv_or_icu.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-e .[dev,ssv,cli]
1+
-e .[ssv,cli]

setup.cfg

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,8 @@
1-
[metadata]
2-
name = prance
3-
description = Resolving Swagger/OpenAPI 2.0 and 3.0.0 Parser
4-
long_description = file: README.rst
5-
long_description_content_type = text/x-rst
6-
classifiers =
7-
Development Status :: 4 - Beta
8-
Environment :: Plugins
9-
Intended Audience :: Developers
10-
Natural Language :: English
11-
Operating System :: OS Independent
12-
Programming Language :: Python :: 3
13-
Programming Language :: Python :: 3.10
14-
Programming Language :: Python :: 3.11
15-
Programming Language :: Python :: 3.12
16-
Programming Language :: Python :: 3.13
17-
Programming Language :: Python :: 3.14
18-
Topic :: Internet :: WWW/HTTP
19-
Topic :: Software Development :: Libraries :: Python Modules
20-
keywords = swagger openapi parsing
21-
author = Jens Finkhaeuser
22-
author_email = jens@finkhaeuser.de
23-
maintainer = Ronny Pfannschmidt
24-
maintainer_email = opensource@ronnypfannschmidt.de
25-
url = https://github.com/RonnyPfannschmidt/prance
26-
license = MITNFA
27-
28-
[options]
29-
packages = find:
30-
include_package_data = True
31-
install_requires =
32-
chardet>=5.2
33-
ruamel.yaml>=0.18.16
34-
requests>=2.32.5
35-
packaging>=25.0
36-
zip_safe = True
37-
python_requires = >=3.10
38-
39-
[options.packages.find]
40-
exclude =
41-
ez_setup
42-
examples
43-
tests
44-
45-
[options.entry_points]
46-
console_scripts =
47-
prance=prance.cli:cli [cli]
48-
49-
[options.extras_require]
50-
dev =
51-
tox>=4.32.0
52-
bumpversion>=0.6.0
53-
pytest>=9.0.1
54-
pytest-cov>=7.0.0
55-
sphinx>=8.1.3,<8.2
56-
towncrier>=25.8.0
57-
icu = PyICU~=2.14
58-
ssv = swagger-spec-validator~=3.0.4
59-
osv = openapi-spec-validator~=0.7.1
60-
flex = flex~=6.14.1
61-
cli = click>=8.3.0
62-
631
[bumpversion]
642
current_version = 0.20.2
653
commit = True
664
tag = True
675

68-
[aliases]
69-
test = pytest
70-
71-
[tool:pytest]
72-
addopts = --verbose --cov=prance --cov-report=term-missing --cov-fail-under=89
73-
testpaths = tests
74-
markers =
75-
requires_network: Marks test as requiring network connections (deselect with '-m "not requires_network"')
76-
77-
786
[flake8]
797
inline_quotes = double
808
exclude =

tox.ini

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ isolated_build=true
66
[testenv]
77
# Different dependencies for different test environments
88
extras =
9-
default: dev,ssv,osv,icu,cli
10-
no_icu: dev,ssv,osv,cli
11-
no_osv_or_icu: dev,ssv,cli
12-
flex: dev,flex,icu
13-
bare: dev
9+
default: ssv,osv,icu,cli
10+
no_icu: ssv,osv,cli
11+
no_osv_or_icu: ssv,cli
12+
flex: flex,icu
1413
deps =
15-
pytest
16-
pytest-cov
14+
pytest>=9.0.1
15+
pytest-cov>=7.0.0
1716
# We need to set environment variables for py3 to work with click
1817
setenv =
1918
LC_ALL=C.UTF-8
@@ -22,7 +21,8 @@ setenv =
2221
commands =
2322
pytest {posargs}
2423
[testenv:docs]
25-
extras=dev
24+
deps =
25+
sphinx>=8.1.3,<8.2
2626
commands =
2727
sphinx-build -b html \
2828
-d docs/build/doctrees \

0 commit comments

Comments
 (0)