From be5d07745f58f489da6fbbfa36e71b7e7d440927 Mon Sep 17 00:00:00 2001 From: Rolf Krahl Date: Thu, 4 Dec 2025 12:40:10 +0100 Subject: [PATCH 1/2] Review GitHub workflow publish release to PyPI: - PyPI is now enforcing PEP 625 distribution file names on upload - Revert 59db00b: Remove disabling metadata check --- .github/workflows/publish-to-pypi.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yaml b/.github/workflows/publish-to-pypi.yaml index 22140c0..60296f0 100644 --- a/.github/workflows/publish-to-pypi.yaml +++ b/.github/workflows/publish-to-pypi.yaml @@ -12,6 +12,7 @@ jobs: id-token: write env: SDIST: python-icat-${{ github.event.release.tag_name }}.tar.gz + PYPI_SDIST: python_icat-${{ github.event.release.tag_name }}.tar.gz steps: - name: Fetch assets uses: cb80/dlassets@latest @@ -24,9 +25,8 @@ jobs: - name: Copy distfile to dist directory run: | mkdir -p dist - cp -p assets/$SDIST dist + cp -p assets/$SDIST dist/$PYPI_SDIST - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: verbose: true - verify-metadata: false From 03c0509be42ebb1da992430ebe96a2162fcadf48 Mon Sep 17 00:00:00 2001 From: Rolf Krahl Date: Thu, 4 Dec 2025 12:55:16 +0100 Subject: [PATCH 2/2] Review spec file --- python-icat.spec | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/python-icat.spec b/python-icat.spec index d0a39b8..f35dc90 100644 --- a/python-icat.spec +++ b/python-icat.spec @@ -1,11 +1,13 @@ -%if 0%{?sle_version} >= 150500 +%if 0%{?suse_version} >= 1600 +%global pyversfx 313 +%global pythons python313 +%else +%if 0%{?sle_version} >= 150500 && 0%{?is_opensuse} %global pyversfx 311 -%global python %__python311 -%global python_sitelib %python311_sitelib +%global __python3 %__python311 %else %global pyversfx 3 -%global python %__python3 -%global python_sitelib %python3_sitelib +%endif %endif Name: python-icat @@ -17,7 +19,9 @@ License: Apache-2.0 Group: Development/Libraries/Python Source: https://github.com/icatproject/python-icat/releases/download/%{version}/python-icat-%{version}.tar.gz BuildRequires: python%{pyversfx}-base >= 3.4 +BuildRequires: python%{pyversfx}-pip BuildRequires: python%{pyversfx}-setuptools +BuildRequires: python%{pyversfx}-wheel BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch @@ -63,15 +67,15 @@ $long_description %prep -%setup -q -n %{name}-%{version} +%setup -q %build -%{python} setup.py build +%pyproject_wheel %install -%{python} setup.py install --optimize=1 --prefix=%{_prefix} --root=%{buildroot} +%pyproject_install for f in `ls %{buildroot}%{_bindir}` do mv %{buildroot}%{_bindir}/$$f %{buildroot}%{_bindir}/$${f%%.py} @@ -83,7 +87,7 @@ done %__install -d -m 755 %{buildroot}%{_docdir}/%{name} %__cp -pr README.rst CHANGES.rst doc/* %{buildroot}%{_docdir}/%{name} %__chmod -f a-x %{buildroot}%{_docdir}/%{name}/examples/*.py -%fdupes %{buildroot}%{python_sitelib} +%fdupes %{buildroot}%{python3_sitelib} %files @@ -107,7 +111,7 @@ done %files -n python%{pyversfx}-icat %defattr(-,root,root) -%{python_sitelib}/* +%{python3_sitelib}/* %{_bindir}/*