From a8b4c9a039a2c12c83f5f958ee08be6bb283fd76 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 27 Jul 2023 16:13:57 +0000 Subject: [PATCH] Modify calver patch for EPEL 9 compatibility --- Move-to-PEP-621-declarative-metadata.patch | 95 ------------------- python-trove-classifiers.spec | 6 +- ...py-remove-usage-of-unpackaged-calver.patch | 36 +++++++ 3 files changed, 38 insertions(+), 99 deletions(-) delete mode 100644 Move-to-PEP-621-declarative-metadata.patch create mode 100644 setup.py-remove-usage-of-unpackaged-calver.patch diff --git a/Move-to-PEP-621-declarative-metadata.patch b/Move-to-PEP-621-declarative-metadata.patch deleted file mode 100644 index 14bcdf5..0000000 --- a/Move-to-PEP-621-declarative-metadata.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 49510fec2cddeb796ab4078be4577eee624833f0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= -Date: Tue, 21 Feb 2023 18:22:42 +0100 -Subject: [PATCH] Move to PEP 621 declarative metadata - ---- - pyproject.toml | 31 ++++++++++++++++++++++++++++++- - setup.py | 33 --------------------------------- - 2 files changed, 30 insertions(+), 34 deletions(-) - delete mode 100644 setup.py - -diff --git a/pyproject.toml b/pyproject.toml -index 05374a2..1134247 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -1,7 +1,36 @@ - [build-system] --requires = ["setuptools", "calver"] -+requires = ["setuptools >= 61.0"] - build-backend = "setuptools.build_meta" - -+[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"}] -+classifiers = [ -+ "Development Status :: 5 - Production/Stable", -+ "Intended Audience :: Developers", -+ "License :: OSI Approved :: Apache Software License", -+ "Programming Language :: Python :: 3", -+ "Typing :: Typed", -+] -+keywords = ["classifiers"] -+ -+[project.urls] -+Homepage = "https://github.com/pypa/trove-classifiers" -+ -+[tool.setuptools] -+package-dir = {"" = "src"} -+include-package-data = false -+ -+[tool.setuptools.packages.find] -+where = ["src"] -+namespaces = false -+ -+[tool.setuptools.package-data] -+"*" = ["py.typed"] -+ - [tool.mypy] - strict = true - warn_unreachable = true -diff --git a/setup.py b/setup.py -deleted file mode 100644 -index 826eac7..0000000 ---- a/setup.py -+++ /dev/null -@@ -1,33 +0,0 @@ --from io import open --from os import path -- --from setuptools import setup, find_packages -- --here = path.abspath(path.dirname(__file__)) -- --# Get the long description from the README file --with open(path.join(here, "README.md"), encoding="utf-8") as f: -- long_description = f.read() -- --setup( -- name="trove-classifiers", -- description="Canonical source for classifiers on PyPI (pypi.org).", -- long_description=long_description, -- long_description_content_type="text/markdown", -- url="https://github.com/pypa/trove-classifiers", -- author="The PyPI Admins", -- author_email="admin@pypi.org", -- classifiers=[ -- "Development Status :: 5 - Production/Stable", -- "Intended Audience :: Developers", -- "License :: OSI Approved :: Apache Software License", -- "Programming Language :: Python :: 3", -- "Typing :: Typed", -- ], -- keywords="classifiers", -- package_dir={"": "src"}, -- packages=find_packages(where="src"), -- package_data={"": ["py.typed"]}, -- use_calver=True, -- setup_requires=["calver"], --) --- -2.40.1 - diff --git a/python-trove-classifiers.spec b/python-trove-classifiers.spec index 72805a8..e7e05bb 100644 --- a/python-trove-classifiers.spec +++ b/python-trove-classifiers.spec @@ -8,9 +8,7 @@ URL: https://github.com/pypa/trove-classifiers Source: %{pypi_source trove-classifiers} # Drop dependency on calver which is not packaged in Fedora. -# This patch is rebased version of upstream PR: -# https://github.com/pypa/trove-classifiers/pull/126/commits/809156bb35852bcaa1c753e0165f1814f2bcedf6 -Patch: Move-to-PEP-621-declarative-metadata.patch +Patch: setup.py-remove-usage-of-unpackaged-calver.patch BuildArch: noarch BuildRequires: python3-devel @@ -33,7 +31,7 @@ Summary: %{summary} %prep %autosetup -p1 -n trove-classifiers-%{version} # Replace @@VERSION@@ with %%version -%writevars -f pyproject.toml version +%writevars -f setup.py version %generate_buildrequires diff --git a/setup.py-remove-usage-of-unpackaged-calver.patch b/setup.py-remove-usage-of-unpackaged-calver.patch new file mode 100644 index 0000000..5e19229 --- /dev/null +++ b/setup.py-remove-usage-of-unpackaged-calver.patch @@ -0,0 +1,36 @@ +From 96197a07e974275f75f7814169f9213e4cca0b7d Mon Sep 17 00:00:00 2001 +From: Maxwell G +Date: Thu, 27 Jul 2023 16:12:03 +0000 +Subject: [PATCH] setup.py: remove usage of unpackaged `calver` + +--- + pyproject.toml | 2 +- + setup.py | 3 +-- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 05374a2..1e0fdcc 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,5 +1,5 @@ + [build-system] +-requires = ["setuptools", "calver"] ++requires = ["setuptools"] + build-backend = "setuptools.build_meta" + + [tool.mypy] +diff --git a/setup.py b/setup.py +index 826eac7..1e5f12e 100644 +--- a/setup.py ++++ b/setup.py +@@ -28,6 +28,5 @@ setup( + package_dir={"": "src"}, + packages=find_packages(where="src"), + package_data={"": ["py.typed"]}, +- use_calver=True, +- setup_requires=["calver"], ++ version="@@VERSION@@", + ) +-- +2.41.0 +