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

Path.relative_to() walk_up support #655

Merged
merged 3 commits into from
Dec 29, 2023

Conversation

cjntaylor
Copy link
Contributor

Adding support for the walk_up keyword argument introduced in Path.relative_to() in python 3.12

docs/versionhistory.rst Outdated Show resolved Hide resolved
src/anyio/_core/_fileio.py Show resolved Hide resolved
@cjntaylor cjntaylor force-pushed the path-relative_to-walk_up branch 5 times, most recently from 14d0348 to 4c70f56 Compare December 22, 2023 19:21
@agronholm
Copy link
Owner

What's all the socket stuff, and why did you reformat .pre-commit-config.yaml?

@cjntaylor
Copy link
Contributor Author

Apologies, I realized I messed up my change to split the socket test modifications out into a separate commit. That's now fixed, so you can see just the changes that were made to that test file

@cjntaylor cjntaylor force-pushed the path-relative_to-walk_up branch 4 times, most recently from f42ac6d to 855a0c2 Compare December 23, 2023 05:45
@cjntaylor

This comment was marked as outdated.

@agronholm
Copy link
Owner

agronholm commented Dec 27, 2023

However, it did make the formatting more consistent across file and closer to "standard" YAML formatting. If you prefer, I can revert these changes - just let me know.

Could you elaborate on where this "standard" YAML formatting comes from? As far as I can tell, my formatting is consistent with the YAML 1.2 standard.

@cjntaylor

This comment was marked as resolved.

@uSpike
Copy link
Contributor

uSpike commented Dec 28, 2023

Hi, I just wanted to add that I think it'd be good to open a separate issue/PR for changes unrelated to the title of this PR. I think the original changes are great and I think it's a lot less cognitive load on reviewers and agronholm to review when done separately.

Cheers!

@cjntaylor
Copy link
Contributor Author

Hi, I just wanted to add that I think it'd be good to open a separate issue/PR for changes unrelated to the title of this PR

The only reason I haven't is because they're indirectly related; the full test suite (which includes new tests relevant to this PR that were specifically requested) won't pass without the other test changes. At least locally. For some inexplicable reason it doesn't break on the macOS CI instances, so maybe that's good enough?

I'm happy to do so though. I'll have to wrap my head around making this PR contingent on the PR you're requesting be added (it'll need to be merged first), but, other than that, I think it's fine

Sorry for the confusion. From the beginning I've been indicating that I was unsure of how to handle the other changes w.r.t. this PR so I'm glad someone has weighed in.

Thanks!

@cjntaylor

This comment was marked as resolved.

@agronholm
Copy link
Owner

The changes to .pre-commit-config.yaml are largely unncessary. There seems to be a mypy bug that causes it to behave differently when only a portion of the files are being scanned, as opposed to the whole code base. When that happens, I check with pre-commit run -a to see if it's a real problem, and if it doesn't show up in that scan, I just disable the git hooks for that commit. The workaround would be to force mypy to always check all the files with the following config:

        args: [src, tests]
        pass_filenames: false

@cjntaylor
Copy link
Contributor Author

@uSpike - PR's have been split into #659, #660 and #661, with 659's pre-commit changes determined as irrelevant and removed.

@agronholm - Thanks for your patience in all of this, and apologies for over-complicating things. I've completely isolated the changes into separate PRs so you can consider them independently, and made sure that each one is as minimal a change as possible.

Thank you for the workaround. I've closed #659 accordingly.

Please note that this PR will now fail to run the full test suite on macOS >= 13. Running test_fileio.py in isolation appears to work correctly, and the CI does pass

tests/test_fileio.py Outdated Show resolved Hide resolved
@cjntaylor cjntaylor force-pushed the path-relative_to-walk_up branch 2 times, most recently from dfeb9e9 to 50e18d5 Compare December 29, 2023 00:12
Copy link
Owner

@agronholm agronholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@agronholm agronholm merged commit d6ee6d4 into agronholm:master Dec 29, 2023
16 checks passed
@cjntaylor cjntaylor deleted the path-relative_to-walk_up branch December 29, 2023 17:34
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