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

`license` builtin while inside a virtualenv has odd behaviour #1317

Closed
asottile opened this Issue Feb 18, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@asottile
Copy link
Contributor

asottile commented Feb 18, 2019

If you want to see my puzzled reaction to this I caught it on stream

The license builtin acts strangely, but only while in a virtualenv:

$ head -3 LICENSE 
Copyright (c) 2017 Anthony Sottile

Permission is hereby granted, free of charge, to any person obtaining a copy
$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> license
Type license() to see the full license text
>>> 
$ python2
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> license
Type license() to see the full license text
>>> 
$ virtualenv --version
16.4.0
$ virtualenv v
Using real prefix '/usr'
Path not in prefix '/home/asottile/opt/venv/include/python3.6m' '/usr'
New python executable in /home/asottile/workspace/pyupgrade/v/bin/python3
Also creating executable in /home/asottile/workspace/pyupgrade/v/bin/python
Installing setuptools, pip, wheel...
done.
$ ./v/bin/python
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> license
Copyright (c) 2017 Anthony Sottile

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

I suspect this needs to use real_prefix to find the appropriate license files

@gaborbernat gaborbernat added the bug label Feb 18, 2019

clrpackages pushed a commit to clearlinux-pkgs/virtualenv that referenced this issue Feb 25, 2019

virtualenv: Autospec creation for update from version 16.4.0 to versi…
…on 16.4.1

commit be34ae044174b3fc401dd8245de982c7307dc4fe
Author: Bernat Gabor <bgabor8@bloomberg.net>
Date:   Fri Feb 22 17:15:50 2019 +0300

    release 16.4.1

v16.4.1 (2019-02-22)
--------------------

Bugfixes
^^^^^^^^

- Fix ``license()`` builtin by copying the ``LICENSE`` file into the virtualenv - by ``asottile``. (`#1317 <https://github.com/pypa/virtualenv/issues/1317>`_)

Features
^^^^^^^^

- bump vendored pip to ``19.0.3`` and wheel to ``0.33.1`` (`#1321 <https://github.com/pypa/virtualenv/issues/1321>`_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.