Skip to content

Commit

Permalink
feat: use compatible is_relative_to for Python 3.8
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Jul 5, 2024
1 parent 1b61853 commit 30c4614
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pdm/backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pdm.backend._vendor.pyproject_metadata import ConfigurationError, StandardMetadata
from pdm.backend.exceptions import ConfigError, ValidationError
from pdm.backend.structures import Table
from pdm.backend.utils import find_packages_iter
from pdm.backend.utils import find_packages_iter, is_relative_path

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

0 comments on commit 30c4614

Please sign in to comment.