Skip to content

exclude_package_data directive not processed #2269

Closed

Description

@antoniosap

i have in setup.py these sources to exclude

...
    exclude_package_data={
        'people_counter': ['people_counter.py'],
        'people_analysis': ['people_analysis_windows9_opt.py'],
        'anomaly_detect': ['frame_analyzer.py'],
        'face_predict': ['detect_face.py', 'predict.py'],
    }
)

when i check

unzip -l dist/my_package_wheel.whl

i can find inside my sources .py

...
        0  2020-07-20 10:46   people_counter/__init__.py
    16126  2020-07-16 08:59   people_counter/people_counter.py
...

Activity

  1. McSinyx commented on Jul 21, 2020

    @McSinyx
    Contributor

    Hi, IIUC, package data refer to non-Python files. I'm not aware of a way to exclude a module inside a package (there might be though, since my experience is limited), but I think you can work-around this by naming the extension of the files. It seems that they are executable, so if you're on an Unix-like OS, removing .py entirely might be a good idea too.

    A more canonical way might be to move all those executable out to a directory that you can exclude (or not include) and use absolute imports within their code.

  2. abravalheri commented on Jan 5, 2022

    @abravalheri
    Contributor

    Hi @antoniosap, the answer provided by @McSinyx explains what is happening and provides a nice workaround... I will close the issue for the time being, since the behaviour that you are facing is expected.

    I haven't experimented a lot with that, but I suppose you could also try to use a MANIFEST.in file to control which files get included in the distribution... but that is much more cumbersome that the approach suggested by @McSinyx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions