Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python 3.13 standalone mount steps #2743

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion modal/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1504,9 +1504,14 @@ def _registry_setup_commands(
_validate_python_version(add_python, builder_version, allow_micro_granularity=False)
add_python_commands = [
"COPY /python/. /usr/local",
"RUN ln -s /usr/local/bin/python3 /usr/local/bin/python",
"ENV TERMINFO_DIRS=/etc/terminfo:/lib/terminfo:/usr/share/terminfo:/usr/lib/terminfo",
]
if add_python < "3.13":
# Previous versions did not include the `python` binary, but later ones do.
# (The important factor is not the Python version itself, but the standalone dist version.)
# We insert the command in the list at the position it was previously always added
# for backwards compatibility with existing images.
add_python_commands.insert(1, "RUN ln -s /usr/local/bin/python3 /usr/local/bin/python")

# Note: this change is because we install dependencies with uv in 2024.10+
requirements_prefix = "python -m " if builder_version < "2024.10" else ""
Expand Down
Loading