feat(python): Replace custom Python build by managed pre-built one#11421
feat(python): Replace custom Python build by managed pre-built one#11421heliocastro wants to merge 3 commits into
Conversation
| --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \ | ||
| /tmp/gleam.tar.gz \ | ||
| --bundle /tmp/gleam.sigstore \ | ||
| --certificate-identity-regexp "^https://github.com/gleam-lang/gleam/.*@refs/tags/v${GLEAM_VERSION}$" \ |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
2a85a93 to
292fb6d
Compare
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh \ | ||
| && uv --version \ | ||
| && uv venv -p ${PYTHON_VERSION} ${UV_PYTHON_INSTALL_DIR}/ort-venv |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
292fb6d to
2f73862
Compare
To prevent unnecessary Python builds caused by pyenv and to reduce the time and overhead during the Docker build process, it's preferable to use a pre-built managed Python environment. To avoid any breaking changes, we will utilize a similar approach to the previous method, using a managed Python version with a virtual environment by default. This approach will remain transparent to users while achieving the same results. Signed-off-by: Helio Chissini de Castro <helio.chissini.de.castro@cariad.technology>
2f73862 to
7213c1a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11421 +/- ##
=========================================
Coverage 57.76% 57.76%
+ Complexity 1713 1711 -2
=========================================
Files 347 347
Lines 12902 12902
Branches 1236 1236
=========================================
Hits 7453 7453
Misses 5000 5000
Partials 449 449
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Helio Chissini de Castro <helio.chissini.de.castro@cariad.technology>
7213c1a to
a57f478
Compare
|
@sschuberth I did not pinned Uv per se, as we don't use APi from Uv, only kept pinned same Python, i'm waiting for the tests, but sounds good to go to review |
|
BTW @heliocastro, can we close #10127 ? Is it still needed ? |
|
@nnobelis Different case, but we don't have data on people using conan2 in a relevant way, so I will close that one. If someone raises this as a problem in the future, we can revisit it. |
| && [ "$(arch)" = "aarch64" ] && conan_arch="aarch64" || conan_arch="x86_64" \ | ||
| && curl -L https://github.com/conan-io/conan/releases/download/$CONAN2_VERSION/conan-$CONAN2_VERSION-linux-${conan_arch}.tgz | tar -xvz \ |
There was a problem hiding this comment.
I've split this out as two commits for clarity: #11472
| ENV UV_PYTHON_INSTALL_DIR=/opt/python | ||
| ENV UV_INSTALL_DIR=${UV_PYTHON_INSTALL_DIR}/bin | ||
| ENV PATH=$PATH:${UV_INSTALL_DIR}:${UV_PYTHON_INSTALL_DIR}/ort-venv/bin | ||
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh \ |
There was a problem hiding this comment.
I'm still wondering: Why do yo install uv here instead of downloading the pre-compiled Python distributions directly as described at https://gregoryszorc.com/docs/python-build-standalone/main/running.html#obtaining-distributions?
There was a problem hiding this comment.
Three reasons in one.
- keep the same vendo behavior did before by pyenv
- Install uv as is not available in docker
- Have the update of python patch versions been manager directly
To prevent unnecessary Python builds caused by pyenv and to reduce the time and overhead during the Docker build process, it's preferable to use a pre-built managed Python environment.
To avoid any breaking changes, we will utilize a similar approach to the previous method, using a managed Python version with a virtual environment by default. This approach will remain transparent to users while achieving the same results.