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

Data directories not included in wheel #443

Closed
octane64 opened this issue Aug 30, 2021 · 3 comments
Closed

Data directories not included in wheel #443

octane64 opened this issue Aug 30, 2021 · 3 comments

Comments

@octane64
Copy link

When creating a build for a simple project layout like the following:

project_name

  • project_name/
    ---init.py
    --- main.py
    --- module1.py
  • data/
    --- database.db
    --- samplefile.csv
  • README.md
  • pyproject.toml

Source dist will include data directory alongside project_name dir but wheel will only include project_name dir

@bpabel
Copy link
Contributor

bpabel commented Aug 31, 2021

You have to include data inside your package directory (project_name/data). pip purposefully makes it difficult to install anything outside the package install directory for security reasons.

@octane64
Copy link
Author

octane64 commented Sep 1, 2021

But data is indeed inside the package directory (outer project_name dir).
You mean data should be inside the inner project_name dir?

@takluyver
Copy link
Member

Yup, you need it in the inner directory alongside __init__.py - this is the importable module that will get installed. We don't want to install random .../site-packages/data directories.

Other Python packaging tools provide a way to install files to other locations - setuptools calls this data_files. It's not currently supported in Flit, because I think the situations where you actually need it are limited, and Flit is focused on the simple cases. See #358 for discussion over whether that should be added.

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

3 participants