scrapy / protego

A pure-Python robots.txt parser with support for modern conventions.
BSD 3-Clause "New" or "Revised" License
54 stars 28 forks source link

Prepare for wheel distributions #10

Closed akx closed 4 years ago

akx commented 4 years ago

Hey there,

While setting up a Scrapy-based project, I noticed the source tarball for Protego on PyPI is 3.2 megabytes, due to including all of the test case robots.txt files too. This is, based on the MANIFEST.in file, on purpose: https://github.com/scrapy/protego/blob/26a5b11e1b9e949bbdc5ae8e5bdf68a939058df7/MANIFEST.in#L7 Some distros (e.g. Debian) do like their upstream source tarballs to include test material, so that's fine.

Those test files don't get included in wheel packages though, bringing the package size to a more reasonable 8 kilobytes. Pip will generally prefer wheels over source distributions so this is an easy way to bring the download size down for everyone.

~/b/protego (prepare-wheel) $ python setup.py sdist bdist_wheel
# ...
~/b/protego (prepare-wheel) $ ls -l dist
total 8256
-rw-r--r--  1 akx  staff     8220 Jan  2 15:53 Protego-0.1.16-py2.py3-none-any.whl
-rw-r--r--  1 akx  staff  3201309 Jan  2 15:56 Protego-0.1.16.tar.gz

This PR adds the required universal = 1 configuration to setup.cfg so the wheel is marked compatible with both Python 2 and Python 3.

However, I'm not sure what the release process here entails; I see some deployment bits in the Travis configuration file, but I don't know what to add there to have the CI pipeline run python setup.py bdist_wheel.

Gallaecio commented 4 years ago

I don't know what to add [to the Travis CI configuration file] to have the CI pipeline run python setup.py bdist_wheel.

https://docs.travis-ci.com/user/deployment-v2/providers/pypi/#uploading-different-distributions

akx commented 4 years ago

@Gallaecio Any chance of merging this?

Gallaecio commented 4 years ago

Policy is to get 2 maintainers to approve. I’ll ping them.

whalebot-helmsman commented 4 years ago

To be sure you need to add wheel package in https://github.com/akx/protego/blob/8b99ed4b910f93842835694e87bb77da18522db5/.travis.yml#L40

akx commented 4 years ago

To be sure you need to add wheel package in https://github.com/akx/protego/blob/8b99ed4b910f93842835694e87bb77da18522db5/.travis.yml#L40

@whalebot-helmsman Done :)