https://bugzilla.redhat.com/show_bug.cgi?id=2176933
--- Comment #4 from Jerry James loganjerry@gmail.com --- Thanks for the suggestions.
(In reply to Miro Hrončok from comment #3)
BuildRequires: %{py3_dist pygments}
This should probably come generated from upstream. The setup.py has:
install_requires=[ 'pygments >= 1.5' ],
So %pyproject_buildrequires probably already generates this (including >= 1.5).
It doesn't though. If I remove that, the build fails:
Requirement satisfied: setuptools >= 40.8 (installed: setuptools 65.5.1) Handling wheel from default build backend Requirement satisfied: wheel (installed: wheel 0.40.0) Traceback (most recent call last): File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 532, in main generate_requires( File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 439, in generate_requires generate_build_requirements(backend, requirements) File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 289, in generate_build_requirements new_reqs = get_requires() ^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires self.run_setup() File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 484, in run_setup self).run_setup(setup_script=setup_script) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup exec(code, locals()) File "<string>", line 5, in <module> File "/builddir/build/BUILD/accessible-pygments-0.0.4/a11y_pygments/utils/utils.py", line 7, in <module> from pygments.formatters import HtmlFormatter ModuleNotFoundError: No module named 'pygments'
The binary package does have a Requires generated for pygments >= 1.5, on the other hand.
This could be Summary: %{summary}
Done.
If the importable module is called a11y_pygments, consider adding %py_provides python3-a11y-pygments as well. In the spirit of https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/ #_provides_for_importable_modules
Done.
export PYTHONPATH=%{buildroot}%{python3_sitelib}
You can use %{py3_test_envvars} instead, available on Fedora 38+ https://src.fedoraproject.org/rpms/python-rpm-macros/c/ b6479253006cef572fb0cbe7ce001b3048f127b3?branch=rawhide
I can do backports if you want me to.
This package is only for F39+, so no backport needed. But using that fails:
+ PYTHONPATH=/builddir/build/BUILDROOT/python-accessible-pygments-0.0.4-1.fc39.x86_64/usr/lib64/python3.11/site-packages:/builddir/build/BUILDROOT/python-accessible-pygments-0.0.4-1.fc39.x86_64/usr/lib/python3.11/site-packages + PYTHONDONTWRITEBYTECODE=1 + PYTEST_ADDOPTS=' --ignore=/builddir/build/BUILD/accessible-pygments-0.0.4/.pyproject-builddir' + PYTEST_XDIST_AUTO_NUM_WORKERS=16 + /usr/bin/python3 test/run_tests.py Traceback (most recent call last): File "/builddir/build/BUILD/accessible-pygments-0.0.4/test/run_tests.py", line 9, in <module> from a11y_pygments.utils.utils import find_all_themes ModuleNotFoundError: No module named 'a11y_pygments'
That doesn't make any sense. The second element of PYTHONPATH is exactly what I was setting, isn't it?
Oh, I see. There are no export statements. In spite of the name of the macro, those are shell variables, not environment variables. If I simply add "export PYTHONPATH" after %py3_test_envvars, then it works.
Please always use %{python3} instead of directly invoking python3. it makes no difference in Fedora, but it makes the spec portable to e.g. RHEL alternative Python version stacks.
Done.
%license LICENSE
This is most likely redundant, but I have not yet built the package to verify.
You are correct; `rpm -qLp` lists the LICENSE file in the dist-info directory. I have removed this.
I have uploaded new versions. Due to %autorelease/%autochangelog, the URLs are the same. I wonder if I should use traditional Release numbering and changelogs while a package is going through review, then switch to %autorelease/%autochangelog before importing the package.