Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Ensure pyenv works when generating lockfiles (#1296)
Currently, if the developer has some `pyenv` global settings or use `direnv`, we can't set the python version in a subshell to generate lockfiles. Instead, the developer python version is used silently. --- We fix it by overloading `PYENV_VERSION`, which is the highest way to define the python version we want. https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-shell > Sets a shell-specific Python version by setting the PYENV_VERSION environment variable in your shell. This version overrides application-specific versions and the global version. --- ```diff $ bash pip-compile.sh Generating requirements: python==3.9 | scikit-learn==1.6 (1/6) - Something wrong setting 'python-3.9', get '3.12' ``` ```bash $ bash pip-compile.sh Generating requirements: python==3.9 | scikit-learn==1.6 (1/6) Generating requirements: python==3.10 | scikit-learn==1.6 (2/6) Generating requirements: python==3.11 | scikit-learn==1.6 (3/6) Generating requirements: python==3.12 | scikit-learn==1.4 (4/6) Generating requirements: python==3.12 | scikit-learn==1.5 (5/6) Generating requirements: python==3.12 | scikit-learn==1.6 (6/6) ```
- Loading branch information