Bug 2180486 - python-pyvirtualize fails to build with Sphinx 6.1.3
Summary: python-pyvirtualize fails to build with Sphinx 6.1.3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pyvirtualize
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Raphael Groner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2135122
TreeView+ depends on / blocked
 
Reported: 2023-03-21 14:51 UTC by Karolina Surma
Modified: 2023-04-15 02:06 UTC (History)
2 users (show)

Fixed In Version: python-pyvirtualize-0.10-13.20191018gitdc2d971.fc37 python-pyvirtualize-0.10-13.20191018gitdc2d971.fc38
Clone Of:
Environment:
Last Closed: 2023-04-13 01:53:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-03-21 14:51:10 UTC
python-pyvirtualize fails to build with Sphinx 6.1.3 in Fedora 39 (currently Rawhide).

For the logs from testing build attempts, see:
https://copr.fedorainfracloud.org/coprs/ksurma/sphinx-6.1.3/package/python-pyvirtualize/

You can test you package in mock running:

$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/sphinx-6.1.3/fedora-rawhide-x86_64/ --no-clean your.src.rpm
$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/sphinx-6.1.3/fedora-rawhide-x86_64/ shell

The issue detected:

Package attempts to modify `_static/jquery.js` which was removed from Sphinx 6+ and moved to a separate sphinxcontrib package: jquery.

If that file isn't needed in the documentation package, remove the lines attempting to access it from the spec file.
Otherwise, the extension (packaged in Fedora as `python-sphinxcontrib-jquery`) could be used here.

Sphinx 6.1.3 will be included in Fedora 39.
Let us know here if you have any questions. Thank you!

Comment 1 Raphael Groner 2023-04-04 06:39:34 UTC
> Package attempts to modify `_static/jquery.js` which was removed from Sphinx 6+ and moved to a separate sphinxcontrib package: jquery.

> If that file isn't needed in the documentation package …

How can I see if that file is used?

Comment 2 Karolina Surma 2023-04-04 08:57:40 UTC
I think upstream is the most qualified in the matter.

I tried to look further into the documentation, so I installed python-pyvirtualize-docs to my Fedora 37 (built with Sphinx 5.3). The docs are empty. I think the autodoc extension needs to import the classes to generate the documentation, but it fails, because it can't import `pyVim` and later `yaml` (there are several build attempts in the copr you can check: https://copr.fedorainfracloud.org/coprs/ksurma/sphinx-6.1.3/package/python-pyvirtualize/) Those are runtime dependencies that need to be added to the BuildRequires to achieve the proper imports. But even afterwards there are plenty of warnings and errors that prevent the docs from generating the contents.
The first error is: 
"WARNING: autodoc: failed to import module 'pyVirtualize'; the following exception was raised:                      
No module named 'pyvSphere'"

That looked weird, so I installed python3-pyvirtualize (also to my Fedora 37) and tried to import the class in the interactive Python prompt. The first attempt fails, the second is successful. I don't understand why that's happening. To make sure, I installed the package from PyPI to a venv with Python 3.10 and 3.11 and ran the same commands to the same surprising result. 

>>> from pyVirtualize.pyvSphere import vSphere
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.11/site-packages/pyVirtualize/__init__.py", line 21, in <module>
    from pyvSphere import vSphere
ModuleNotFoundError: No module named 'pyvSphere'
>>> from pyVirtualize.pyvSphere import vSphere
>>> 

---

Given that the docs are broken for some time, it seems like no one needs them or cares enough to file a ticket. My suggestion would be to drop them altogether from the package.
The actual import issue looks worse. I'd suggest filing an issue upstream.

Comment 3 Raphael Groner 2023-04-04 09:42:10 UTC
Maybe dependency generation is generally b0rken. In case of pip as preferred in upstream documentation, please try to get file requirements.txt from upstream and provide output of command.

$ pip install -r requirements.txt

Comment 4 Raphael Groner 2023-04-04 09:47:20 UTC
Please try to build in Fedora 38, too. By the way, Fedora 39 has change request to use RPM 4.19 as new feature.

Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: python(abi) = 3.11 python3.11dist(alabaster) >= 0.7.10 python3.11dist(appdirs) >= 1.4.3 python3.11dist(babel) >= 2.4 python3.11dist(colorama) >= 0.3.9 python3.11dist(docutils) >= 0.13.1 python3.11dist(imagesize) >= 0.7.1 python3.11dist(jinja2) >= 2.9.6

Comment 5 Karolina Surma 2023-04-04 11:38:55 UTC
The runtime dependencies are generated correctly, but when they are - after the RPM build - it's already too late. They're also needed in the environment during the build time. I don't see the automatic generator of the build time dependencies enabled in the spec file. They all seem to be declared manually (https://src.fedoraproject.org/rpms/python-pyvirtualize/blob/rawhide/f/python-pyvirtualize.spec#_44) and they miss both `python3-pyvmomi` and `python3-pyyaml`. This should be added to the specfile if you still want to build the documentation package.
Then there's the other issue with the non-working import, which I can't help with. I think the upstream will know better how to proceed.

Comment 6 Raphael Groner 2023-04-04 14:01:18 UTC
Ah, there's a SHOULD in python dependency guidelines. Propably I've failed to understand and default might change from release to release due to I'm quite sure it worked with initial rawhide (expect something EOL before F35).

https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#Automatically-generated-dependencies

What defaults could we use as assumption?

Comment 7 Fedora Update System 2023-04-04 19:58:32 UTC
FEDORA-2023-e545d10672 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-e545d10672

Comment 8 Fedora Update System 2023-04-04 19:58:43 UTC
FEDORA-2023-42e6850942 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-42e6850942

Comment 9 Fedora Update System 2023-04-05 02:39:54 UTC
FEDORA-2023-42e6850942 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-42e6850942`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-42e6850942

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2023-04-05 03:00:12 UTC
FEDORA-2023-e545d10672 has been pushed to the Fedora 38 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-e545d10672

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Karolina Surma 2023-04-05 06:29:02 UTC
Thank you for fixing the package.
The build of the docs with Sphinx 6.1.3 will still fail because of the line: 
	
rm -v docs/build/html/_static/jquery*.js

https://src.fedoraproject.org/rpms/python-pyvirtualize/blob/rawhide/f/python-pyvirtualize.spec#_98

There's no jquery in the Sphinx 6, so this line should be removed.

Comment 12 Raphael Groner 2023-04-05 06:46:44 UTC
Rawhide is still based on f38 that I can support for now. Please feel free to submit patch or pull request for f39+.

Comment 13 Raphael Groner 2023-04-11 20:30:59 UTC
(In reply to Karolina Surma from comment #11)
 
> There's no jquery in the Sphinx 6, so this line should be removed.

There's a build conditional for obsolete dependency. Why is rm so strict?

Comment 14 Raphael Groner 2023-04-11 20:39:46 UTC
[rawhide 9442c6a] skip jquery with sphinx 6

Comment 15 Fedora Update System 2023-04-13 01:53:31 UTC
FEDORA-2023-42e6850942 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2023-04-15 02:06:28 UTC
FEDORA-2023-e545d10672 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.