Skip to content

Commit

Permalink
chore: cosmetic and minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelotduarte committed Nov 20, 2023
1 parent 6526e7d commit a0b6298
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
1 change: 0 additions & 1 deletion cx_Freeze/_compat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Internal compatible module."""

from __future__ import annotations

import sys
Expand Down
4 changes: 1 addition & 3 deletions cx_Freeze/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,7 @@ def include_files(
copy_dependent_files: bool = True,
) -> None:
"""Include the files in the given directory in the target build."""
self.included_files.extend(
process_path_specs([(source_path, target_path)])
)
self.included_files += process_path_specs([(source_path, target_path)])
if not copy_dependent_files:
self.exclude_dependent_files(source_path)

Expand Down
14 changes: 6 additions & 8 deletions cx_Freeze/freezer.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,6 @@ def __init__(self, *args, **kwargs):
Freezer.__init__(self, *args, **kwargs)
PEParser.__init__(self, self.path, self.bin_path_includes, self.silent)

# deal with C-runtime files
self.runtime_files: set[str] = set()
self._set_runtime_files()

def _add_resources(self, exe: Executable) -> None:
target_path: Path = self.target_dir / exe.target_name

Expand Down Expand Up @@ -978,13 +974,15 @@ def _post_freeze_hook(self) -> None:
if new_order != load_order:
loader_file.write_text("\n".join(new_order))

def _set_runtime_files(self) -> None:
@cached_property
def runtime_files(self) -> set[str]:
"""Deal with C-runtime files."""
winmsvcr = import_module("cx_Freeze.winmsvcr")
if self.include_msvcr:
self.runtime_files.update(winmsvcr.FILES)
else:
if not self.include_msvcr:
# just put on the exclusion list
self.bin_excludes.extend(list(map(Path, winmsvcr.FILES)))
return set()
return winmsvcr.FILES


class DarwinFreezer(Freezer, Parser):
Expand Down
1 change: 0 additions & 1 deletion cx_Freeze/util.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Compiled functions for cx_Freeze itself."""
# ruff: noqa: ARG001

from __future__ import annotations

from pathlib import Path
Expand Down
1 change: 0 additions & 1 deletion cx_Freeze/winmsvcr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
https://github.com/conda-forge/vc-feedstock/blob/master/recipe/meta.yaml
"""

from __future__ import annotations

FILES = (
Expand Down

0 comments on commit a0b6298

Please sign in to comment.