-
Notifications
You must be signed in to change notification settings - Fork 19
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
Make pycln run with Python 3.12 (#221) #224
Conversation
Any chance this could be merged any time soon @hadialqattan ? |
Sure bro but please give me some time as im reaaaally busy these days 🙏🏻. Thank you all for the support ❤️. |
pycln/utils/refactor.py
Outdated
if sys.version_info >= (3, 12): | ||
from pathlib import Path | ||
_flavour = os.path | ||
else: | ||
from pathlib import Path, _posix_flavour, _windows_flavour # type: ignore | ||
_flavour = _windows_flavour if ISWIN else _posix_flavour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the if
should be reversed. Versions prior to 3.12 are an exception, not the other way around.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #224 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 28 28
Lines 2895 2902 +7
=========================================
+ Hits 2895 2902 +7
|
…ior is exceptional case Co-authored-by: Johan Alpne <johan.alpne@funnel.io>
Code Climate has analyzed commit a8f88f3 and detected 0 issues on this pull request. View more on Code Climate. |
@perfa thanks for the awesome work! Also thanks to @GriceTurrble for his contribution. + I'm really sorry for the delay. |
@GriceTurrble @johanneswilm @perfa |
Tested locally after a Thank you @hadialqattan ! |
Changes were made to pathlib with the release of 3.12 the details of which can be read here. Updated the code to reflect that you no longer need to directly refer to _posix_flaour nor _windows_flavour when inheriting from Path. The
__init__
function of Path does take args now. Finally, references todisututils
were changed toasyncio
(available from 3.4) as thedistutils
module has been removed in Python 3.12 breaking some tests.Tests pass and pycln successfully run on local codebase with Python 3.12.0 and 3.10.13.
Fixes: #223, #221, #219