Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 13, 2025
1 parent 646c078 commit 8398ebf
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cx_Freeze/command/bdist_appimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def run(self) -> None:
Terminal=true
X-AppImage-Arch={ARCH}
X-AppImage-Name={self.target_name}
X-AppImage-Version={self.target_version or ''}
X-AppImage-Version={self.target_version or ""}
"""
self.save_as_file(
dedent(desktop_entry),
Expand Down
6 changes: 2 additions & 4 deletions cx_Freeze/command/bdist_mac.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ class bdist_mac(Command):
(
"bundle-name=",
None,
"File name for the bundle application "
"without the .app extension.",
"File name for the bundle application without the .app extension.",
),
(
"plist-items=",
Expand Down Expand Up @@ -97,8 +96,7 @@ class bdist_mac(Command):
(
"codesign-resource-rules",
None,
"Plist file to be passed to "
"codesign's --resource-rules option.",
"Plist file to be passed to codesign's --resource-rules option.",
),
(
"absolute-reference-path=",
Expand Down
4 changes: 2 additions & 2 deletions cx_Freeze/freezer.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def _populate_zip_options(
invalid = sorted(zip_include_packages & zip_exclude_packages)
if invalid:
msg = (
f"package{'s' if len(invalid)>1 else ''} "
f"package{'s' if len(invalid) > 1 else ''} "
f"{', '.join(invalid)!r} "
"cannot be both included and excluded from zip file"
)
Expand Down Expand Up @@ -1040,7 +1040,7 @@ def _default_bin_includes(self) -> list[str]:
py_version = f"{PYTHON_VERSION}{ABI_THREAD}"
names = [
f"python{sys.version_info[0]}.dll",
f"python{py_version.replace('.','')}.dll",
f"python{py_version.replace('.', '')}.dll",
]
python_shared_libs: list[Path] = []
for name in names:
Expand Down
2 changes: 1 addition & 1 deletion cx_Freeze/winmsvcr_repack.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def get_msvcr_files(
cache_base = Path(os.path.expandvars("${APPDATA}"))
else:
cache_base = Path("~/.cache").expanduser()
cache_dir = cache_base / f"cx_Freeze/vc_redist/{ version }"
cache_dir = cache_base / f"cx_Freeze/vc_redist/{version}"
cache_dir.mkdir(parents=True, exist_ok=True)
filename = cache_dir / name
unpack_dir = cache_dir / name.replace(".", "_")
Expand Down
3 changes: 1 addition & 2 deletions samples/pythonnet-demo/wordpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,7 @@ def InitializeComponent(self) -> None:
self.label1.Size = System.Drawing.Size(296, 140)
self.label1.TabIndex = 2
self.label1.Text = (
"Python Wordpad - an example winforms "
"application using Python.NET"
"Python Wordpad - an example winforms application using Python.NET"
)

self.AutoScaleBaseSize = System.Drawing.Size(5, 13)
Expand Down
3 changes: 1 addition & 2 deletions samples/tkinter/test_tkinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
def _test() -> None:
root = Tk()
text = (
f"This is Tcl/Tk version {TclVersion}\n"
"This should be a cedilla: \xe7"
f"This is Tcl/Tk version {TclVersion}\nThis should be a cedilla: \xe7"
)
label = Label(root, text=text)
label.pack()
Expand Down
6 changes: 3 additions & 3 deletions tests/test_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ def test_find_spec(self, tmp_path: Path, fix_module_finder) -> None:
create_package(tmp_path, source=FIND_SPEC_TEST[4])
fix_module_finder.path.insert(0, os.fspath(tmp_path / "find_spec"))
module = fix_module_finder.include_module("hello")
assert (
"dummypackage" in module.global_names
), "packages that raises exceptions should still be imported"
assert "dummypackage" in module.global_names, (
"packages that raises exceptions should still be imported"
)
2 changes: 1 addition & 1 deletion tests/test_freezer.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_freezer_default_bin_includes(tmp_path: Path, monkeypatch) -> None:
if IS_MINGW:
expected = f"libpython{py_version}.dll"
elif IS_WINDOWS:
expected = f"python{py_version.replace('.','')}.dll"
expected = f"python{py_version.replace('.', '')}.dll"
elif IS_CONDA: # macOS or Linux
if IS_MACOS:
expected = f"libpython{py_version}.dylib"
Expand Down

0 comments on commit 8398ebf

Please sign in to comment.