aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/set_versions.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/set_versions.py')
-rw-r--r--scripts/set_versions.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/set_versions.py b/scripts/set_versions.py
index fb33dc1..3bd2ab4 100644
--- a/scripts/set_versions.py
+++ b/scripts/set_versions.py
@@ -3,18 +3,16 @@
from pathlib import Path
from textwrap import dedent
-from scripts import python_version
+from scripts.python_version import ALL_VERSIONS, MAIN_VERSION
DOCKERFILE_TEMPLATE = Path("scripts/in.Dockerfile").read_text("utf-8")
DOCKERFILE = Path("Dockerfile")
-versions, main_version = python_version.get_all_versions()
-
# Download and copy multiple python images into one layer
python_build = ""
previous_layer = "first"
-for version in versions:
+for version in ALL_VERSIONS:
if version.is_main:
# Main is handled separately later
continue
@@ -31,14 +29,14 @@ for version in versions:
# Main version is installed twice, once at the very beginning to make sure
# its files aren't overwritten, and once at the end which actually makes use of the version
-python_build = f"FROM python:{main_version.image_tag} as base-first\n" + python_build
+python_build = f"FROM python:{MAIN_VERSION.image_tag} as base-first\n" + python_build
# Write new dockerfile
DOCKERFILE.write_text(
"# THIS FILE IS AUTOGENERATED, DO NOT MODIFY! #\n"
+ DOCKERFILE_TEMPLATE.replace("{python_install_commands}", python_build)
.replace("{final_base}", previous_layer)
- .replace("{main_version_tag}", main_version.image_tag),
+ .replace("{main_version_tag}", MAIN_VERSION.image_tag),
"utf-8",
)