-
Notifications
You must be signed in to change notification settings - Fork 54
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
Refactor TargetPath and add support for Python 3.12 #494
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #494 +/- ##
==========================================
+ Coverage 74.18% 74.76% +0.58%
==========================================
Files 263 269 +6
Lines 21222 22064 +842
==========================================
+ Hits 15744 16497 +753
- Misses 5478 5567 +89
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 noticed the 3.12 implementation still uses a "flavour" class insteasd of a module for TargetPath._flavour
. I guess that is the easiest solution for now given dynamic separators?
I guess we should also tag&release flow.record and bump the dependency here to have the tests work.
Yeah, unfortunately because we use dynamic separators we need some degree of a "flavour" class. I was thinking about a different approach with static pre-created flavours/PurePath classes for each combination (similar to how there's a
Yes, I'll bump the version in this PR already while we do that. |
1c136b3
to
41f134d
Compare
41f134d
to
61f718a
Compare
3cb4494
to
93d456e
Compare
This refactors TargetPath into a structure that's hopefully a little easier to maintain for future Python versions. TargetPath implementations are now split into different files, one for each Python version. Each file has specific changes needed to make it work. Each new release of Python still requires a new patch though.
I've also fixed some small filesystem and other test related bugs I ran into to get this all working.
As I'm writing this, I'm also starting to wonder at what point it might be a better idea to just... subclass
pathlib.Path
but literally override everything. I'm sure that has it's own set of challenges though.Depends on fox-it/flow.record#91