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

Static file and templates incorrectly packaged in wheel/sdist #34

Closed
sneakers-the-rat opened this issue Jan 11, 2024 · 0 comments
Closed
Labels
bug Something isn't working packaging

Comments

@sneakers-the-rat
Copy link
Owner

sneakers-the-rat commented Jan 11, 2024

We are using a very normal src layout at the moment:

paper-feeds
|- src
|  |- paper_feeds
|  |- static
|  |- templates

The problem is that poetry doesn't want to handle files that are outside of the python directory:

and apparently PyPA now recommends that we put those inside the package folder itself, sort of defeating the purpose of a src directory structure imo: https://setuptools.pypa.io/en/latest/userguide/datafiles.html#non-package-data-files

The current use of include here:

include = [
"src/static/*",
"src/templates/*"
]

results in a directory structure like this when the wheel is installed from eg. pypi

| site-packages
  |- static
  |- templates
  |- paper_feeds
  |- ... all the other packages

which is just mind boggling behavior. The change in directory nesting depth and structure causes the program to not be able to find those directories - and we definitely don't want them to just be littering the site-packages directory and potentially conflicting with other packages anyway.

To fix, we just need to put the static and templates directories within the python package, should be pretty straightforward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working packaging
Projects
None yet
Development

No branches or pull requests

1 participant