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

Binary distributions such as wheels include C sources #646

Closed
1 task done
musicinmybrain opened this issue Dec 8, 2021 · 0 comments · Fixed by #647
Closed
1 task done

Binary distributions such as wheels include C sources #646

musicinmybrain opened this issue Dec 8, 2021 · 0 comments · Fixed by #647
Labels

Comments

@musicinmybrain
Copy link
Contributor

musicinmybrain commented Dec 8, 2021

Describe the bug

Binary distributions such as wheels include C sources (_quoting_c.c), but these sources don’t provide value in binary distributions and their size is significant.

See also aio-libs/frozenlist#250.

To Reproduce

$ python3 -m venv _e
$ . _e/bin/activate
(_e) $ pip install yarl
(_e) $ ls -l _e/lib64/python*/site-packages/yarl/

Expected behavior

These should ideally be present in the sdist but not in the bdist, where they don’t really provide any value.

Logs/tracebacks

$ python3 -m venv _e
$ . _e/bin/activate
(_e) $ pip install yarl
(_e) $ ls -l _e/lib64/python*/site-packages/yarl/
total 1368
-rw-rw-r--. 1 ben ben    154 Dec  7 23:42 __init__.py
-rw-rw-r--. 1 ben ben   3703 Dec  7 23:42 __init__.pyi
drwxrwxr-x. 1 ben ben    190 Dec  7 23:42 __pycache__
-rw-rw-r--. 1 ben ben     13 Dec  7 23:42 py.typed
-rw-rw-r--. 1 ben ben 455467 Dec  7 23:42 _quoting_c.c
-rwxrwxr-x. 1 ben ben 861488 Dec  7 23:42 _quoting_c.cpython-310-aarch64-linux-gnu.so
-rw-rw-r--. 1 ben ben    447 Dec  7 23:42 _quoting_c.pyi
-rw-rw-r--. 1 ben ben  11498 Dec  7 23:42 _quoting_c.pyx
-rw-rw-r--. 1 ben ben    519 Dec  7 23:42 _quoting.py
-rw-rw-r--. 1 ben ben   6386 Dec  7 23:42 _quoting_py.py
-rw-rw-r--. 1 ben ben  36031 Dec  7 23:42 _url.py

Python Version

$ python --version
Python 3.10.0

multidict Version

$ python -m pip show multidict
Name: multidict
Version: 5.2.0
[…]

yarl Version

$ python -m pip show yarl
Name: yarl
Version: 1.7.2
[…]

OS

Fedora Linux 35—but this issue is platform-independent

Additional context

A suggested fix is to add to setup(…) in setup.py:

    exclude_package_data={"": ["*.c"]},

which will exclude these sources from binary distributions without affecting source distributions.

It’s possible to exclude some of the Cython files as well, but in frozenlist the preference was to keep them in the bdist for debugging purposes.

PR to follow.

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct
musicinmybrain added a commit to musicinmybrain/yarl that referenced this issue Dec 8, 2021
This does not affect source distributions, and Cython sources (.pyx) are
still installed.

Fixes aio-libs#646.
musicinmybrain added a commit to musicinmybrain/yarl that referenced this issue Dec 8, 2021
This does not affect source distributions, and Cython sources (.pyx) are
still installed.

Fixes aio-libs#646.
asvetlov pushed a commit that referenced this issue Dec 11, 2021
This does not affect source distributions, and Cython sources (.pyx) are
still installed.

Fixes #646.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant