#4 When setting $PYTHONPATH for docs, support both setuptools 60 and 62
Merged 2 years ago by churchyard. Opened 2 years ago by churchyard.
rpms/ churchyard/pyproj setuptools_old_and_new  into  rawhide

file modified
+9 -19
@@ -83,25 +83,15 @@ 

  

  # Need to point to the build dir so sphinx can import the module

  # before it is installed.

- # Note that %%{_arch} does not work for all architectures

- # so some if/then's are needed here, since I could not find any

- # standard macro that solves this.

- %ifarch x86_64 aarch64 ppc64le s390x

-   %global py_build_libdir lib.linux-%{_arch}-cpython-%{python3_version_nodots}

- %endif

- %ifarch i686

-   # %%{_arch} seems to expand to i386 here which does not work

-   # so make explicit what we need

-   %global py_build_libdir lib.linux-i686-cpython-%{python3_version_nodots}

- %endif

- %ifarch armv7hl

-   # %%{_arch} seems to expand to arm here which does not work

-   # so make explicit what we need

-   %global py_build_libdir lib.linux-armv7l-cpython-%{python3_version_nodots}

- %endif

- 

- PYTHONPATH=%{_builddir}/%{name}-%{version}/build/%{py_build_libdir}/ make html

- PYTHONPATH=%{_builddir}/%{name}-%{version}/build/%{py_build_libdir}/ make man

+ # Note that the new Python macros have %%{pyproject_build_lib} for this,

+ # but this package uses the old macros, so we need to replicate the behavior manually.

+ # The path has changed in setuptools 62.4.0, see https://bugzilla.redhat.com/2097115

+ %global py_build_libdir_old %{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-%{python3_version}

+ %global py_build_libdir_new %{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}

+ 

+ export PYTHONPATH=%{py_build_libdir_old}:%{py_build_libdir_new}

+ make html

+ make man

  

  # rpmlint complains many times with the rather cryptic warning:

  #     "a special character is not allowed in a name"

Also, instead of %ifarching, use %{python3_platform}.

This works. I need this to unblock the 3.11 rebuild, so I am going to play the provenpackager card. If there is something you would like me to change, I can do that later.

Pull-Request has been merged by churchyard

2 years ago

Thanks for fixing this path issue, this was a long standing nuisance that needed to be cleaned anyway.

Metadata