Skip to content

Commit 23a4774

Browse files
committed
re-use existing py310 example instead of introducing a new e2e test
1 parent 60682c0 commit 23a4774

3 files changed

Lines changed: 7 additions & 50 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "py310"
22
version: "0.1.0"
33
description: |
4-
Empty Tesseract that requires Python 3.10 (set through a custom Docker image).
4+
Empty Tesseract that requires Python 3.10 (set through build_config.python_version).
55
66
build_config:
7-
base_image: "python:3.10-slim-bookworm"
7+
python_version: "3.10"

tesseract_core/sdk/templates/build_pip_venv.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,9 @@ if [ -n "${TESSERACT_PYTHON_VERSION:-}" ]; then
4444
cp -a "$UV_PYTHON_DIR"/bin/* /python-env/bin/
4545
cp -a "$UV_PYTHON_DIR"/lib/* /python-env/lib/
4646
cp -a "$UV_PYTHON_DIR"/include/* /python-env/include/
47+
48+
# pyvenv.cfg still points `home` at the uv-managed installation, which does
49+
# not exist after the Docker multi-stage COPY. Point it at the now-local
50+
# binaries so the interpreter can locate its stdlib.
51+
sed -i "s|^home = .*|home = /python-env/bin|" /python-env/pyvenv.cfg
4752
fi

tests/endtoend_tests/test_build.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -170,54 +170,6 @@ def apply(inputs: InputSchema) -> OutputSchema:
170170
docker_cleanup["images"].append(img_tag)
171171

172172

173-
def test_build_with_python_version(
174-
cli_runner,
175-
docker_client,
176-
docker_cleanup,
177-
dummy_image_name,
178-
tmp_path,
179-
):
180-
"""Test that a Tesseract can be built with a specific python_version."""
181-
init_args = ["init", "--target-dir", str(tmp_path), "--name", dummy_image_name]
182-
result = cli_runner.invoke(app, init_args, catch_exceptions=False)
183-
assert result.exit_code == 0, result.stderr
184-
185-
image_name = build_tesseract(
186-
docker_client,
187-
tmp_path,
188-
dummy_image_name,
189-
config_override={"build_config.python_version": "'3.12'"},
190-
)
191-
docker_cleanup["images"].append(image_name)
192-
assert image_exists(docker_client, image_name)
193-
194-
# Verify the Python version inside the container
195-
result = subprocess.run(
196-
[
197-
"docker",
198-
"run",
199-
"--rm",
200-
"--entrypoint",
201-
"python",
202-
image_name,
203-
"--version",
204-
],
205-
capture_output=True,
206-
text=True,
207-
)
208-
assert result.returncode == 0
209-
assert "3.12" in result.stdout
210-
211-
# Verify the runtime and its dependencies are functional under that Python
212-
# version by running the Tesseract's check command through the CLI.
213-
result = cli_runner.invoke(
214-
app,
215-
["run", image_name, "check"],
216-
catch_exceptions=False,
217-
)
218-
assert result.exit_code == 0, result.stderr
219-
220-
221173
def test_metadata_label(built_image_name):
222174
"""Test that metadata from tesseract_config.yaml is stored as a Docker label."""
223175
result = subprocess.run(

0 commit comments

Comments
 (0)