Skip to content

Conversation

@hellovolcano
Copy link
Contributor

What does this Pull Request accomplish?

Changes the type of paths from string to pathlib.Path.

Why should this Pull Request be merged?

fixes #130

Ran examples locally
Unit tests, mypy, nps, bandit

Signed-off-by: Valerie Gleason 👌 <[email protected]>
Signed-off-by: Valerie Gleason 👌 <[email protected]>
@hellovolcano hellovolcano changed the title Users/vgleason/paths use pathlib Paths should use pathlib.Path instead of str Aug 12, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 12, 2025

Test Results

   10 files  ±0     10 suites  ±0   22s ⏱️ ±0s
  228 tests ±0    228 ✅ ±0  0 💤 ±0  0 ❌ ±0 
2 230 runs  ±0  2 230 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 126e919. ± Comparison against base commit 5146df6.

♻️ This comment has been updated with latest results.

Signed-off-by: Valerie Gleason 👌 <[email protected]>
Signed-off-by: Valerie Gleason 👌 <[email protected]>
@hellovolcano hellovolcano merged commit 7620d68 into main Aug 13, 2025
38 of 40 checks passed
@hellovolcano hellovolcano deleted the users/vgleason/paths-use-pathlib branch August 13, 2025 15:56
python_path = Path(sys.executable).resolve()

if sys.prefix not in python_path:
if python_path.is_relative_to(Path(sys.prefix)) is False:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't write <condition> is False.

Two reasons:

  1. In this case, <condition> already evaluates to a bool. If <condition> is False is good (it's not), then (<condition> is False) is True is better (it's not).
  2. Python has the concept of "truthiness" and "falsiness", where other objects besides the bool literal False are also "falsy": 0, "", None, [], etc. The is operator checks object identity, which bypasses "falsiness": https://docs.python.org/3/reference/expressions.html#is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public API uses str to represent paths

5 participants