Skip to content

Commit

Permalink
usbsdmux: apply ruff "B", "E", "F" rules automatically or add ignores
Browse files Browse the repository at this point in the history
The setup.py and fastentrypoints.py fixes are somewhat superfluous,
because they will go away with the switch to pyproject.toml,
but fix them anyways.

Signed-off-by: Leonard Göhrs <[email protected]>
  • Loading branch information
hnez committed Apr 29, 2024
1 parent a60bf5b commit 194c6b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fastentrypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_args(cls, dist, header=None):
"""
if header is None:
header = cls.get_header()
spec = str(dist.as_requirement())
spec = str(dist.as_requirement()) # noqa: F841
for type_ in "console", "gui":
group = type_ + "_scripts"
for name, ep in dist.get_entry_map(group).items():
Expand Down Expand Up @@ -94,14 +94,14 @@ def main():
with open(manifest_path, "a+") as manifest:
manifest.seek(0)
manifest_content = manifest.read()
if not "include fastentrypoints.py" in manifest_content:
if "include fastentrypoints.py" not in manifest_content:
manifest.write(("\n" if manifest_content else "") + "include fastentrypoints.py")

# Insert the import statement to setup.py if not present
with open(setup_path, "a+") as setup:
setup.seek(0)
setup_content = setup.read()
if not "import fastentrypoints" in setup_content:
if "import fastentrypoints" not in setup_content:
setup.seek(0)
setup.truncate()
setup.write("import fastentrypoints\n" + setup_content)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup

import fastentrypoints
import fastentrypoints # noqa: F401

setup(
name="usbsdmux",
Expand Down

0 comments on commit 194c6b6

Please sign in to comment.