joh / when-changed

Execute a command when a file is changed
Other
1.21k stars 107 forks source link

No wheel file in PyPI #70

Open darkvertex opened 5 years ago

darkvertex commented 5 years ago

Hi there,

I see when-changed got released to PyPI but only as a tarball: https://pypi.org/project/when-changed/#files

Python wheels are the current standard for packaging pip packages and it will take you seconds to build one.

Could you upload a wheel (.whl) please? All you need to do is python setup.py bdist_wheel and it'll make a .whl file instead of a .tar.gz file. (If you get errors, pip install wheel and try again.)

If you upload directly from commandline then instead of python setup.py sdist upload you do python setup.py sdist bdist_wheel upload. There's not much more to it.

See, when pip installs a package if there is no wheel, it goes and builds one. This involves downloading the tarball, extracting it, generating a wheel internally, copying it to the local pip wheel cache and then deploying it from there. By serving a wheel to begin with, you save a lot of processing as it pretty much just drops in. (This may sound minor but if you're redeploying pip packages frequently, those saved seconds add up!)

You can read more about wheels in the docs: https://wheel.readthedocs.io/en/stable/user_guide.html#building-wheels

If you're confident your code runs in Python 2 and 3, then you can read more about building a "universal" wheel, which will target both. Else it will be a wheel for the main version that you build with (ie, build in Python 2 and it makes a py2 wheel, build in Python 3 and it makes a py3 wheel.)

Thank you!