Skip to content

docs: update faq to mention apt for dependencies #8676

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

Merged
merged 3 commits into from
Nov 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ which details your dependencies. See our guide on :ref:`guides/reproducible-buil
You can also set your project documentation to install your project itself
as a dependency.

If your project or its dependencies rely on C libraries,
see :ref:`faq:I get import errors on libraries that depend on C modules`.
Your build may depend on extensions that require additional system packages to
be installed. If you are using a :doc:`Configuration File <config-file/v2>` you
can :ref:`add libraries with apt <config-file/v2:build.apt_packages>` to the
Ubuntu-based builder .

If your project or its dependencies rely on C libraries that cannot be installed
this way, see :ref:`faq:I get import errors on libraries that depend on C modules`.


My project requires some additional settings
Expand All @@ -60,12 +65,15 @@ I get import errors on libraries that depend on C modules

Another use case for this is when you have a module with a C extension.

This happens because our build system doesn't have the dependencies for building your project.
This happens with things like ``libevent``, ``mysql``, and other Python packages that depend on C libraries.
We can't support installing random C binaries on our system, so there is another way to fix these imports.
This happens because the build system does not have the dependencies for
building your project, such as C libraries needed by some Python packages (e.g.
``libevent`` or ``mysql``). For libraries that cannot be :ref:`installed via apt
<config-file/v2:build.apt_packages>` in the builder there is another way to
successfully build the documentation despite missing dependencies.

With Sphinx you can use the built-in `autodoc_mock_imports`_ for mocking.
If such libraries are installed via ``setup.py``, you also will need to remove all the C-dependent libraries from your ``install_requires`` in the RTD environment.
With Sphinx you can use the built-in `autodoc_mock_imports`_ for mocking. If
such libraries are installed via ``setup.py``, you also will need to remove all
the C-dependent libraries from your ``install_requires`` in the RTD environment.

.. _autodoc_mock_imports: http://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_mock_imports

Expand Down Expand Up @@ -279,7 +287,7 @@ in the ``.readthedocs.yaml`` config file if it contains::
- python=3.9
- scipy
...

.. _Anaconda Project: https://anaconda-project.readthedocs.io/en/latest/


Expand Down