Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make targets don't use venv #2403

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
ericsnowcurrently opened this issue Mar 9, 2022 · 5 comments · Fixed by #2408
Closed

Make targets don't use venv #2403

ericsnowcurrently opened this issue Mar 9, 2022 · 5 comments · Fixed by #2408
Assignees
Labels
infra Core infrastructure for building and rendering PEPs

Comments

@ericsnowcurrently
Copy link
Member

When I run make pep0684.html, it fails because docutils & Pygments are not installed. This demonstrates several problems:

  1. Makefile makes no effort to run tools in a venv
  2. Makefile ignores the current venv if you run make with that venv activated
  3. Makefile hard-codes $(PYTHON) to /usr/bin/python3, so requirements.txt must be installed on the system Python (though usually under $HOME/.local)
  4. make venv creates a venv but it is pointless due to the above problems
  5. CI hides the problems

(2) and (3) are mostly addressed by #2402. However, (1) and (2) are not. I would expect most of the make targets to automatically create a venv with requirements.txt installed and run in that venv. (Aside: pre-config should be added to requirements.txt.)

@AA-Turner
Copy link
Member

I would expect most of the make targets to automatically create a venv with requirements.txt installed and run in that venv

I don't know what the precedent is here, but I would be wary of doing this -- the user may have a general "documentation" venv, or use an alternate package manager (conda) -- combining the two might cause problems.

I don't understand (1), perhaps as of an ignorance of how things work on Unix -- how would one specify "Python 3, but search PATH for the executable"?

A

@ericsnowcurrently
Copy link
Member Author

I don't have a clear solution for all the cases, other than the most useful thing would be venv-by-default with the option to explicitly not run in a venv. The point is rather moot due to #2402 though.

@CAM-Gerlach CAM-Gerlach changed the title Make targets don't use venv. Make targets don't use venv Mar 10, 2022
@CAM-Gerlach
Copy link
Member

CAM-Gerlach commented Mar 10, 2022

My make-fu is pretty weak as I'm mostly used to cross-platform tools like tox/nox, but it always did strike me as odd that there was a venv target, but nothing else seemed to directly use it. It seems it should be either integrated or removed.

Like @AA-Turner I'm a little confused about 3., since it just says PYTHON=python3 rather than the mentioned hardcoded path, which I assumed would pick up the active python in the current venv, conda env, etc. I'm guessing I'm missing something here?

@hugovk
Copy link
Member

hugovk commented Mar 10, 2022

For reference, the CPython docs build uses a Makefile:

cd Doc
make venv
make html

https://devguide.python.org/documenting/#building-the-documentation

It also has PYTHON=python3:

https://github.com/python/cpython/blob/8714b6fa27271035dd6dd3514e283f92d669321d/Doc/Makefile#L7

@hugovk
Copy link
Member

hugovk commented Mar 10, 2022

Please see PR #2408 to first create a venv using the Python version supplied to make, and then install and run the tools from within the venv.

@CAM-Gerlach CAM-Gerlach added the infra Core infrastructure for building and rendering PEPs label Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Core infrastructure for building and rendering PEPs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants