Skip to content

Commit

Permalink
[ltim] Force Python 3.11.9 in GUI installer
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba2k2 committed Dec 4, 2024
1 parent edad0ce commit f27beb6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ltchiptool/util/ltim.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
PYTHON_RELEASE_FILE_FMT = (
"https://www.python.org/api/v2/downloads/release_file/?release=%s&os=1"
)
PYTHON_RELEASE_VERSION_SPEC = SimpleSpec("3.11.9")
PYTHON_GET_PIP = "https://bootstrap.pypa.io/get-pip.py"

PYTHON_WIN = "python.exe"
Expand Down Expand Up @@ -144,8 +145,6 @@ def install(
self.callback.finish()

def _install_python_windows(self, out_path: Path) -> Tuple[Path, Path]:
version_spec = SimpleSpec("~3.11")

self.callback.on_message("Checking the latest Python version")
with requests.get(PYTHON_RELEASES) as r:
releases = r.json()
Expand All @@ -157,7 +156,7 @@ def _install_python_windows(self, out_path: Path) -> Tuple[Path, Path]:
(
(version, release)
for (version, release) in releases_map
if version in version_spec
if version in PYTHON_RELEASE_VERSION_SPEC
),
key=lambda tpl: tpl[0],
)
Expand Down Expand Up @@ -336,4 +335,9 @@ def _install_path_windows(self, out_path: Path) -> None:

if __name__ == "__main__":
LoggingHandler.get().level = DEBUG
LTIM.get().install(out_path=Path(expandvars("%PROGRAMFILES%\\kuba2k2\\ltchiptool")))
LTIM.get().install(
out_path=Path.cwd().resolve() / "ltchiptool",
shortcut=None,
fta=[],
add_path=False,
)

0 comments on commit f27beb6

Please sign in to comment.