Refactor Move-to-PEP-621-declarative-metadata.patch

This rebases the patch and changes it to use the %version from the
specfile to prevent the versions from getting un-synced like they did in
f450b112a2.
This commit is contained in:
Maxwell G 2023-06-07 20:29:21 +00:00
parent 2380c1aa09
commit 4fcd3c944b
No known key found for this signature in database
GPG Key ID: F79E4E25E8C661F8
2 changed files with 12 additions and 23 deletions

View File

@ -1,21 +1,19 @@
From 8a055314b9d43ccf135b5daaa9dba95d6b4698ab Mon Sep 17 00:00:00 2001
From 49510fec2cddeb796ab4078be4577eee624833f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
Date: Tue, 21 Feb 2023 18:22:42 +0100
Subject: [PATCH] Move to PEP 621 declarative metadata
Subject: [PATCH] Move to PEP 621 declarative metadata
---
pyproject.toml | 35 +++++++++++++++++++++++++++++++-
setup.py | 33 ------------------------------
src/trove_classifiers/version.py | 1 +
3 files changed, 35 insertions(+), 34 deletions(-)
pyproject.toml | 31 ++++++++++++++++++++++++++++++-
setup.py | 33 ---------------------------------
2 files changed, 30 insertions(+), 34 deletions(-)
delete mode 100644 setup.py
create mode 100644 src/trove_classifiers/version.py
diff --git a/pyproject.toml b/pyproject.toml
index 672fc13..23542a4 100644
index 05374a2..1134247 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,40 @@
@@ -1,7 +1,36 @@
[build-system]
-requires = ["setuptools", "calver"]
+requires = ["setuptools >= 61.0"]
@ -23,6 +21,7 @@ index 672fc13..23542a4 100644
+[project]
+name = "trove-classifiers"
+version = "@@VERSION@@"
+readme = "README.md"
+description = "Canonical source for classifiers on PyPI (pypi.org)."
+authors = [{name = "The PyPI Admins", email = "admin@pypi.org"}]
@ -34,7 +33,6 @@ index 672fc13..23542a4 100644
+ "Typing :: Typed",
+]
+keywords = ["classifiers"]
+dynamic = ["version"]
+
+[project.urls]
+Homepage = "https://github.com/pypa/trove-classifiers"
@ -50,11 +48,7 @@ index 672fc13..23542a4 100644
+[tool.setuptools.package-data]
+"*" = ["py.typed"]
+
+[tool.setuptools.dynamic.version]
+attr = "trove_classifiers.version.__version__"
+
+
[mypy]
[tool.mypy]
strict = true
warn_unreachable = true
diff --git a/setup.py b/setup.py
@ -96,13 +90,6 @@ index 826eac7..0000000
- use_calver=True,
- setup_requires=["calver"],
-)
diff --git a/src/trove_classifiers/version.py b/src/trove_classifiers/version.py
new file mode 100644
index 0000000..49cb855
--- /dev/null
+++ b/src/trove_classifiers/version.py
@@ -0,0 +1 @@
+__version__ = "2023.2.20"
--
2.38.1
2.40.1

View File

@ -32,6 +32,8 @@ Summary: %{summary}
%prep
%autosetup -p1 -n trove-classifiers-%{version}
# Replace @@VERSION@@ with %%version
%writevars -f pyproject.toml version
%generate_buildrequires