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

packaging question #2038

Closed
gene-git opened this issue Dec 13, 2022 · 8 comments · Fixed by #2042
Closed

packaging question #2038

gene-git opened this issue Dec 13, 2022 · 8 comments · Fixed by #2042

Comments

@gene-git
Copy link

Building a wheel via : python -m build -w
2 files seem to be in wrong directory:
unzip -l dist/*.whl

Archive: dist/isort-5.11.2-py3-none-any.whl
Length Date Time Name


35069  1980-01-01 00:00   CHANGELOG.md
 1089  1980-01-01 00:00   LICENSE
  871  1980-01-01 00:00   isort/__init__.py

...

When this wheel is installed the 2 errant files land in /usr/lib/python3.10/site-packages
where they don't belong.

@staticdev
Copy link
Collaborator

Actually these files are added on purpose, you can see on include of pyproject.toml. Also we are using poetry to package, not build module.

@gene-git
Copy link
Author

gene-git commented Dec 14, 2022

poetry build --format wheel produces same problem. Yes I was aware that they were added on purpose - but its still bad in my view, intentional or not.

When these get installed by distro package, unless action is taken to delete, they will land in

/usr/lib/python3.10/site-packages

where they obviously don't belong - right? Or maybe i'm missing something.

They should be in their own isort sub-directory. The site-packages directory is meant for all packages not files like these belonging to isort.

Might I suggest you simply move them down 1 level to:

/usr/lib/python3.10/site-packages/isort/xxx

In meantime, distro packages should probably delete or move them somewhere more appropriate.

thanks

@staticdev
Copy link
Collaborator

@gene-git a-ha, I see now. Not sure how to change this behavior though. There is probably an issue reported on poetry then. Do you know?

@gene-git
Copy link
Author

gene-git commented Dec 15, 2022

There is a simple solution after all:
This works:

mkdir isort/Docs
mv LICENSE CHANGELOG.md isort/Docs

or just:
mv LICENSE CHANGELOG.md isort/

Only need to remove from include section in pyporject.toml.

@staticdev
Copy link
Collaborator

@gene-git interesting, I can try. I did not find a reference to that. Do you have a link to share?

@gene-git
Copy link
Author

your pyproject.toml has
packages = [
{ include = "isort" },
]
so isort and everything under isort will be in package as per poetry doc.

This is documented : https://python-poetry.org/docs/pyproject/ in Packages section.

@gene-git
Copy link
Author

Thanks for working on this -but it seems still broken to me - unless I'm missing something.

git rev-parse HEAD
4641ed8
poetry build --format wheel

unzip -l dist/isort-5.11.2-py3-none-any.whl | head -10
Archive: dist/isort-5.11.2-py3-none-any.whl
Length Date Time Name


35069  1980-01-01 00:00   CHANGELOG.md
 1089  1980-01-01 00:00   LICENSE
  871  1980-01-01 00:00   isort/__init__.py
   36  1980-01-01 00:00   isort/__main__.py
  310  1980-01-01 00:00   isort/_future/__init__.py
44114  1980-01-01 00:00   isort/_future/_dataclasses.py
 1072  1980-01-01 00:00   isort/_vendored/tomli/LICENSE

@staticdev
Copy link
Collaborator

@gene-git sorry, my fault.. I hope it is now fixed on 5.11.4 =)

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

Successfully merging a pull request may close this issue.

2 participants