When building/installing Python dependencies in Docker/CI for multiple Python versions, keep the environment deterministic and aligned across interpreters: use the same dependency constraint/lock inputs everywhere and ensure the packaging toolchain is consistent per interpreter.
Apply this by:
pip, setuptools, and wheel using the target interpreter.ENV KEY=VALUE style) to avoid lint/tooling drift.Example (adapted):
RUN pyenv exec python3.11 -m pip install --upgrade pip setuptools wheel \
&& --mount=type=cache,target=/home/$CELERY_USER/.cache/pip \
pyenv exec python3.11 -m pip install -r requirements/test.txt \
--build-constraint requirements/constraints.txt
# Prefer consistent ENV syntax
ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING=UTF-8
Enter the URL of a public GitHub repository