Skip to content

Make targets don't use venv #2403

Closed

Description

@ericsnowcurrently

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.)

Activity

  1. AA-Turner commented on Mar 9, 2022

    @AA-Turner
    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

  2. ericsnowcurrently commented on Mar 9, 2022

    @ericsnowcurrently
    MemberAuthor

    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.

  3. changed the title [-]Make targets don't use venv.[/-] [+]Make targets don't use venv[/+] on Mar 10, 2022
  4. CAM-Gerlach commented on Mar 10, 2022

    @CAM-Gerlach
    Member

    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?

  5. hugovk commented on Mar 10, 2022

    @hugovk
    Member
  6. hugovk commented on Mar 10, 2022

    @hugovk
    Member

    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.

  7. added
    infraCore infrastructure for building and rendering PEPs
    on Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

infraCore infrastructure for building and rendering PEPs

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions