Skip to content

Commit

Permalink
Apply ruff rule RUF100 (#1401)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos authored May 12, 2024
1 parent 964d93c commit 4b15fe2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/1400.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enable and apply ruff rule `RUF100`.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ lint.extend-select = [
"PLE",
"PLW",
"RSE",
"RUF100",
"W",
]
lint.isort = {known-first-party = ["helpers", "package_info", "pipx"]}
Expand Down
2 changes: 1 addition & 1 deletion src/pipx/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
pipx_package_source_path = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, pipx_package_source_path)

from pipx.main import cli # noqa
from pipx.main import cli

if __name__ == "__main__":
sys.exit(cli())
2 changes: 1 addition & 1 deletion src/pipx/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

def has_venv() -> bool:
try:
import venv # noqa
import venv # noqa: F401

return True
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion src/pipx/venv_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_resources_from_inst_files(dist: metadata.Distribution, bin_path: Path, m
# not sure what is found here
inst_files = dist.read_text("installed-files.txt") or ""
for line in inst_files.splitlines():
entry = line.split(",")[0] # noqa: T484
entry = line.split(",")[0]
inst_file_path = Path(str(dist.locate_file(entry))).resolve()
try:
if inst_file_path.parent.samefile(bin_path):
Expand Down

0 comments on commit 4b15fe2

Please sign in to comment.