Skip to content

Commit

Permalink
ruff: apply for pyinstaller spec, too
Browse files Browse the repository at this point in the history
  • Loading branch information
marph91 committed Feb 13, 2025
1 parent 25ec703 commit 273c15b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions jimmy_cli.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ datas += collect_data_files("pypandoc")
# - https://stackoverflow.com/a/35805418/7410886
# - https://pyinstaller.org/en/stable/when-things-go-wrong.html#listing-hidden-imports
from pathlib import Path


def list_python_files(folder):
file_list = []
for file_ in folder.iterdir():
if file_.suffix == ".py" and file_.name != "__init__.py":
file_list.append(f"{folder.stem}.{file_.stem}")
return file_list


hiddenimports = list_python_files(Path("src/formats"))


Expand All @@ -28,7 +31,7 @@ import os
import platform

system = platform.system().lower()
print("libc:", platform.libc_ver())
print("libc:", platform.libc_ver())

# need to correspond to ".github/workflows/build.yml"
match os.getenv("RUNNER_MACHINE"):
Expand All @@ -37,7 +40,7 @@ match os.getenv("RUNNER_MACHINE"):
case "ubuntu-20.04":
# Differentiate between latest glibc (no postfix)
# and older glibc (version as postfix).
system += "-glibc-compat"
system += "-glibc-compat"
case "ubuntu-22.04-arm":
system += "-" + platform.machine().lower()
case "macos-latest", "macos-13":
Expand All @@ -47,7 +50,7 @@ executable_name = f"jimmy-cli-{system}"


a = Analysis(
['src/jimmy_cli.py'],
["src/jimmy_cli.py"],
pathex=[],
binaries=[],
datas=datas,
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ notes = [] # don't show todos
[tool.ruff]
# Set the maximum line length to 88.
line-length = 88
# Include pyinstaller spec files.
extend-include = ["*.spec"]
[tool.ruff.lint]
# all rules: https://docs.astral.sh/ruff/rules/
select = [
Expand Down

0 comments on commit 273c15b

Please sign in to comment.