Skip to content

Commit d38d67c

Browse files
authored
Upgrade Flask MV to 3.0 (mlflow#10098)
Signed-off-by: B-Step62 <[email protected]>
1 parent 2bba418 commit d38d67c

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

.github/workflows/requirements.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,5 @@ jobs:
7979
- name: Run tests
8080
run: |
8181
source dev/setup-ssh.sh
82-
./dev/run-python-tests.sh
82+
pytest tests --quiet --requires-ssh --ignore-flavors \
83+
--ignore=tests/examples --ignore=tests/recipes --ignore=tests/evaluate

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,8 @@ request by running:
581581

582582
```bash
583583
pre-commit run --all-files
584-
./dev/run-python-tests.sh
584+
pytest tests --quiet --requires-ssh --ignore-flavors \
585+
--ignore=tests/examples --ignore=tests/recipes --ignore=tests/evaluate
585586
```
586587

587588
We use [pytest](https://docs.pytest.org/en/latest/contents.html) to run
@@ -612,7 +613,7 @@ If you are adding new framework flavor support, you'll need to modify
612613
`pytest` and Github action configurations so tests for your code can run
613614
properly. Generally, the files you'll have to edit are:
614615

615-
1. `dev/run-python-tests.sh`:
616+
1. `.github/workflows/master.yml`: lines where pytest runs with `--ignore-flavors` flag
616617

617618
1. Add your tests to the ignore list, where the other frameworks are
618619
ignored

mlflow/server/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import types
88

99
from flask import Flask, Response, send_from_directory
10-
from flask import __version__ as flask_version
1110
from packaging.version import Version
1211

1312
from mlflow.exceptions import MlflowException
@@ -40,7 +39,7 @@
4039
REL_STATIC_DIR = "js/build"
4140

4241
app = Flask(__name__, static_folder=REL_STATIC_DIR)
43-
IS_FLASK_V1 = Version(flask_version) < Version("2.0")
42+
IS_FLASK_V1 = Version(importlib.metadata.version("flask")) < Version("2.0")
4443

4544

4645
for http_path, handler, methods in handlers.get_endpoints():

requirements/core-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
alembic<2,!=1.10.0
66
docker<7,>=4.0.0
7-
Flask<3
7+
Flask<4
88
numpy<2
99
scipy<2
1010
pandas<3

requirements/core-requirements.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ docker:
1717

1818
flask:
1919
pip_release: Flask
20-
max_major_version: 2
20+
max_major_version: 3
2121

2222
numpy:
2323
pip_release: numpy

0 commit comments

Comments
 (0)