← All tasks
pythonaio-libs/multidict #659Not a task: already works

Binary distributions such as wheels include C sources

envgap__aio-libs__multidict-659

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
4de9602f82051f0dae1356fc8b377c3f3573af4f
Manifest
setup.py
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

aio-libs/multidict #659 · read the original issue
## Long story short



<!-- Please describe your problem and why the fix is important. -->

Binary distributions such as wheels include C sources (`_multidict.c` and `_multilib/*.h`) that aren’t obviously useful in this type of distribution.



See also https://github.com/aio-libs/frozenlist/issues/250.



## Expected behaviour



<!-- What is the behaviour you expect? -->

These should ideally be present in the sdist but not in the bdist.



Their total size is only about 100kB, but that’s 100kB that could easily be saved. In `frozenlist`, `yarl`, and `aiohttp`, the C sources are much larger since they are Cython-generated.



## Actual behaviour



<!-- What's actually happening? -->

These files are included in both binary and source distributions.



## Steps to reproduce



<!-- Please describe steps to reproduce the issue.

     If you have a script that does that please include it here within

     markdown code markup -->

```

$ python3 -m venv _e

$ . _e/bin/activate

(_e) $ pip install multidict

(_e) $ ls -l _e/lib64/python*/site-packages/multidict/total 436

-rw-rw-r--. 1 ben ben   1190 Dec  7 23:42 _abc.py

-rw-rw-r--. 1 ben ben    363 Dec  7 23:42 _compat.py

-rw-rw-r--. 1 ben ben    942 Dec  7 23:42 __init__.py

-rw-rw-r--. 1 ben ben   4931 Dec  7 23:42 __init__.pyi

-rw-rw-r--. 1 ben ben   3791 Dec  7 23:42 _multidict_base.py

-rw-rw-r--. 1 ben ben  40881 Dec  7 23:42 _multidict.c

-rwxrwxr-x. 1 ben ben 358592 Dec  7 23:42 _multidict.cpython-310-aarch64-linux-gnu.so

-rw-rw-r--. 1 ben ben  14731 Dec  7 23:42 _multidict_py.py

drwxrwxr-x. 1 ben ben     84 Dec  7 23:42 _multilib

drwxrwxr-x. 1 ben ben    254 Dec  7 23:42 __pycache__

-rw-rw-r--. 1 ben ben     15 Dec  7 23:42 py.typed

```



## Your environment



<!-- Describe the environment you have that lead to your issue.

     This includes aiohttp version, OS, proxy server and other bits that

     are related to your case. 

     

     IMPORTANT: aiohttp is both server framework and client library.

     For getting rid of confusing please put 'server', 'client' or 'both'

     word here.

     -->

This is totally independent of platform.



## Suggested fix



Add to `setup(…)` in `setup.py`:



```

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

```



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



PR to follow.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]