Skip to content
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

Required packages for documentation build only listed in nox [docs] session #30

Open
mchaaler opened this issue Mar 4, 2022 · 3 comments

Comments

@mchaaler
Copy link
Contributor

mchaaler commented Mar 4, 2022

Move (or duplicate?) list of packages needed to build mkdocs-gallery documentation from noxfile.py (MKDOCS_GALLERY_EXAMPLES_REQS list) to setup.cfg as optional dependencies?

Refer to https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies.

For example:

[options.extras_require]
docs =
    matplotlib,
    seaborn,
    statsmodels,
    plotly,
    # memory_profiler,
    pillow  # PIL, required for image rescaling

Thus, the following command can be used to install these dependencies in the current Python virtual env:
pip install -e .[docs]

This can be useful for debugging puposes, when one needs to run mkdocs build without using nox.

@smarie
Copy link
Owner

smarie commented Mar 8, 2022

I am not against it, but I am not sure that my nox_utils tool would know which ones to install with conda and which ones to install with pip...

An alternative is to provide requirements files in a folder named requirements:

  • requirements_doc.txt and requirements_doc_conda.txt
  • requirements_tests.txt and requirements_doc_conda.txt
  • etc.

Users not wishing to use conda can install all requirements files with pip.
Would that be something ok for you ?

Note that personally I use PyCharm, and I simply tell PyCharm to use the python.exe created by nox in the .nox/doc/ folder. So I debug using the exact same session that nox uses.

@smarie
Copy link
Owner

smarie commented Mar 8, 2022

Note: there is already a flake8_requirements.txt in ci_tools/ and a nox_requirements.txt at the root (this one should remain at the root)

@mchaaler
Copy link
Contributor Author

No problem, I was just asking. I find the possibility to install extra dependencies by specifying a [keyword] to pip install rather elegant and was wondering if it was something that could be applied to mkdocs-gallery.

I am not against it, but I am not sure that my nox_utils tool would know which ones to install with conda and which ones to install with pip...

Why do you need some packages to be installed by conda, and the others by pip? Why not everything through pip? I usually consider that 'if it works with pip, it should work with conda as well'...

Note that personally I use PyCharm, and I simply tell PyCharm to use the python.exe created by nox in the .nox/doc/ folder. So I debug using the exact same session that nox uses.

Understood. That's clever and might be useful sometimes.

It's just that I like to be able to do everything in the conda virtual environment I create when I start a project (no need to switch between environments in PyCharm, whether I want to build the docs, run the tests or check the CLI).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants