Skip to content

Building documentation fails with a Python import error #3211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ozkutuk opened this issue Sep 22, 2022 · 3 comments · Fixed by #3227
Closed

Building documentation fails with a Python import error #3211

ozkutuk opened this issue Sep 22, 2022 · 3 comments · Fixed by #3227
Labels
documentation os: nixos type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@ozkutuk
Copy link
Collaborator

ozkutuk commented Sep 22, 2022

Build of the documentation fails with the message provided in the "Actual behaviour" section. It fails regardless of the method used for building the documentation (i.e. both with nix build .#docs and with cd docs; make html).

Your environment

Which OS do you use?
NixOS

Steps to reproduce

nix build .#docs

Expected behaviour

Documentations should be building

Actual behaviour

error: builder for '/nix/store/8vfimsxaib5l3n77gap9vswgv6bhw0zx-hls-docs.drv' failed with exit code 2;
       last 10 log lines:
       > unpacking source archive /nix/store/2djd5r3qzm8ay4ygajk8rj0kf17hqmhz-source
       > source root is source
       > patching sources
       > configuring
       > no configure script, doing nothing
       > building
       > Running Sphinx v5.1.1
       >
       > Extension error:
       > Could not import extension myst_parser (exception: No module named 'myst_parser')
       For full logs, run 'nix log /nix/store/8vfimsxaib5l3n77gap9vswgv6bhw0zx-hls-docs.drv'.

Debug information

@ozkutuk ozkutuk added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Sep 22, 2022
@kokobd
Copy link
Collaborator

kokobd commented Sep 22, 2022

The error thrown by Nix probably indicates a bug in our nix files.

Meanwhile, when not using Nix, you need to use pip install -r requirements.txt to install the dependencies first. You may use something like venv to prevent the python libraries from being installed globally.

Contributions welcome!

@ozkutuk
Copy link
Collaborator Author

ozkutuk commented Sep 26, 2022

Is there a particular reason for not using the myst-parser and sphinx_rtd_theme packaged on nixpkgs? It seems like there is an issue with packages provided through poetry2nix. I have replaced those two with their nixpkgs counterparts and documentation built successfully (well, it still failed but that's unrelated to the nix issue, caused by a sphinx warning promoted to an error).

@kokobd
Copy link
Collaborator

kokobd commented Sep 26, 2022

I have replaced those two with their nixpkgs counterparts and documentation built successfully

Looks good to me ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation os: nixos type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants