Automatically detect Python version

Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
This commit is contained in:
Juhyung Park
2024-06-12 14:45:58 +09:00
parent 08714d7d91
commit 2baa8c444e
2 changed files with 2 additions and 3 deletions

View File

@@ -79,7 +79,8 @@ python3 -m venv $APP/machine-learning/venv
. $APP/machine-learning/venv/bin/activate
pip3 install poetry
cd machine-learning
if false; then # Set this to true to force poetry update
if python -c 'import sys; exit(0) if sys.version_info.major == 3 and sys.version_info.minor > 11 else exit(1)'; then
echo "Python > 3.11 detected, forcing poetry update"
# Allow Python 3.12 (e.g., Ubuntu 24.04)
sed -i -e 's/<3.12/<4/g' pyproject.toml
poetry update