ethereum / hexbytes

Python `bytes` subclass that decodes hex, with a readable console output
MIT License
27 stars 19 forks source link

Omit venv dirs from sdist #17

Closed hugovk closed 2 years ago

hugovk commented 2 years ago

If this is a bug report, please fill in the following sections. If this is a feature request, delete and describe what you would like with examples.

What was wrong?

Code that produced the error

Download and extract the hexbytes-0.2.2.tar.gz sdist:

https://pypi.org/project/hexbytes/0.2.2/#files

And run du -sh on the directory and its contents.

Full error output

$ du -sh /tmp/downloads/hexbytes-0.2.2/
 52M    /tmp/downloads/hexbytes-0.2.2/
$ du -sh /tmp/downloads/hexbytes-0.2.2/*
4.0K    /tmp/downloads/hexbytes-0.2.2/LICENSE
4.0K    /tmp/downloads/hexbytes-0.2.2/MANIFEST.in
8.0K    /tmp/downloads/hexbytes-0.2.2/PKG-INFO
4.0K    /tmp/downloads/hexbytes-0.2.2/README.md
 12K    /tmp/downloads/hexbytes-0.2.2/hexbytes
1.0M    /tmp/downloads/hexbytes-0.2.2/hexbytes.egg-info
4.0K    /tmp/downloads/hexbytes-0.2.2/pyproject.toml
4.0K    /tmp/downloads/hexbytes-0.2.2/requirements-docs.txt
4.0K    /tmp/downloads/hexbytes-0.2.2/setup.cfg
4.0K    /tmp/downloads/hexbytes-0.2.2/setup.py
 25M    /tmp/downloads/hexbytes-0.2.2/venv
 25M    /tmp/downloads/hexbytes-0.2.2/venv-py3.8

Expected Result

 $ du -sh /tmp/downloads/hexbytes-0.2.2/
- 52M   /tmp/downloads/hexbytes-0.2.2/
+ 56K   /tmp/downloads/hexbytes-0.2.2/
 $ du -sh /tmp/downloads/hexbytes-0.2.2/*
 4.0K   /tmp/downloads/hexbytes-0.2.2/LICENSE
 4.0K   /tmp/downloads/hexbytes-0.2.2/MANIFEST.in
 8.0K   /tmp/downloads/hexbytes-0.2.2/PKG-INFO
 4.0K   /tmp/downloads/hexbytes-0.2.2/README.md
  12K   /tmp/downloads/hexbytes-0.2.2/hexbytes
-1.0M   /tmp/downloads/hexbytes-0.2.2/hexbytes.egg-info
 4.0K   /tmp/downloads/hexbytes-0.2.2/pyproject.toml
 4.0K   /tmp/downloads/hexbytes-0.2.2/requirements-docs.txt
 4.0K   /tmp/downloads/hexbytes-0.2.2/setup.cfg
 4.0K   /tmp/downloads/hexbytes-0.2.2/setup.py
- 25M   /tmp/downloads/hexbytes-0.2.2/venv
- 25M   /tmp/downloads/hexbytes-0.2.2/venv-py3.8

How can it be fixed?

Omit the venv* directories (and hexbytes.egg-info?) to reduce the contents from 52M to 56k.

They can be excluded by the MANIFEST.in.

Another suggestion is, when releasing, make a fresh clone of the repo and do it there (and document the release process, for example).

carver commented 2 years ago

Oh wow, this is a big whoops. Thanks for highlighting it!

carver commented 2 years ago

I'll wait until this gets merged into the template, then bring all the template changes in for the next release: https://github.com/ethereum/ethereum-python-project-template/pull/60

kclowes commented 2 years ago

Closed in #24. Thanks again @hugovk!