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

Use importlib.metadata instead of reading pyproject.toml in init #250

Merged

Conversation

or150
Copy link
Contributor

@or150 or150 commented Jan 5, 2025

Hi,
This change makes pre-commit usages work again and fixes issues #249, #228.

The root cause for the issue is poetry-core just released a version 2.0 that doesn't add the pyproject.toml file to the root of site-packages, which I guess it wasn't there on purpose.

It uses importlib.metadata instead of reading pyproject.toml, which should be compatible with both versions of poetry-core.

Thought about also changing build-system to:

[build-system]
requires = ["poetry-core>=1.0.0,<3.0.0"]

WDYT?

@or150 or150 force-pushed the bugfix/package-metadata-import branch 2 times, most recently from cc01be0 to c659866 Compare January 5, 2025 22:18
@lokhman
Copy link

lokhman commented Jan 6, 2025

@hadialqattan I think this should possibly go sooner, as many would disable pycln, since there is no clear remedy for making it work with the new version of Poetry.

@hadialqattan
Copy link
Owner

@or150 Thanks a lot for the PR, I'll finalize it and do a release (right now).

CC: @lokhman

@hadialqattan
Copy link
Owner

Sorry for being late.

@hadialqattan hadialqattan force-pushed the bugfix/package-metadata-import branch from c659866 to b9c924e Compare January 6, 2025 18:44
Copy link

codeclimate bot commented Jan 6, 2025

Code Climate has analyzed commit 298c9b4 and detected 0 issues on this pull request.

View more on Code Climate.

@hadialqattan hadialqattan merged commit 4841127 into hadialqattan:master Jan 6, 2025
15 checks passed
@hadialqattan
Copy link
Owner

@or150 @lokhman please use v2.5.0.

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 this pull request may close these issues.

3 participants