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

reduce pypi package file size #629

Closed
wtayyeb opened this issue Nov 7, 2018 · 7 comments
Closed

reduce pypi package file size #629

wtayyeb opened this issue Nov 7, 2018 · 7 comments

Comments

@wtayyeb
Copy link
Contributor

wtayyeb commented Nov 7, 2018

Hi, thank you for your great django-table2 package. it helps us very much.

I recently re-install my environment and noticed django-tables2 pypi package size is even bigger than django itself!

image

image

digging more about that, I found that you only distribute source code to pypi. But if you bdist_wheel it, it will reduce to ~90Kb.

image

However if you don't like wheels (why?) you could exclude /docs/_build/ directory form source distributed version of your package, or at least remove those huge web fonts from there. I don't think anyone install your package via pip to read documents, when you offer docs in readthedocs.

thanks.

@jieter
Copy link
Owner

jieter commented Nov 7, 2018

Yes, I noticed the size too, but never took the time to look into it. Excluding docs from the package sounds good to me, PR welcome!

@wtayyeb
Copy link
Contributor Author

wtayyeb commented Nov 8, 2018

why not publish it as wheel?

There is nothing to change in code repository to publish this package as wheel

It's too easy as executing following command:

python setup.py bdist_wheel --universal upload

or more control on upload via twine:

pip install twine

python setup.py bdist_wheel --universal
twine upload dist/django_tables2-xxx.whl

NOTE:

  1. --universal is to generate py2/py3 compatible wheels
  2. If error occur that say wheel is not exist or bdist_wheel is unknown, maybe you need to
    python -m pip install --upgrade pip wheel

@wtayyeb
Copy link
Contributor Author

wtayyeb commented Nov 8, 2018

also you could remove recursive-include docs * from MANIFEST.in file. and source publish it like before.

https://github.com/jieter/django-tables2/blob/master/MANIFEST.in#L4

@jieter
Copy link
Owner

jieter commented Nov 8, 2018

Because I do not fully understand the difference between a source package and a wheel, I do not want to rush changing it.
Like I said, you are welcome to open a PR removing the line from Manifest.in.

@wtayyeb
Copy link
Contributor Author

wtayyeb commented Nov 8, 2018

ok I am doing it right now. and will submit a pull request.

@wtayyeb
Copy link
Contributor Author

wtayyeb commented Nov 8, 2018

#630

@wtayyeb
Copy link
Contributor Author

wtayyeb commented Nov 8, 2018

@jieter, my PR(#630) is now ready. I have to solve some other stuff to make all travis-ci tests pass. but they dont belong to package size 😅

@jieter jieter closed this as completed Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants