diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1bd401d..fd319be 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.11" + python: "3.12" jobs: post_checkout: - git fetch --unshallow || true diff --git a/src/pep610/__init__.py b/src/pep610/__init__.py index 7b61724..5fab371 100644 --- a/src/pep610/__init__.py +++ b/src/pep610/__init__.py @@ -352,18 +352,15 @@ def is_editable(distribution_name: str) -> bool: Returns: Whether the distribution is editable. + Raises: + importlib_metadata.PackageNotFoundError: If the distribution is not found. + >>> is_editable("pep610") # doctest: +SKIP False - """ + """ # noqa: DAR402, RUF100 dist = distribution(distribution_name) - if ( - (data := read_from_distribution(dist)) - and isinstance(data, DirData) - and data.dir_info.is_editable() - ): - return True - - return False + data = read_from_distribution(dist) + return isinstance(data, DirData) and data.dir_info.is_editable() def write_to_distribution(dist: PathDistribution, data: dict) -> int: