-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Description
Python 3.15 deprecated os.path.commonprefix() (cpython#74453). pyproject_hooks/_impl.py:120 uses it in norm_and_check():
if os.path.commonprefix([norm_source, norm_requested]) != norm_source:On Python 3.15, this raises a DeprecationWarning. For any project running tests with filterwarnings = "error", this causes test failures:
E DeprecationWarning: os.path.commonprefix() is deprecated. Use os.path.commonpath() for longest path prefix.
pyproject_hooks/_impl.py:120: DeprecationWarning
Note the code comment says "We have to use commonprefix for Python 2.7 compatibility" — Python 2.7 is long EOL so this can be replaced. However os.path.commonpath() is not a drop-in replacement (different semantics). A simple string comparison would work here since norm_source is already normalized:
if not abs_requested.startswith(abs_source):Environment: Python 3.15.0a6, pyproject-hooks 1.2.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels