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

Pass VIRTUAL_ENV environment variable to commands #245

Commits on Sep 1, 2019

  1. Pass VIRTUAL_ENV environment variable to commands

    Add the VIRTUAL_ENV variable to the process environment of commands
    executed in a nox session. The value of this variable contains the
    location of the virtualenv created by nox. More specifically, add the
    variable to the `env` attribute of `VirtualEnv` instances.
    
    Some commands rely on the presence of the VIRTUAL_ENV variable in their
    environment to detect that they are running in a virtualenv. In
    particular, poetry and pipenv will only install packages into the
    virtualenv if its location is passed to them via this variable. Without
    that variable, these commands will create their own virtualenv for the
    project, breaking session isolation.
    
    The VIRTUAL_ENV variable is usually set in the user's shell by the
    bin/activate scripts provided with a virtualenv. In the case of nox,
    commands run in a session are not executed within a shell. So the
    variable needs to be provided to the command by nox itself.
    cjolowicz committed Sep 1, 2019
    Configuration menu
    Copy the full SHA
    fb76749 View commit details
    Browse the repository at this point in the history