Skip to content

Commit 30c4614

Browse files
committed
feat: use compatible is_relative_to for Python 3.8
Signed-off-by: Frost Ming <me@frostming.com>
1 parent 1b61853 commit 30c4614

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pdm/backend/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pdm.backend._vendor.pyproject_metadata import ConfigurationError, StandardMetadata
1111
from pdm.backend.exceptions import ConfigError, ValidationError
1212
from pdm.backend.structures import Table
13-
from pdm.backend.utils import find_packages_iter
13+
from pdm.backend.utils import find_packages_iter, is_relative_path
1414

1515
if sys.version_info >= (3, 11):
1616
import tomllib
@@ -257,7 +257,7 @@ def _get_default_package_dir(self) -> str:
257257
self.root.joinpath("src").is_dir()
258258
and not self.includes
259259
# the first path part must not be a wildcard
260-
or any(Path(p).is_relative_to("src") for p in self.includes)
260+
or any(is_relative_path(Path(p), Path("src")) for p in self.includes)
261261
and "src" not in self.excludes
262262
and "src/" not in self.excludes
263263
):

0 commit comments

Comments
 (0)