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

venv: Stop ignoring PYTHONDONTWRITEBYTECODE #745

Merged

Conversation

stephenfin
Copy link
Contributor

@stephenfin stephenfin commented Jan 16, 2018

'tox' has ignored the 'PYTHONDONTWRITEBYTECODE' environment option since 1.6.0 (commit 3a9c591f [1]). In the commit, an unknown issue with 'setuptools' was reported. However, this was incorrect: the issue at the time lay not with 'setuptools' but rather with 'virtualenv'. When using particular versions of 'virtualenv', the following message would be shown and the application would exit:

The PYTHONDONTWRITEBYTECODE environment variable is not
compatible with setuptools. Either use --distribute or unset
PYTHONDONTWRITEBYTECODE.

The offending message was added and later refined in virtualenv 1.7 (commits a1b8632b [2] and 32367828 [3]). However, this log was removed when support for 'setuptools' 0.7 and greater was added in 'virtualenv' 1.10 (commit cb01d9f9 [4]) There are no references to 'PYTHONDONTWRITEBYTECODE' in virtualenv 12.0 or any major release since then, suggesting the issue works as expected. Meanwhile, setuptools appears to have supported the 'PYTHONDONTWRITEBYTECODE' flag since 0.6.11 (commit 3a9c591f [5]).

All in all, it appears any release of 'virtualenv' or 'setuptools' made in the past 5+ years is more than happy to work with this option and there is therefore no reason for tox to treat it any differently. Stop special casing this option and allow people to use it if they so desire.

[1] 700c877
[2] pypa/virtualenv@a1b8632
[3] pypa/virtualenv@3236782
[4] pypa/virtualenv@cb01d9f
[5] pypa/setuptools@3a9c591

Signed-off-by: Stephen Finucane stephen@that.guru
Fixes: #744

'tox' has ignored the 'PYTHONDONTWRITEBYTECODE' environment option since
1.6.0 (commit 3a9c591f [1]). In the commit, an unknown issue with
'setuptools' was reported. However, this was incorrect: the issue at the
time lay not with 'setuptools' but rather with 'virtualenv'.  When using
particular versions of 'virtualenv', the following message would be
shown and the application would exit:

    The PYTHONDONTWRITEBYTECODE environment variable is not
    compatible with setuptools. Either use --distribute or unset
    PYTHONDONTWRITEBYTECODE.

The offending message was added and later refined in virtualenv 1.7
(commits a1b8632b [2] and 32367828 [3]). However, this log was removed
when support for 'setuptools' 0.7 and greater was added in 'virtualenv'
1.10 (commit cb01d9f9 [4]) There are no references to
'PYTHONDONTWRITEBYTECODE' in virtualenv 12.0 or any major release since
then, suggesting the issue works as expected. Meanwhile, setuptools
appears to have supported the 'PYTHONDONTWRITEBYTECODE' flag since
0.6.11 (commit 3a9c591f [5]).

All in all, it appears any release of 'virtualenv' or 'setuptools' made
in the past 5+ years is more than happy to work with this option and
there is therefore no reason for tox to treat it any differently. Stop
special casing this option and allow people to use it if they so desire.

[1] tox-dev@700c877
[2] pypa/virtualenv@a1b8632
[3] pypa/virtualenv@3236782
[4] pypa/virtualenv@cb01d9f
[5] pypa/setuptools@3a9c591

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: tox-dev#744
@codecov
Copy link

codecov bot commented Jan 16, 2018

Codecov Report

Merging #745 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #745      +/-   ##
==========================================
- Coverage   94.67%   94.67%   -0.01%     
==========================================
  Files          11       11              
  Lines        2384     2383       -1     
==========================================
- Hits         2257     2256       -1     
  Misses        127      127
Impacted Files Coverage Δ
tox/venv.py 96.52% <100%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b007bf4...af4fd8a. Read the comment docs.

@gaborbernat gaborbernat merged commit 336f4f6 into tox-dev:master Jan 16, 2018
@stephenfin stephenfin deleted the stop-ignoring-PYTHONDONTWRITEBYTECODE branch January 24, 2018 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants