#434 [F39] Namespace pyproject-rpm-macros generated text files with %{python3_pkgversion}
Merged 4 months ago by churchyard. Opened 4 months ago by churchyard.
rpms/ churchyard/pyproject-rpm-macros namespace_directories  into  f39

file modified
+7 -3
@@ -1,5 +1,9 @@ 

+ # This is a backward-compatible suffix used in all pyproject-rpm-macros directories

+ # For the main Python it's empty, for all others it's "-3.X"

+ %_pyproject_files_pkgversion %{expr:"%{python3_pkgversion}" != "3" ? "-%{python3_pkgversion}" : ""}

+ 

  # This is a directory where wheels are stored and installed from, absolute

- %_pyproject_wheeldir %{_builddir}%{?buildsubdir:/%{buildsubdir}}/pyproject-wheeldir

+ %_pyproject_wheeldir %{_builddir}%{?buildsubdir:/%{buildsubdir}}/pyproject-wheeldir%{_pyproject_files_pkgversion}

  

  # This is a directory used as TMPDIR, where pip copies sources to and builds from, relative to PWD

  # For proper debugsource packages, we create TMPDIR within PWD
@@ -8,12 +12,12 @@ 

  # This will be used in debugsource package paths (applies to extension modules only)

  # NB: pytest collects tests from here if not hidden

  #     https://docs.pytest.org/en/latest/reference.html#confval-norecursedirs

- %_pyproject_builddir %{_builddir}%{?buildsubdir:/%{buildsubdir}}/.pyproject-builddir

+ %_pyproject_builddir %{_builddir}%{?buildsubdir:/%{buildsubdir}}/.pyproject-builddir%{_pyproject_files_pkgversion}

  

  # We prefix all created files with this value to make them unique

  # Ideally, we would put them into %%{buildsubdir}, but that value changes during the spec

  # The used value is similar to the one used to define the default %%buildroot

- %_pyproject_files_prefix %{name}-%{version}-%{release}.%{_arch}

+ %_pyproject_files_prefix %{name}-%{version}-%{release}.%{_arch}%{_pyproject_files_pkgversion}

  

  %pyproject_files %{_builddir}/%{_pyproject_files_prefix}-pyproject-files

  %_pyproject_modules %{_builddir}/%{_pyproject_files_prefix}-pyproject-modules

file modified
+12 -1
@@ -13,7 +13,7 @@ 

  #   Increment Y and reset Z when new macros or features are added

  #   Increment Z when this is a bugfix or a cosmetic change

  # Dropping support for EOL Fedoras is *not* considered a breaking change

- Version:        1.11.0

+ Version:        1.12.0

  Release:        1%{?dist}

  

  # Macro files
@@ -171,6 +171,17 @@ 

  

  

  %changelog

+ * Fri Jan 26 2024 Miro Hrončok <miro@hroncok.cz> - 1.12.0-1

+ - Namespace pyproject-rpm-macros generated text files with %%{python3_pkgversion}

+ - That way, a single-spec can be used to build packages for multiple Python versions

+ - Fixes: rhbz#2209055

+ 

+ * Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-3

+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

+ 

+ * Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-2

+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

+ 

  * Wed Sep 27 2023 Miro Hrončok <mhroncok@redhat.com> - 1.11.0-1

  - Add the -l/-L flag to %%pyproject_save_files

  - The -l flag can be used to assert at least 1 License-File was detected

file modified
+3 -1
@@ -1,5 +1,7 @@ 

  #!/usr/bin/bash -eux

- . /etc/os-release

+ if [ -z "${VERSION_ID-}" ] && [ -z "${NAME-}" ]; then

+   . /etc/os-release

+ fi

  

  version=$(echo "${VERSION_ID}" | cut -d. -f1)

  arch="x86_64"

@@ -61,7 +61,10 @@ 

  

  %if %{with tests}

  %check

+ %if 0%{?fedora} < 40 && 0%{?rhel} < 10

+ # this version of httpbin is not compatible with werkzeug 3+

  %tox

+ %endif

  

  # Internal check for our macros

  # The runtime dependencies contain raven[flask], we assert we got them.

file modified
+69 -2
@@ -9,7 +9,6 @@ 

  URL:                https://github.com/timothycrosley/%{modname}

  Source0:            %{url}/archive/%{version}-2/%{modname}-%{version}-2.tar.gz

  BuildArch:          noarch

- BuildRequires:      python%{python3_pkgversion}-devel

  BuildRequires:      pyproject-rpm-macros

  

  %description
@@ -18,7 +17,7 @@ 

  with %%pyproject_save_files.

  

  This package also uses %%{python3_pkgversion} in name and has a very limited

- set of dependencies -- allows to set a different value for it in the CI.

+ set of dependencies -- allows to set a different value for it repeatedly.

  

  %package -n python%{python3_pkgversion}-%{modname}

  Summary:            %{summary}
@@ -26,6 +25,24 @@ 

  %description -n python%{python3_pkgversion}-%{modname}

  %{summary}.

  

+ %if 0%{?rhel} == 9

+ %global python3_pkgversion 3.11

+ %package -n python%{python3_pkgversion}-%{modname}

+ Summary:            %{summary}

+ 

+ %description -n python%{python3_pkgversion}-%{modname}

+ %{summary}.

+ 

+ %global python3_pkgversion 3.12

+ %package -n python%{python3_pkgversion}-%{modname}

+ Summary:            %{summary}

+ 

+ %description -n python%{python3_pkgversion}-%{modname}

+ %{summary}.

+ 

+ %global python3_pkgversion 3

+ %endif

+ 

  

  %prep

  %autosetup -n %{modname}-%{version}-2
@@ -33,13 +50,38 @@ 

  

  %generate_buildrequires

  %pyproject_buildrequires

+ %if 0%{?rhel} == 9

+ %global python3_pkgversion 3.11

+ %pyproject_buildrequires

+ %global python3_pkgversion 3.12

+ %pyproject_buildrequires

+ %global python3_pkgversion 3

+ %endif

+ 

  

  

  %build

  %pyproject_wheel

+ %if 0%{?rhel} == 9

+ %global python3_pkgversion 3.11

+ %pyproject_wheel

+ %global python3_pkgversion 3.12

+ %pyproject_wheel

+ %global python3_pkgversion 3

+ %endif

  

  

  %install

+ %if 0%{?rhel} == 9

+ %global python3_pkgversion 3.11

+ %pyproject_install

+ %pyproject_save_files -l isort

+ %global python3_pkgversion 3.12

+ %pyproject_install

+ %pyproject_save_files -l isort

+ %global python3_pkgversion 3

+ %endif

+ # we keep this one last so /usr/bin/isort is installed with python3 shebang

  %pyproject_install

  %pyproject_save_files -l isort

  
@@ -52,7 +94,32 @@ 

  # Internal check that executables are not present when +auto was not used with %%pyproject_save_files

  grep -F %{_bindir}/%{modname} %{pyproject_files} && exit 1 || true

  

+ %if 0%{?rhel} == 9

+ # Internal check that correct versions are in correct %%{pyproject_files}s

+ diff %{pyproject_files} <(grep -F python3.9/site-packages %{pyproject_files})

+ 

+ %global python3_pkgversion 3.11

+ test -d %{buildroot}%{_usr}/lib/python3.11/site-packages/%{modname}/

+ test -d %{buildroot}%{_usr}/lib/python3.11/site-packages/%{modname}-%{version}.dist-info/

+ diff %{pyproject_files} <(grep -F python3.11/site-packages %{pyproject_files})

+ 

+ %global python3_pkgversion 3.12

+ test -d %{buildroot}%{_usr}/lib/python3.12/site-packages/%{modname}/

+ test -d %{buildroot}%{_usr}/lib/python3.12/site-packages/%{modname}-%{version}.dist-info/

+ diff %{pyproject_files} <(grep -F python3.12/site-packages %{pyproject_files})

+ %global python3_pkgversion 3

+ %endif

+ 

  

  %files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files}

  %doc README.rst *.md

  %{_bindir}/%{modname}

+ %if 0%{?rhel} == 9

+ %global python3_pkgversion 3.11

+ %files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files}

+ %doc README.rst *.md

+ %global python3_pkgversion 3.12

+ %files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files}

+ %doc README.rst *.md

+ %global python3_pkgversion 3

+ %endif

file modified
+3
@@ -97,6 +97,9 @@ 

      - config-settings-test:

          dir: .

          run: ./mocktest.sh config-settings-test

+     - isort_c9s:

+         dir: .

+         run: NAME="CentOS Stream" VERSION_ID=9 ./mocktest.sh python-isort

      required_packages:

      - mock

      - rpmdevtools

no initial comment

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/06f2373dc21945da8084fb5ecf9716e4

4 new commits added

  • Namespace pyproject-rpm-macros generated text files with %{python3_pkgversion}
  • CI: Skip httpbin %tox on F40+
  • Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
  • Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
4 months ago

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/9ff688f081974c5293b67b985fd9b27d

Pull-Request has been merged by churchyard

4 months ago