This is exposed via the failed documentation build, but the issue is in the project code itself. I'm testing Sphinx 7.1.2 in Copr, I want to include it in Rawhide (F40) soon. Reproducible: Always Steps to Reproduce: Test locally in mock: $ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/sphinx-7.1.2/fedora-rawhide-x86_64/ --no-clean your.src.rpm $ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/sphinx-7.1.2/fedora-rawhide-x86_64/ shell Actual Results: + sphinx-build -b latex doc _latex -j2 Running Sphinx v7.1.2 Configuration error: There is a programmable error in your configuration file: Traceback (most recent call last): File "/builddir/build/BUILD/hdfs-2.7.2/hdfs/config.py", line 24, in <module> from importlib import load_source ImportError: cannot import name 'load_source' from 'importlib' (/usr/lib64/python3.12/importlib/__init__.py) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.12/site-packages/sphinx/config.py", line 356, in eval_config_file exec(code, namespace) # NoQA: S102 ^^^^^^^^^^^^^^^^^^^^^ File "/builddir/build/BUILD/hdfs-2.7.2/doc/conf.py", line 64, in <module> import hdfs File "/builddir/build/BUILD/hdfs-2.7.2/hdfs/__init__.py", line 6, in <module> from .config import Config, NullHandler File "/builddir/build/BUILD/hdfs-2.7.2/hdfs/config.py", line 27, in <module> from imp import load_source ModuleNotFoundError: No module named 'imp' Expected Results: Successful build This may already be fixed upstream via: https://github.com/mtth/hdfs/pull/204
(In reply to Karolina Surma from comment #0) > This may already be fixed upstream via: https://github.com/mtth/hdfs/pull/204 I’m a little confused; that PR is already patched into the Rawhide package[1]. There should be no “from importlib import load_source” or “from imp import load_source” in the patched package sources. Is it possible that your testing is getting an old version of the python-hdfs package somehow? When I run > mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/sphinx-7.1.2/fedora-rawhide-x86_64/ --no-clean ./python-hdfs-2.7.2-2.fc40.src.rpm the build does fail, but not as described: > Running Sphinx v7.1.2 > making output directory... done > > Extension error (sphinx.config): > Handler <function correct_copyright_year at 0x7f5ffce7fe20> for event 'config-inited' threw an exception (exception: string index out of range) [1] https://src.fedoraproject.org/rpms/python-hdfs/c/1e1058b80c2f7e19f7ae4e20a01d4eaef0b01099?branch=rawhide
At a glance, it looks like the problem in my comment above is probably https://github.com/sphinx-doc/sphinx/issues/11514, which should be fixed by https://github.com/sphinx-doc/sphinx/pull/11524, which should be released in sphinx 7.2.0.
(In reply to Ben Beasley from comment #1) > (In reply to Karolina Surma from comment #0) > > This may already be fixed upstream via: https://github.com/mtth/hdfs/pull/204 > > I’m a little confused; that PR is already patched into the Rawhide > package[1]. There should be no “from importlib import load_source” or “from > imp import load_source” in the patched package sources. > > Is it possible that your testing is getting an old version of the > python-hdfs package somehow? Yes, that's what happened. I see I was building 2.7.2-1 in Copr, so that's definitely a version behind. (In reply to Ben Beasley from comment #2) > At a glance, it looks like the problem in my comment above is probably > https://github.com/sphinx-doc/sphinx/issues/11514, which should be fixed by > https://github.com/sphinx-doc/sphinx/pull/11524, which should be released in > sphinx 7.2.0. The commit https://github.com/sphinx-doc/sphinx/commit/8452300d54dce2da751941d9547dd54dc03e69bf was already included in Sphinx 7.1.2 which I'm testing against. This issue has already appeared in another of Fedora's packages. Will dig into it.
As Sphinx has changed the logic of parsing the `copyright` key in case SOURCE_DATE_EPOCH is set in the environment, it expects only the value in the form as documented: '2008, Author Name' (source: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-copyright). hdfs contains only the year: https://github.com/mtth/hdfs/blob/master/doc/conf.py#L58 In case the envvar is not set, whatever is read from `copyright`, is passed to the generated pages. The issue will never appear upstream, only downstream, in environments like the RPM build. It's an inconsistent behavior and I'm going to report it to Sphinx project. However, it may be dismissed, as the format of copyright is not as Sphinx documents (even though it doesn't validate the input).
Thanks for investigating this. I proposed a PR upstream[1] to correct the copyright string syntax. I’ll give them a few days to respond before working around it downstream. In any case, I don’t think this package needs to block your Sphinx update when it is otherwise ready to ship. The problem is well-understood, and we’ll fix it one way or another. [1] https://github.com/mtth/hdfs/pull/206
Setting NEEDINFO on myself to remind me to revisit this.
Upstream hasn’t reviewed my PR for this, but I’m going to go ahead and apply it as a downstream patch for now.
FEDORA-2023-202cce097f has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-202cce097f
FEDORA-2023-202cce097f has been pushed to the Fedora 40 stable repository. If problem still persists, please make note of it in this bug report.