Add python 3.13 support#15
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Python 3.13 (and anticipates 3.14) by implementing compatibility fixes for pathlib changes introduced in Python 3.13. The main issue addressed is that Python 3.13 switched pathlib to a new implementation that delegates parsing to os.path, which breaks URLPath's custom URL handling logic.
Key changes:
- Implements
_parse_path()method to hook into Python 3.13's new pathlib extension point - Adds
_combine_args()method to handle multi-argument URL construction for Python 3.12+ - Updates compatibility layer with
_bootstrap_legacy_parts()to populate missing pathlib attributes
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| urlpath/init.py | Adds Python 3.13 compatibility methods and updates pathlib interaction logic |
| pyproject.toml | Updates Python version classifiers and adds charset-normalizer dependency |
| README.md | Updates supported Python version range documentation |
| .github/workflows/test.yml | Adds Python 3.13 and 3.14 to CI test matrix |
| .github/copilot-instructions.md | Updates CI documentation to reflect new Python version range |
Comment on lines
+584
to
+589
| tail_parts = list(value[1:]) if value and (self._drv or self._root) else list(value) | ||
|
|
||
| object.__setattr__(self, "_tail_cached", tail_parts) | ||
| tail_attr = getattr(type(self), "_tail", None) | ||
| if not isinstance(tail_attr, property): | ||
| object.__setattr__(self, "_tail", tail_parts) |
There was a problem hiding this comment.
The logic for setting _tail_cached and _tail is duplicated in lines 584-589 and 1718-1722. Consider extracting this into a helper method to reduce code duplication.
4135f5c to
a396256
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add python 3.13 support