mentalisttraceur / python-macaddress

BSD Zero Clause License
19 stars 5 forks source link

Include license file in PyPI package #1

Closed mandaryoshi closed 2 years ago

mandaryoshi commented 2 years ago

It would be great to have the license file included in the package that is downloaded from PyPI.

mentalisttraceur commented 2 years ago

Hmm, that's interesting. The wheel package already has it, which is what should normally get downloaded from PyPI. But apparently the sdist package doesn't have it.

Wheel:

I$ curl 'https://files.pythonhosted.org/packages/d6/2a/50bfcaae1c80f55f86969a8902e54b04187c73b34b491dd2728535969b04/macaddress-1.1.2-py3-none-any.whl' >/tmp/foo.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7853  100  7853    0     0  24772      0 --:--:-- --:--:-- --:--:-- 24772
I$ unzip -t /tmp/foo.zip 
Archive:  /tmp/foo.zip
    testing: macaddress.py            OK
    testing: macaddress-1.1.2.dist-info/LICENSE   OK
    testing: macaddress-1.1.2.dist-info/METADATA   OK
    testing: macaddress-1.1.2.dist-info/WHEEL   OK
    testing: macaddress-1.1.2.dist-info/top_level.txt   OK
    testing: macaddress-1.1.2.dist-info/RECORD   OK
No errors detected in compressed data of /tmp/foo.zip.
I$ unzip -x /tmp/foo.zip macaddress-1.1.2.dist-info/LICENSE 
Archive:  /tmp/foo.zip
  inflating: macaddress-1.1.2.dist-info/LICENSE
I$ cat macaddress-1.1.2.dist-info/LICENSE
Copyright 2021 Alexander Kozhevnikov <mentalisttraceur@gmail.com>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Sdist:

I$ curl 'https://files.pythonhosted.org/packages/2b/d4/ea5122be22de788d244025a0d01735d327b938c011fd1eacf5575858720c/macaddress-1.1.2.tar.gz' >/tmp/foo.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7870  100  7870    0     0  15281      0 --:--:-- --:--:-- --:--:-- 15251
I$ tar -tzf /tmp/foo.tar.gz 
macaddress-1.1.2/
macaddress-1.1.2/PKG-INFO
macaddress-1.1.2/README.rst
macaddress-1.1.2/macaddress.egg-info/
macaddress-1.1.2/macaddress.egg-info/PKG-INFO
macaddress-1.1.2/macaddress.egg-info/SOURCES.txt
macaddress-1.1.2/macaddress.egg-info/dependency_links.txt
macaddress-1.1.2/macaddress.egg-info/top_level.txt
macaddress-1.1.2/macaddress.py
macaddress-1.1.2/setup.cfg
macaddress-1.1.2/setup.py
mentalisttraceur commented 2 years ago

I'll take a look at fixing the sdist to include the LICENSE file too.

I agree that it is better for the source distribution to contain it, especially if it's included in the wheel distribution.

mentalisttraceur commented 2 years ago

By the way, I'm curious why you're downloading the sdist package instead of the wheel package? Might help me better understand and support sdist use-cases and needs, and could help motivate me to prioritize this higher.

(If you are downloading the wheel, let me know what you're trying to do with the license file and why the macaddress-*.dist-info/LICENSE included with the wheel doesn't work for you, because that would be a different problem.)

mentalisttraceur commented 2 years ago

Released 1.1.3, which includes the LICENSE file in the sdist package as well.

I$ curl 'https://files.pythonhosted.org/packages/b2/f8/84530acd5a0e5e29a18fad2619f3855961eb73af7c96ee5310ec6fec0518/macaddress-1.1.3.tar.gz' >/tmp/macaddress.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  8408  100  8408    0     0  12401      0 --:--:-- --:--:-- --:--:-- 12382
I$ tar -tzf /tmp/macaddress.tar.gz 
macaddress-1.1.3/
macaddress-1.1.3/LICENSE
macaddress-1.1.3/MANIFEST.in
macaddress-1.1.3/PKG-INFO
macaddress-1.1.3/README.rst
macaddress-1.1.3/macaddress.egg-info/
macaddress-1.1.3/macaddress.egg-info/PKG-INFO
macaddress-1.1.3/macaddress.egg-info/SOURCES.txt
macaddress-1.1.3/macaddress.egg-info/dependency_links.txt
macaddress-1.1.3/macaddress.egg-info/top_level.txt
macaddress-1.1.3/macaddress.py
macaddress-1.1.3/setup.cfg
macaddress-1.1.3/setup.py
mandaryoshi commented 2 years ago

Thank you! The reason why I was downloading the sdist package was to include it in my yocto image. I had used 'pipoe' to create a recipe for macaddress, and it had automatically used the sdist package. The goal being to calculate the checksum of the license file.