diff --git a/pyproject.toml b/pyproject.toml index 504331d..21b216a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "pycage" -version = "0.2.5" +version = "0.2.6dev1" description = "tool to handle standalone Python installations from the CLI" authors = [ {name = "Florian Förster", email = "f.foerster@d-opt.com"}, @@ -78,7 +78,7 @@ directory = "reports/coverage" [tool.bumpversion] -current_version = "0.2.5" +current_version = "0.2.6dev1" parse = """(?x) (?P0|[1-9]\\d*)\\. (?P0|[1-9]\\d*)\\. diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/concrt140.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/concrt140.dll new file mode 100644 index 0000000..ec4000d Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/concrt140.dll differ diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140.dll new file mode 100644 index 0000000..bea9c37 Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140.dll differ diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_1.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_1.dll new file mode 100644 index 0000000..e1913ef Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_1.dll differ diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_2.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_2.dll new file mode 100644 index 0000000..de91706 Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_2.dll differ diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_atomic_wait.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_atomic_wait.dll new file mode 100644 index 0000000..077981c Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_atomic_wait.dll differ diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_codecvt_ids.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_codecvt_ids.dll new file mode 100644 index 0000000..6492087 Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/msvcp140_codecvt_ids.dll differ diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vccorlib140.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vccorlib140.dll new file mode 100644 index 0000000..9f72ffc Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vccorlib140.dll differ diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vcruntime140.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vcruntime140.dll new file mode 100644 index 0000000..5786e93 Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vcruntime140.dll differ diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vcruntime140_1.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vcruntime140_1.dll new file mode 100644 index 0000000..0b660f9 Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vcruntime140_1.dll differ diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vcruntime140_threads.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vcruntime140_threads.dll new file mode 100644 index 0000000..36323c1 Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.CRT/vcruntime140_threads.dll differ diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.CXXAMP/vcamp140.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.CXXAMP/vcamp140.dll new file mode 100644 index 0000000..6cbca35 Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.CXXAMP/vcamp140.dll differ diff --git a/src/pycage/_files/msvc-redist/Microsoft.VC143.OpenMP/vcomp140.dll b/src/pycage/_files/msvc-redist/Microsoft.VC143.OpenMP/vcomp140.dll new file mode 100644 index 0000000..dc2d193 Binary files /dev/null and b/src/pycage/_files/msvc-redist/Microsoft.VC143.OpenMP/vcomp140.dll differ diff --git a/src/pycage/constants.py b/src/pycage/constants.py new file mode 100644 index 0000000..41bd747 --- /dev/null +++ b/src/pycage/constants.py @@ -0,0 +1,10 @@ +from pathlib import Path +from typing import Final + +LIB_ROOT_FOLDER: Final[Path] = Path(__file__) +if not LIB_ROOT_FOLDER.exists(): + raise FileNotFoundError(f"Lib root folder not found under: >{LIB_ROOT_FOLDER}<") + +MSVC_FOLDER: Final[Path] = LIB_ROOT_FOLDER / "msvc-redist" +if not MSVC_FOLDER.exists(): + raise FileNotFoundError(f"Folder for MSVC Redist files not found under: >{MSVC_FOLDER}<") diff --git a/src/pycage/venv.py b/src/pycage/venv.py index a373b61..515e39f 100644 --- a/src/pycage/venv.py +++ b/src/pycage/venv.py @@ -1,12 +1,14 @@ from __future__ import annotations +import shutil import subprocess import sys from pathlib import Path import click -from pycage.helpers import get_interpreter +from pycage.constants import MSVC_FOLDER +from pycage.helpers import get_interpreter, path_verify_directory, path_verify_existence @click.group(help="manage virtual environment with downloaded standalone images") @@ -159,8 +161,37 @@ def remove( subprocess.run(cmd) +@click.command( + help="add MSVC Redistributable runtime dependencies to the root path of the environment" +) +def add_msvc_redist() -> None: + try: + pth_intp = get_interpreter() + except RuntimeError: + click.echo("Base interpreter path could not be found", err=True) + return + + target_path = pth_intp.parent + try: + path_verify_directory(target_path) + except ValueError: + click.echo(f"Target path >{target_path}< does not seem to be a directory", err=True) + return + try: + path_verify_existence(target_path) + except FileNotFoundError: + click.echo(f"Target path >{target_path}< does not seem to exist", err=True) + return + + dll_files = MSVC_FOLDER.glob("**/*.dll") + + for dll_src in dll_files: + shutil.copy(dll_src, target_path) + + venv.add_command(create) venv.add_command(add) venv.add_command(upgrade_pip) venv.add_command(remove) venv.add_command(upgrade_seeders) +venv.add_command(add_msvc_redist)