Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Jan 31, 2024
1 parent 8d9c11b commit daf4472
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 6 additions & 9 deletions src/pep610/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit daf4472

Please # to comment.