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

nox uses PATH to find executables #130

Closed
dhermes opened this issue Aug 30, 2018 · 7 comments · Fixed by #147
Closed

nox uses PATH to find executables #130

dhermes opened this issue Aug 30, 2018 · 7 comments · Fixed by #147

Comments

@dhermes
Copy link
Collaborator

dhermes commented Aug 30, 2018

This is a bit tox-like to suggest, so feel free to reject.

I was recently migrating my Pelican blog from a Makefile to a noxfile. I had pelican installed in a few of my base environments, but forgot to install it into the virtual environment. However, the sessions ran just fine because they referenced the pelican executable on my ${PATH} even though none existed in the virtualenv.

@theacodes
Copy link
Collaborator

hrm. This is tricky. I never was a fan of tox being onerous about stuff needing to be in the virtualenv, but I can definitely see why its useful. How can we handle this gracefully?

@dhermes
Copy link
Collaborator Author

dhermes commented Sep 7, 2018

I've been using os.path.join(session.bin, "pelican") to be explicit. I'm not sure what the right move is, you could have both options supported (i.e. one with an empty PATH and one with PATH passed down from the calling shell). Then it's up to you to decide which one should be the default.

@theacodes
Copy link
Collaborator

yeah it's tricky. We could do something like:

nox.run(..., external=True)

or flip-side:

nox.run(..., virtualenv_only=True)

We could also have a flag, such as --warn-on-external-tools / --no-warn-on-external-tools or something.

@dhermes
Copy link
Collaborator Author

dhermes commented Sep 10, 2018

ISTM that external=True (i.e. opt-in to non-virtualenv scripts) should be the default. That's just 1 vote though.

@theacodes
Copy link
Collaborator

So by default you can only use tools that are in the virtualenv, otherwise, we error?

@dhermes
Copy link
Collaborator Author

dhermes commented Sep 10, 2018

Correct.

@theacodes
Copy link
Collaborator

Hrm, what is your take @lukesneeringer?

I am in favor of this with one caveat - by default we warn but a flag could be passed to error instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants