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

Doc/license files installed directly in site-packages #33

Open
musicinmybrain opened this issue Jan 14, 2022 · 3 comments
Open

Doc/license files installed directly in site-packages #33

musicinmybrain opened this issue Jan 14, 2022 · 3 comments

Comments

@musicinmybrain
Copy link

The asyncmy package installs its CHANGELOG.md, LICENSE, and README.md directly into site-packages.

$ python3 -m venv _e
$ . _e/bin/activate
(_e) $ pip install asyncmy
(_e) $ ls -l _e/lib64/python3.10/site-packages/
total 28
drwxrwxr-x. 1 ben ben  1052 Jan 14 16:44 asyncmy
drwxrwxr-x. 1 ben ben    88 Jan 14 16:44 asyncmy-0.2.3.dist-info
-rw-rw-r--. 1 ben ben   851 Jan 14 16:44 CHANGELOG.md
drwxrwxr-x. 1 ben ben    66 Jan 14 16:43 _distutils_hack
-rw-rw-r--. 1 ben ben   152 Jan 14 16:43 distutils-precedence.pth
-rw-rw-r--. 1 ben ben 11357 Jan 14 16:44 LICENSE
drwxrwxr-x. 1 ben ben   114 Jan 14 16:43 pip
drwxrwxr-x. 1 ben ben   154 Jan 14 16:43 pip-21.2.3.dist-info
drwxrwxr-x. 1 ben ben    80 Jan 14 16:43 pkg_resources
-rw-rw-r--. 1 ben ben  4930 Jan 14 16:44 README.md
drwxrwxr-x. 1 ben ben   714 Jan 14 16:43 setuptools
drwxrwxr-x. 1 ben ben   146 Jan 14 16:43 setuptools-57.4.0.dist-info
@long2ice
Copy link
Owner

What's the trouble?

@musicinmybrain
Copy link
Author

The top-level site-packages directory isn’t specific to asyncmy, so it’s a confusing place to install documentation, and there will be conflicts with other packages that do the same thing (usually by accident).

This is relatively harmless when pip-installing into a virtualenv, as any packages that do this will just keep overwriting each other’s files. Still, files that are distribu ted and then overwritten aren’t doing any good. For Linux distribution packaging, it’s necessary for the packager to work around this behavior to avoid conflicts in the system site-packages.

For these reasons, normally it would make sense to let Poetry automatically include the LICENSE file in the .dist-info, and let the other files be sdist only. That would look like:

include = [
    { path = "CHANGELOG.md", format = "sdist" },
    { path = "README.md", format = "sdist" },
]

You certainly don’t have to change it if you don’t want to, though.

musicinmybrain added a commit to musicinmybrain/asyncmy that referenced this issue Jan 31, 2023
Fixes long2ice#33 by making *.md sdist-only, and letting poetry automatically
install LICENSE in the dist-info.
@musicinmybrain
Copy link
Author

Would you consider a PR for this?

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

2 participants