Skip to content

Commit

Permalink
ENH: Use pathlib to open the file. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Taher Chegini committed May 7, 2023
1 parent 2410e36 commit 797bdfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@

def get_package_name() -> str:
"""Get the name of the package."""
with open("pyproject.toml", "rb") as f:
with Path("pyproject.toml").open("rb") as f:
return tomli.load(f)["project"]["name"]


def get_extras() -> list[str]:
"""Get the name of the package."""
with open("pyproject.toml", "rb") as f:
with Path("pyproject.toml").open("rb") as f:
extras = tomli.load(f)["project"]["optional-dependencies"]
return [e for e in extras if e not in ("test", "typeguard")]


def get_deps() -> list[str]:
"""Get the name of the package."""
with open("pyproject.toml", "rb") as f:
with Path("pyproject.toml").open("rb") as f:
return tomli.load(f)["project"]["dependencies"]


Expand Down

0 comments on commit 797bdfe

Please sign in to comment.