Description of problem: I'm trying to update python-jupyter-console to the latest version. They have switched from setuptools to hatch [1]. The docs import the package, so the Fedora package sets PYTHONPATH="%{pyproject_build_lib}". This used to work with setuptools, but with hatch the docs fail to find the import. This is because %{pyproject_build_lib} returns an empty string. Version-Release number of selected component (if applicable): pyproject-srpm-macros 1.6.3-1.fc39 Steps to Reproduce: 1. Modify python-jupyter-console version to 6.6.3 (and drop the patch) 2. Build python-jupyter-console Actual results: ++ pyproject_build_lib=() ++ '[' -d build/lib.linux-x86_64-cpython-311 ']' ++ '[' -d build/lib.linux-x86_64-3.11 ']' ++ '[' -d build/lib ']' +++ find /builddir/build/BUILD/jupyter_console-6.6.3/.pyproject-builddir -type d -wholename '/builddir/build/BUILD/jupyter_console-6.6.3/.pyproject-builddir/pip-req-build-*/build/lib.linux-x86_64-3.11' +++ find /builddir/build/BUILD/jupyter_console-6.6.3/.pyproject-builddir -type d -wholename '/builddir/build/BUILD/jupyter_console-6.6.3/.pyproject-builddir/pip-req-build-*/build/lib' +++ IFS=: +++ echo '' ++ echo + /usr/bin/make -O -j4 V=1 VERBOSE=1 -C docs html PYTHONPATH= make: Entering directory '/builddir/build/BUILD/jupyter_console-6.6.3/docs' python3 autogen_config.py make: Leaving directory '/builddir/build/BUILD/jupyter_console-6.6.3/docs' Traceback (most recent call last): File "/builddir/build/BUILD/jupyter_console-6.6.3/docs/autogen_config.py", line 4, in <module> from jupyter_console.app import ZMQTerminalIPythonApp ModuleNotFoundError: No module named 'jupyter_console' make: *** [Makefile:60: config_options.rst] Error 1 Expected results: Build passes. Additional info: [1] https://github.com/jupyter/jupyter_console/compare/v6.5.1...v6.6.3#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711
Could you please open a WIP pull request for python-jupyter-console or attach a spec file to this bugzilla so it's easier for me to reproduce the problem? Have you figured out what value of PYTHONPATH is needed (a.k.a. where are the files), or not yet? (Setting FutureFeature because the macros are synced across all branches, but I recognize this as a bug.)
Here's my WIP PR to reproduce https://src.fedoraproject.org/rpms/python-jupyter-console/pull-request/7
Bad news: The files appear nowhere in the build directory. hatchling seems to simply pack them into the wheel from $PWD. Despite pyproject-rpm-macros being a general build-backend tool, it seems the %{pyproject_build_lib} value is setuptools-specific. We might want to reconsider the name of the macro as well as the location in pyproject-rpm-macros. It was added there when pip defaulted to out-of-tree builds and it needed to include .pyproject-builddir -- this is no longer the case on Fedora 37+. On Fedora 37, PYTHONPATH=$PWD/build/lib.%{python3_platform}-cpython-%{python3_version_nodots} is good enough for setuptools whether or not pyproject-rpm-macros are used. I'll start a discussion on python-devel. A solution for python-jupyter-console is to use PYTHONPATH=$PWD instead of PYTHONPATH="%{pyproject_build_lib}". I pushed it to https://src.fedoraproject.org/rpms/python-jupyter-console/pull-request/7
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/HMLOPAU3RZLXD4BOJHTIPKI3I4U6U7OE/
https://src.fedoraproject.org/rpms/pyproject-rpm-macros/pull-request/375
The macro has been deprecated in code and REDAME and it was not documented at https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/