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

Requirements parser package includes files outside the package directory. #66

Closed
jenshnielsen opened this issue Jan 25, 2022 · 3 comments · Fixed by #95
Closed

Requirements parser package includes files outside the package directory. #66

jenshnielsen opened this issue Jan 25, 2022 · 3 comments · Fixed by #95

Comments

@jenshnielsen
Copy link

See the attached example of uninstalling requirements-parser

Notice that authors.rst, license and readme.md are uninstalled from the top level dir outside the requirements package.
This is problematic since these files are very likely to collide with other projects

Found existing installation: requirements-parser 0.5.0
Uninstalling requirements-parser-0.5.0:
  Would remove:
    c:\users\jenielse\miniconda3\envs\qcodespip\lib\site-packages\authors.rst
    c:\users\jenielse\miniconda3\envs\qcodespip\lib\site-packages\license
    c:\users\jenielse\miniconda3\envs\qcodespip\lib\site-packages\readme.md
    c:\users\jenielse\miniconda3\envs\qcodespip\lib\site-packages\requirements\*
    c:\users\jenielse\miniconda3\envs\qcodespip\lib\site-packages\requirements_parser-0.5.0.dist-info\*
Proceed (Y/n)? y
  Successfully uninstalled requirements-parser-0.5.0
@FlorentJeannot
Copy link

Hi,

It looks like a limitation of poetry: python-poetry/poetry#4494

I tried the following configuration from this link chaoss/grimoirelab-toolkit#44 (comment):

include = [
    { path = "AUTHORS.rst", format = "sdist" },
    { path = "LICENSE", format = "sdist" },
    { path = "README.md", format = "sdist" },
]

It does remove the files at the source directory, but AUTHORS.rst is missing for both wheel and sdist file. LICENSE is correctly found in site-packages/requirements_parser-0.5.0.dist-info/LICENSE and README is in site-packages/requirements_parser-0.5.0.dist-info/METADATA.

It looks like it could be packaged correctly if the project was using setuptools directly with a custom configuration, instead of relying on poetry for that. https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file

@madpah Any suggestion? Could it be packaged without AUTHORS.rst as a quick fix? If so, I can open a PR for that.

@gavin09
Copy link

gavin09 commented Sep 8, 2022

I have the same issue when I try to update the Debian package[1] to 0.0.5.

E: python3-requirement-parser: unknown-file-in-python-module-directory [usr/lib/python3/dist-packages/AUTHORS.rst]
E: python3-requirement-parser: unknown-file-in-python-module-directory [usr/lib/python3/dist-packages/LICENSE]
E: python3-requirement-parser: unknown-file-in-python-module-directory [usr/lib/python3/dist-packages/README.md]
I: python3-requirement-parser: extra-license-file [usr/lib/python3/dist-packages/LICENSE]
I: python3-requirement-parser: package-contains-documentation-outside-usr-share-doc [usr/lib/python3/dist-packages/AUTHORS.rst]
I: python3-requirement-parser: package-contains-documentation-outside-usr-share-doc [usr/lib/python3/dist-packages/LICENSE]  
I: python3-requirement-parser: package-contains-documentation-outside-usr-share-doc [usr/lib/python3/dist-packages/README.md]

The solution provided by @FlorentJeannoto fixes the messages above.

[1] https://packages.debian.org/sid/python3-requirement-parser

@jkowalleck
Copy link

build backend has not proper functionality for it, yet.
a fix depends on python-poetry/poetry#8441

@madpah madpah mentioned this issue Apr 3, 2024
@madpah madpah linked a pull request Apr 3, 2024 that will close this issue
@madpah madpah closed this as completed in #95 Apr 3, 2024
madpah added a commit that referenced this issue Apr 3, 2024
feat: Drop support for Python 3.7 as part of #91

fix: Publish anciliary files only to sdist #66 via #87 (thanks to Maxwell G <[email protected]>)

fix: Type of `Requirement.specs` was incorrect #78

fix: `-e` in `requirements.txt` did not handle local paths correctly #97

chore(dev-deps): Updated all development dependencies

chore(deps): include types-setuptools as dependency

Signed-off-by: Paul Horton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants