-
-
Notifications
You must be signed in to change notification settings - Fork 530
Change preservation behaviour for PYTHONPATH (backwards compatible) #457
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
Comments
As an aside, |
#367 was what removed the ability to pass PYTHONPATH. I understand that this was supposed to fix a number of issues. To work around this, what about adding an option to the tox command line in the vein of |
Quote from 2.4.0 changelog:
This makes sense to me and I don't think we should revert this as it did not cause unforeseen issues as such. I guess we would merge a PR that would make it opt-in as suggested by @jarshwah? |
@nicoddemus - definitely. I created an issue for that: #458 |
Hmm instead of adding a new option, how about:
Seems to cover the use case presented here and also preserve the solution to the problems in #367. |
Great idea. No option clutter and this would also squash #458. |
That sounds sensible to me and like the most obvious solution.
…On Fri., 17 Feb. 2017 at 23:16, Bruno Oliveira ***@***.***> wrote:
Hmm instead of adding a new option, how about:
-
If the user's environment has $PYTHONPATH set and passenv does not
have PYTHONPATH: discard PYTHONPATH in the tox run, but warn the user
(in yellow):
*Discarding $PYTHONPATH from environment, to override specify
PYTHONPATH in 'passenv' in your environment.*
-
If user explicitly adds PYTHONPATH to passenv, it is not discarded and
no warning is produced.
Seems to cover the use case presented here and also preserve the solution
to the problems in #367 <#367>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#457 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAhBm_R-1JG5UfuEnc7AzMQ84L6hmHvBks5rdY-0gaJpZM4MBsL9>
.
|
For potential PRs: this should be explained in the docs as well ... |
I'll put together a PR in the next couple of days. |
I help to maintain https://github.com/django/django-box which is a vagrant machine setup with all of the dependencies needed to test Django. Django provides a tox file with explicit configuration to support the django-box vagrant machine. See: https://github.com/django/django/blob/3d14cbc86781ea1051af7f0c421bee3ecf2f9842/tox.ini
Various aliases are configured to run the test suite such as:
The
/home/vagrant/djangodata/
contains a bunch of python configuration files that define database connections. This directory is added toPYTHONPATH
to make the configuration files available to the--settings=
argument. Note thepassenv
in the tox configuration.This worked perfectly fine in tox 2.3.0. Unfortunately, (after much debugging), I discovered that 2.4.0 removed support for PYTHONPATH entirely, even when explicitly defined in
passenv
.Our goals:
Avoid poluting django test directory with unrelated settings files. The settings files are related to the system doing the testing, and are passed to django.
Avoid hardcoding paths in the tox file, which isn't designed to only be used with this virtual machine.
If there's a way forward to make the settings directory available to the environment without PYTHONPATH, I'm all ears.
For me though, if I've explicitly configured
PYTHONPATH
in thepassev
configuration, then please, let me pass it through. Tox shouldn't be blessing or blocking environment variables with no work arounds.I'd like to see this change reverted, but once again, I'm open to discussions on how best to fix this problem.
The text was updated successfully, but these errors were encountered: