-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
README.md file in package is installed in venv outside the package subdirectory #295
Comments
@techoner @Nekotoxin |
@huonw thanks for this!
|
As an alternative, are you aware that the README contents is already included in the wheel's
This can even be accessed programmatically using from importlib.metadata import metadata
print(metadata("casbin").get_payload())
#> PyCasbin
#> ====
#>
#> [![GitHub Action](https://github.com/casbin/pycasbin/workflows/build/badge.svg?branch=master)](https://github.com/casbin/pycasbin/actions)
#> ... Why do you want to include the README file itself in the wheel? I imagine that most people would never look at the file structure and notice the README exists.
I've filed #296 and pycasbin/sqlalchemy-adapter#63 (the packages we use), but, as mentioned in the issue, other repositories are affected. |
The
README.md
file is explicitly packaged into the wheel, but is outside thecabin
directory. This means it ends up installed directly withinsite-packages/
when installed, rather than directly associated withcasbin
. An unscoped loose file like this can cause confusion and can interfere with other packages that also have a similar mistake (e.g. pex-tool/pex#1594), including other pycasbin packages like https://github.com/pycasbin/sqlalchemy-adapter.For example:
Notice that the top-level of the venv directory includes casbin's README. This means that installing casbin will add extraneous files to the venv, without an obvious source.
As mentioned, these sort of extraneous files interfere when using tools designed to give reproducible installation, because there's no way to automatically resolve the conflicts, if two packages install the same file. For this particular file, I imagine it doesn't matter if
casbin_sqlalchemy_adapter
's README overwritescasbin
's one, but it would be better to keep each package self-contained.Proposed fix: don't include the README as a data file.
I suspect the readme doesn't need to be included at all, because its contents is already contained in the wheel, via the long description, in the package metadata file (
casbin-.../METADATA
):unzip -p ~/Downloads/casbin-1.18.2-py3-none-any.whl casbin-1.18.2.dist-info/METADATA | head -30
. If required, this can even be accessed from code viaimport importlib.metadata; importlib.metadata.metadata("casbin").get_payload()
.This seems to apply to other
pycasbin
modules too: https://github.com/search?q=org%3Apycasbin%20data_files&type=codeThanks for Casbin!
The text was updated successfully, but these errors were encountered: