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

[BUG] pyproject.toml is packaged and later installed in site-packages root #228

Open
kribesk opened this issue Jan 11, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@kribesk
Copy link

kribesk commented Jan 11, 2024

Steps to reproduce:

$ pip install pycln
...
$ cat .../lib/python3.11/site-packages/pyproject.toml | grep name
name = "pycln"

Expected behavior:

pyproject.toml should not be packaged at all! Python packages (wheels) already contain metadata.

I see you want to use package metadata in your code. Please use builtin tools designed for this task instead of hacking python and messing up users' site-packages:

from importlib.metadata import metadata

package = 'pycln'  # or pycln.__name__ to be explicit
meta = metadata(package)
name, version = meta.get('Name', package), meta.get('Version', '0.0.0')

print(f'{name} v{version}')
@kribesk kribesk added the bug Something isn't working label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant