Repository: mlflow/mlflow (language: python)

Issue:
[BUG] `dev-env-setup.sh` still uses python 3.8 as minimum (& default) version
### Issues Policy acknowledgement

- [X] I have read and agree to submit bug reports in accordance with the [issues policy](https://www.github.com/mlflow/mlflow/blob/master/ISSUE_POLICY.md)

### Where did you encounter this bug?

Local machine

### Willingness to contribute

Yes. I can contribute a fix for this bug independently.

### MLflow version

- Client: 2.17.3.dev0

### System information

- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
- **Python version**:
- **yarn version, if running the dev UI**:


### Describe the problem

The dev env setup CLI has the following:

https://github.com/mlflow/mlflow/blob/3ead5845c87b0511f26bdb9fc32209b20c20c709/dev/dev-env-setup.sh#L219

But I see that support for 3.8 was dropped (https://github.com/mlflow/mlflow/pull/13531)

This resulted in an error when configuring the dev environment (`ERROR: Package 'mlflow' requires a different Python: 3.8.13 not in '>=3.9'`)

### Tracking information

<!-- PLEASE KEEP BACKTICKS AND CHECK PREVIEW -->
```shell
REPLACE_ME
```


### Code to reproduce issue

<!-- PLEASE KEEP BACKTICKS AND CHECK PREVIEW -->
```
git clone mlflow
cd mlflow
dev/dev-env-setup.sh -d .venvs/mlflow-dev -q -c
```


### Stack trace

<!-- PLEASE KEEP BACKTICKS AND CHECK PREVIEW -->
```
mlflow-devdaniel.liden@M4PK9Q7YTH mlflow % dev/dev-env-setup.sh -d .venvs/mlflow-dev -q -c
The minimum version of Python to ensure backwards compatibility for MLflow development is: 3.8
 Installing Python version 3.8.13
A virtual environment is already located at .venvs/mlflow-dev. Do you wish to replace it? (y/n) y
Replacing Virtual environment in '.venvs/mlflow-dev'. Installing new instance.
created virtual environment CPython3.8.13.final.0-64 in 12608ms
  creator CPython3Posix(dest=/Users/daniel.liden/git/mlflow/.venvs/mlflow-dev, clear=True, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/daniel.liden/Library/Application Support/virtualenv)
    added seed packages: pip==24.2, setuptools==75.1.0, wheel==0.44.0
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
Current Python version: Python 3.8.13
Activated environment is located:  .venvs/mlflow-dev/bin/activate
Obtaining file:///Users/daniel.liden/git/mlflow
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Collecting Flask<4 (from mlflow==2.17.3.dev0)
  Using cached flask-3.0.3-py3-none-any.whl.metadata (3.2 kB)
Collecting alembic!=1.10.0,<2 (from mlflow==2.17.3.dev0)
  Using cached alembic-1.14.0-py3-none-any.whl.metadata (7.4 kB)
Collecting cachetools<6,>=5.0.0 (from mlflow==2.17.3.dev0)
  Using cached cachetools-5.5.0-py3-none-any.whl.metadata (5.3 kB)
Collecting click<9,>=7.0 (from mlflow==2.17.3.dev0)
  Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting cloudpickle<4 (from mlflow==2.17.3.dev0)
  Using cached cloudpickle-3.1.0-py3-none-any.whl.metadata (7.0 kB)
Collecting databricks-sdk<1,>=0.20.0 (from mlflow==2.17.3.dev0)
  Using cached databricks_sdk-0.36.0-py3-none-any.whl.metadata (38 kB)
Collecting docker<8,>=4.0.0 (from mlflow==2.17.3.dev0)
  Using cached docker-7.1.0-py3-none-any.whl.metadata (3.8 kB)
Collecting gitpython<4,>=3.1.9 (from mlflow==2.17.3.dev0)
  Using cached GitPython-3.1.43-py3-none-any.whl.metadata (13 kB)
Collecting graphene<4 (from mlflow==2.17.3.dev0)
  Using cached graphene-3.4.1-py2.py3-none-any.whl.metadata (6.9 kB)
Collecting importlib-metadata!=4.7.0,<9,>=3.7.0 (from mlflow==2.17.3.dev0)
  Using cached importlib_metadata-8.5.0-py3-none-any.whl.metadata (4.8 kB)
Collecting markdown<4,>=3.3 (from mlflow==2.17.3.dev0)
  Using cached Markdown-3.7-py3-none-any.whl.metadata (7.0 kB)
Collecting matplotlib<4 (from mlflow==2.17.3.dev0)
  Using cached matplotlib-3.7.5-cp38-cp38-macosx_11_0_arm64.whl.metadata (5.7 kB)
Collecting numpy<3 (from mlflow==2.17.3.dev0)
  Using cached numpy-1.24.4-cp38-cp38-macosx_11_0_arm64.whl.metadata (5.6 kB)
Collecting opentelemetry-api<3,>=1.9.0 (from mlflow==2.17.3.dev0)
  Using cached opentelemetry_api-1.27.0-py3-none-any.whl.metadata (1.4 kB)
Collecting opentelemetry-sdk<3,>=1.9.0 (from mlflow==2.17.3.dev0)
  Using cached opentelemetry_sdk-1.27.0-py3-none-any.whl.metadata (1.5 kB)
Collecting packaging<25 (from mlflow==2.17.3.dev0)
  Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
Collecting pandas<3 (from mlflow==2.17.3.dev0)
  Using cached pandas-2.0.3-cp38-cp38-macosx_11_0_arm64.whl.metadata (18 kB)
Collecting protobuf<6,>=3.12.0 (from mlflow==2.17.3.dev0)
  Using cached protobuf-5.28.3-cp38-abi3-macosx_10_9_universal2.whl.metadata (592 bytes)
Collecting pyarrow<18,>=4.0.0 (from mlflow==2.17.3.dev0)
  Using cached pyarrow-17.0.0-cp38-cp38-macosx_11_0_arm64.whl.metadata (3.3 kB)
Collecting pyyaml<7,>=5.1 (from mlflow==2.17.3.dev0)
  Using cached PyYAML-6.0.2-cp38-cp38-macosx_14_0_arm64.whl
Collecting requests<3,>=2.17.3 (from mlflow==2.17.3.dev0)
  Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting scikit-learn<2 (from mlflow==2.17.3.dev0)
  Using cached scikit_learn-1.3.2-cp38-cp38-macosx_12_0_arm64.whl.metadata (11 kB)
Collecting scipy<2 (from mlflow==2.17.3.dev0)
  Using cached scipy-1.10.1-cp38-cp38-macosx_12_0_arm64.whl.metadata (53 kB)
Collecting sqlalchemy<3,>=1.4.0 (from mlflow==2.17.3.dev0)
  Using cached SQLAlchemy-2.0.36-cp38-cp38-macosx_11_0_arm64.whl.metadata (9.7 kB)
Collecting sqlparse<1,>=0.4.0 (from mlflow==2.17.3.dev0)
  Using cached sqlparse-0.5.1-py3-none-any.whl.metadata (3.9 kB)
Collecting Jinja2<4,>=2.11 (from mlflow==2.17.3.dev0)
  Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting gunicorn<24 (from mlflow==2.17.3.dev0)
  Using cached gunicorn-23.0.0-py3-none-any.whl.metadata (4.4 kB)
INFO: pip is looking at multiple versions of mlflow to determine which version is compatible with other requirements. This could take a while.

[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: pip install --upgrade pip
ERROR: Package 'mlflow' requires a different Python: 3.8.13 not in '>=3.9'
```


### Other info / logs

<!-- PLEASE KEEP BACKTICKS AND CHECK PREVIEW -->
```
REPLACE_ME
```


### What component(s) does this bug affect?

- [ ] `area/artifacts`: Artifact stores and artifact logging
- [ ] `area/build`: Build and test infrastructure for MLflow
- [ ] `area/deployments`: MLflow Deployments client APIs, server, and third-party Deployments integrations
- [ ] `area/docs`: MLflow documentation pages
- [ ] `area/examples`: Example code
- [ ] `area/model-registry`: Model Registry service, APIs, and the fluent client calls for Model Registry
- [ ] `area/models`: MLmodel format, model serialization/deserialization, flavors
- [ ] `area/recipes`: Recipes, Recipe APIs, Recipe configs, Recipe Templates
- [ ] `area/projects`: MLproject format, project running backends
- [ ] `area/scoring`: MLflow Model server, model deployment tools, Spark UDFs
- [ ] `area/server-infra`: MLflow Tracking server backend
- [ ] `area/tracking`: Tracking Service, tracking client APIs, autologging

### What interface(s) does this bug affect?

- [ ] `area/uiux`: Front-end, user experience, plotting, JavaScript, JavaScript dev server
- [ ] `area/docker`: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
- [ ] `area/sqlalchemy`: Use of SQLAlchemy in the Tracking Service or Model Registry
- [ ] `area/windows`: Windows support

### What language(s) does this bug affect?

- [ ] `language/r`: R APIs and clients
- [ ] `language/java`: Java APIs and clients
- [ ] `language/new`: Proposals for new client languages

### What integration(s) does this bug affect?

- [ ] `integrations/azure`: Azure and Azure ML integrations
- [ ] `integrations/sagemaker`: SageMaker integrations
- [ ] `integrations/databricks`: Databricks integrations


Discussion / hints:

Fix patch:
diff --git a/dev/dev-env-setup.sh b/dev/dev-env-setup.sh
index 8eef6dce17d2e..80755b3930a6c 100755
--- a/dev/dev-env-setup.sh
+++ b/dev/dev-env-setup.sh
@@ -124,10 +124,8 @@ quiet_command(){
 
 minor_to_micro() {
   case $1 in
-    "3.7") echo "3.7.14" ;;
-    "3.8") echo "3.8.13" ;;
-    "3.9") echo "3.9.13" ;;
-    "3.10") echo "3.10.4" ;;
+    "3.9") echo "3.9.20" ;;
+    "3.10") echo "3.10.13" ;;
   esac
 }
 
@@ -216,7 +214,7 @@ check_and_install_pyenv() {
 
 check_and_install_min_py_version() {
   # Get the minimum supported version for development purposes
-  min_py_version="3.8"
+  min_py_version="3.9"
 
   echo "The minimum version of Python to ensure backwards compatibility for MLflow development is: $(
     tput bold
@@ -244,7 +242,6 @@ check_and_install_min_py_version() {
   pyenv local "$PY_INSTALL_VERSION"
   pyenv exec pip install $(quiet_command) --upgrade pip
   pyenv exec pip install $(quiet_command) virtualenv
-  pyenv exec pip install $(quiet_command) pre-commit
 }
 
 # Check if the virtualenv already exists at the specified path
@@ -278,13 +275,13 @@ create_virtualenv() {
 install_mlflow_and_dependencies() {
   # Install current checked out version of mlflow (local)
   pip install -e .[extras]
-  
+
   echo "Installing pip dependencies for development environment."
   if [[ -n "$full" ]]; then
     # Install dev requirements
     pip install -r "$rd/dev-requirements.txt"
     # Install test plugin
-    pip install -e "$MLFLOW_HOME/tests/resources//mlflow-test-plugin"
+    pip install -e "$MLFLOW_HOME/tests/resources/mlflow-test-plugin"
   else
     files=("$rd/test-requirements.txt" "$rd/lint-requirements.txt" "$rd/doc-requirements.txt")
     for r in "${files[@]}"; do


Test patch:
diff --git a/dev/test-dev-env-setup.sh b/dev/test-dev-env-setup.sh
index 1dc9c0cfe1de9..b356fdf7b9b5e 100755
--- a/dev/test-dev-env-setup.sh
+++ b/dev/test-dev-env-setup.sh
@@ -21,7 +21,7 @@ export REPO_ROOT
 # Run the installation of the environment
 DEV_DIR=$REPO_ROOT/.venvs/mlflow-dev
 
-"$REPO_ROOT"/dev/dev-env-setup.sh -d "$DEV_DIR" -f
+"$REPO_ROOT"/dev/dev-env-setup.sh -d "$DEV_DIR"
 
 source "$DEV_DIR/bin/activate"
 
@@ -33,7 +33,7 @@ if [ -z "$SKLEARN_VER" ]; then
   err=$((err + 1))
 fi
 
-min_py_version="3.8"
+min_py_version="3.9"
 installed_py_version=$(python --version | grep -E -o "([0-9]{1,}\.[0-9]{1,})")
 
 # shellcheck disable=SC2053