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

Fix license() builtin by copying license into virtualenv #1318

Merged
merged 1 commit into from
Feb 18, 2019
Merged

Fix license() builtin by copying license into virtualenv #1318

merged 1 commit into from
Feb 18, 2019

Conversation

asottile
Copy link
Contributor

@asottile asottile commented Feb 18, 2019

Resolves #1317

@asottile
Copy link
Contributor Author

hmm pypy does this differently unsurprisingly

virtualenv.py Outdated Show resolved Hide resolved
@asottile
Copy link
Contributor Author

@gaborbernat should be good to go now, I had to modify site.py to get the desired behaviour.

I wonder if in the future we should be lifting the site.py directly from the system and injecting our code into it instead of wholesale replacing site.py -- for instance, pypy's license() implementation is static and doesn't reproduce the LICENSE file (which is what I've made it do here)

@gaborbernat gaborbernat merged commit 585b225 into pypa:master Feb 18, 2019
@gaborbernat
Copy link
Contributor

Thanks!

@asottile asottile deleted the copy_license branch February 19, 2019 00:14
@Julian
Copy link

Julian commented May 3, 2019

This doesn't look correct for PyPy -- is the version that was merged the same as what @asottile you were saying about "pypy's license() implementation is static and doesn't reproduce the LICENSE file (which is what I've made it do here)"?

In the current version, a warning is always emitted on PyPy (and one even when you pass --quiet), because none of the branches find a LICENSE file on PyPy (since as you noted, license() on PyPy is just static).

@asottile
Copy link
Contributor Author

asottile commented May 4, 2019

@Julian what version of pypy are you using?

$ virtualenv venv -p pypy
Running virtualenv with interpreter /home/asottile/bin/pypy
New pypy executable in /tmp/venv/bin/pypy
Installing setuptools, pip, wheel...
done.
$ pypy --version
Python 2.7.13 (ab0b9caf307d, Apr 24 2018, 18:04:42)
[PyPy 6.0.0 with GCC 6.2.0 20160901]

@Julian
Copy link

Julian commented May 4, 2019

Ah, interesting... Not sure I have a 6.0 lying around. I'm on latest:

⊙  pypy --version
Python 2.7.13 (990cef41fe11e5d46b019a46aa956ff46ea1a234, Mar 18 2019, 17:41:49)
[PyPy 7.1.0 with GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]

@asottile
Copy link
Contributor Author

asottile commented May 4, 2019

weiiiird!

$ virtualenv venv -p pypy
Running virtualenv with interpreter /home/asottile/bin/pypy
New pypy executable in /tmp/venv/bin/pypy
Installing setuptools, pip, wheel...
done.
$ pypy --version
Python 2.7.13 (8cdda8b8cdb8, Apr 14 2019, 14:06:44)
[PyPy 7.1.1 with GCC 6.2.0 20160901]

Curious how you've installed pypy as well -- I also wonder if the macos bundle is missing files that are present in the linux ones 🤔

@Julian
Copy link

Julian commented May 4, 2019

The plot does thicken then...

Mine's from homebrew. Let's see what the one from pypy.org has.

@Julian
Copy link

Julian commented May 4, 2019

Right so if you download the macOS tarball from pypy.org, it's in the root of the tarball. For Homebrew PyPy though, it sits in /usr/local/opt/pypy/LICENSE AKA /usr/local/Cellar/pypy/7.1.0/LICENSE

@asottile
Copy link
Contributor Author

asottile commented May 4, 2019

Interesting! when I'm home (at pycon now with only a windows machine!) I'll poke at my mac mini and see if I can make this work better for pypy via homebrew -- thanks for the report 👍

@Julian
Copy link

Julian commented May 4, 2019

@asottile oh, cool. So am I -- I'm around if you want to just face-to-face meet each other :)

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.

license builtin while inside a virtualenv has odd behaviour
3 participants