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

Creating virtualenvs with PyPy always warns about a missing LICENSE file #1352

Closed
Julian opened this issue May 3, 2019 · 15 comments
Closed

Comments

@Julian
Copy link

Julian commented May 3, 2019

⊙  pypy ~/Development/virtualenv/virtualenv.py --quiet foo                                                                     jberman@USNYHJBERMANMB2
  No LICENSE.txt / LICENSE found in source

os.path.join(prefix, "LICENSE"),
looks like the problematic line, introduced in #1318.

The license() builtin in PyPy is static, and doesn't have a LICENSE to copy.

@asottile
Copy link
Contributor

asottile commented May 4, 2019

This seems specific to pypy installed via homebrew, we should be able to retrieve the LICENSE file there as well:

#1318 (comment)

@m1keil
Copy link

m1keil commented May 18, 2019

also seem to happen on my fedora 30 install.
using system python with virtualenv installed with --user.

@asottile
Copy link
Contributor

@m1keil I assume that's pypy packaged by fedora? is there a LICENSE in any of the files that get installed?

@m1keil
Copy link

m1keil commented May 18, 2019

sorry for the mix up. This actually happens with the regular system pip and python for me.

$ which virtualenv
~/.local/bin/virtualenv

$ virtualenv --version
16.6.0

$ virtualenv -p /usr/bin/python3 test
Using base prefix '/usr'
  No LICENSE.txt / LICENSE found in source
New python executable in /tmp/tmp.pVP6AhACXo/test/bin/python3
Also creating executable in /tmp/tmp.pVP6AhACXo/test/bin/python
Installing setuptools, pip, wheel...
done.

$ rpm -ql python3 | grep LICENSE
/usr/share/licenses/python3/LICENSE

$ rpm -ql python3-pip | grep LICENSE
/usr/lib/python3.7/site-packages/pip-19.0.3.dist-info/LICENSE.txt
/usr/share/licenses/python3-pip/LICENSE.txt

@gaborbernat
Copy link
Contributor

@asottile so did we fix this then?

@asottile
Copy link
Contributor

asottile commented Jun 6, 2019

We did not, I vote just deleting the warning since it seems inconsistent where packagers chose to move the README and in some cases it is completely missing

@hroncok
Copy link
Contributor

hroncok commented Jul 11, 2019

All the Pythons distributed with Fedora have this warning. We have the LICENSE file in /usr/share/licenses/python3/LICENSE - I wonder whether this needs to be fixed.

@hroncok
Copy link
Contributor

hroncok commented Jul 11, 2019

OK, we shall fix this... https://src.fedoraproject.org/rpms/python38/pull-request/33

@hroncok
Copy link
Contributor

hroncok commented Jul 11, 2019

Weirdly, even if /usr/lib64/python3.8/LICENSE.txt is present and the license() on python3.8 shows it, virtualenv still warns:

$ virtualenv -p python3.8 py38
Running virtualenv with interpreter /usr/bin/python3.8
Already using interpreter /usr/bin/python3.8
Using base prefix '/usr'
  No LICENSE.txt / LICENSE found in source
...

@asottile
Copy link
Contributor

@hroncok weird, what does this resolve to for fedora pythons?

os.path.join(prefix, os.path.relpath(lib_dir, dst_prefix), "LICENSE.txt"),

@hroncok
Copy link
Contributor

hroncok commented Jul 11, 2019

/usr/lib/python3.8/LICENSE.txt

We have lib64 (on 64bit arches).

@hroncok
Copy link
Contributor

hroncok commented Jul 12, 2019

I'll send a PR.

hroncok added a commit to hroncok/virtualenv that referenced this issue Jul 12, 2019
Several Linux distributions including Gentoo, Fedora, openSUSE
put things in lib64/pythonX.Y instead of lib/pythonX.Y on 64bit
architectures (x86_64, aarch64, etc.).

This was already respected via the fix_lib64() function, however
when virtualenv was searching for Python LICENSE, it was not.

Now is the lib64/pythonX.Y patch searched as well and unlike fix_lib64()
no checks need to be made, as the patch are tested in sequence.

See pypa#1352 (comment)
hroncok added a commit to hroncok/virtualenv that referenced this issue Jul 12, 2019
Several Linux distributions including Gentoo, Fedora, openSUSE
put things in lib64/pythonX.Y instead of lib/pythonX.Y on 64bit
architectures (x86_64, aarch64, etc.).

This was already respected via the fix_lib64() function, however
when virtualenv was searching for Python LICENSE, it was not.

Now is the lib64/pythonX.Y patch searched as well and unlike fix_lib64()
no checks need to be made, as the patch are tested in sequence.

See pypa#1352 (comment)
@hroncok
Copy link
Contributor

hroncok commented Jul 12, 2019

Here: #1382

gaborbernat pushed a commit that referenced this issue Jul 12, 2019
Several Linux distributions including Gentoo, Fedora, openSUSE
put things in lib64/pythonX.Y instead of lib/pythonX.Y on 64bit
architectures (x86_64, aarch64, etc.).

This was already respected via the fix_lib64() function, however
when virtualenv was searching for Python LICENSE, it was not.

Now is the lib64/pythonX.Y patch searched as well and unlike fix_lib64()
no checks need to be made, as the patch are tested in sequence.

See #1352 (comment)
hroncok added a commit to fedora-python/python39-spec that referenced this issue Nov 20, 2019
The license() builtin tries to read it and virtualenv tries to copy it.

See pypa/virtualenv#1352

Up until now, the license() builtin juts felt back to:

    See https://www.python.org/psf/license/

However it should output the full license text.

Virtualenv ~16.6 warns:

    No LICENSE.txt / LICENSE found in source

Technically, it is probably possible to install the package without
%license files, but that would simply resort to the previous noncritical
behavior.

This fix is not critical and hence it doesn't bump release, for easier
backporting to all our Python packages.
@gaborbernat gaborbernat added this to the 20.0.0 milestone Dec 23, 2019
@gaborbernat
Copy link
Contributor

we'll need to exam again this issue with the rewrite

@gaborbernat gaborbernat modified the milestones: 20.0.0, 20.1.0 Jan 2, 2020
@gaborbernat
Copy link
Contributor

This seems to be resolved with the rewrite.

zmanian pushed a commit to zmanian/python3-rpm that referenced this issue Mar 20, 2020
The license() builtin tries to read it and virtualenv tries to copy it.

See pypa/virtualenv#1352

Up until now, the license() builtin juts felt back to:

    See https://www.python.org/psf/license/

However it should output the full license text.

Virtualenv ~16.6 warns:

    No LICENSE.txt / LICENSE found in source

Technically, it is probably possible to install the package without
%license files, but that would simply resort to the previous noncritical
behavior.

This fix is not critical and hence it doesn't bump release, for easier
backporting to all our Python packages.
@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants