Skip to content

Amend or clarify interaction between build.tools.python and conda.environment #8595

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
astrojuanlu opened this issue Oct 18, 2021 · 6 comments · Fixed by #10672
Closed

Amend or clarify interaction between build.tools.python and conda.environment #8595

astrojuanlu opened this issue Oct 18, 2021 · 6 comments · Fixed by #10672
Assignees
Labels
Improvement Minor improvement to code Needed: design decision A core team decision is required

Comments

@astrojuanlu
Copy link
Contributor

If build.tools.python is specified with a non-conda version at the same time that conda.environment is present, the build fails. See for example:

https://readthedocs.org/projects/salishsea-nowcast/builds/14996913/

/home/docs/.asdf/installs/python/3.9.7/bin/python: can't open file '/home/docs/checkouts/readthedocs.org/user_builds/salishsea-nowcast/checkouts/latest/env': [Errno 2] No such file or directory

which corresponds to this configuration file:

version: 2

build:
  os: ubuntu-20.04
  tools:
    python: "3.9"

conda:
  environment: envs/environment-rtd.yaml

# Only build HTML and JSON formats
formats: []

We should either produce a better error message if this combination is not possible, or reconcile the two options.

(Thanks @douglatornell for the report 🙏🏽)

@astrojuanlu astrojuanlu added the Needed: design decision A core team decision is required label Oct 18, 2021
@humitos
Copy link
Member

humitos commented Oct 19, 2021

I think it makes sense to fail the build with a validation error in the config file saying something like "If conda.environment is specified, you have to use build.tools.python with mambaforge or miniconda"

@humitos humitos added the Improvement Minor improvement to code label Oct 19, 2021
@astrojuanlu
Copy link
Contributor Author

xref https://stackoverflow.com/q/69774313

@esennesh
Copy link

esennesh commented Nov 1, 2021

xref https://stackoverflow.com/q/69774313

My thanks for finding my question and documenting what's going on!

Haaroon added a commit to Pometry/Raphtory that referenced this issue May 12, 2022
use mambaforge to force readthedocs to use conda environments  issue from readthedocs/readthedocs.org#8595
Haaroon added a commit to Pometry/Raphtory that referenced this issue May 12, 2022
use mambaforge to force readthedocs to use conda environments  issue from readthedocs/readthedocs.org#8595
@DanielChaseButterfield
Copy link

I would also like this amended or clarified somewhere in the documentation. I was getting the following error, with no clear way of how to fix it:

python -mvirtualenv $READTHEDOCS_VIRTUALENV_PATH
usage: virtualenv [--version] [--with-traceback] [-v | -q] [--read-only-app-data] [--app-data APP_DATA] [--reset-app-data] [--upgrade-embed-wheels] [--discovery {builtin}] [-p py] [--try-first-with py_exe]
[--creator {builtin,cpython3-posix,venv}] [--seeder {app-data,pip}] [--no-seed] [--activators comma_sep_list] [--clear] [--no-vcs-ignore] [--system-site-packages] [--symlinks | --copies] [--no-download | --download]
[--extra-search-dir d [d ...]] [--pip version] [--setuptools version] [--wheel version] [--no-pip] [--no-setuptools] [--no-wheel] [--no-periodic-update] [--symlink-app-data] [--prompt prompt] [-h]
dest
virtualenv: error: the following arguments are required: dest
SystemExit: 2

Although the Stack overflow post exists (https://stackoverflow.com/questions/69774313/why-does-rtd-run-python-env-create-instead-of-conda-env-create-when-building), I don't know what I would have done if I didn't find it.

@benjaoming
Copy link
Contributor

This seems at the very least like a simple docs issue: I also just stumbled on it while wondering if conda needs to be listed in build.tools or not.

@benjaoming benjaoming self-assigned this Jun 8, 2023
@humitos humitos added this to the YAML File Completion milestone Jul 4, 2023
@st-bender
Copy link

st-bender commented Aug 25, 2023

Hi,
Just observed this too and had to search the issues for a fix. Please fix the docs, especially since build.image has been deprecated in favour of build.os and build.tools:
https://blog.readthedocs.com/use-build-os-config/

Edit: this is where I'd be looking for a hint:
https://docs.readthedocs.io/en/stable/config-file/v2.html#conda
Just add a sentence that build.tools.python needs to be one of the conda/mamba ones.

Thanks.

humitos added a commit that referenced this issue Aug 28, 2023
Make it clear that when using `conda` it's required to use `build.tools.python`
with Conda or Mamba.

Related #8595 (comment)
@github-project-automation github-project-automation bot moved this to Planned in 📍Roadmap Aug 28, 2023
@humitos humitos self-assigned this Aug 28, 2023
@humitos humitos moved this from Planned to Needs review in 📍Roadmap Aug 28, 2023
humitos added a commit that referenced this issue Aug 28, 2023
Make it clear that when using `conda` it's required to use `build.tools.python`
with Conda or Mamba.

Related #8595 (comment)
@github-project-automation github-project-automation bot moved this from Needs review to Done in 📍Roadmap Aug 28, 2023
fabianmurariu pushed a commit to Pometry/Raphtory that referenced this issue May 21, 2024
use mambaforge to force readthedocs to use conda environments  issue from readthedocs/readthedocs.org#8595
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code Needed: design decision A core team decision is required
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants