Skip to content

Commit

Permalink
feat: Pin Python dependencies (#25)
Browse files Browse the repository at this point in the history
* Move notebook dependencies to `requirements.in` files
* Compile dependencies into `requirements.txt` files using the root-level tox `update-requirements` action
* Install dependencies from the corresponding `requirements.txt` before running each notebook

Closes #24

Signed-off-by: Phoevos Kalemkeris <[email protected]>
  • Loading branch information
phoevos authored Sep 19, 2023
1 parent 6b65652 commit c376579
Show file tree
Hide file tree
Showing 28 changed files with 1,313 additions and 27 deletions.
6 changes: 3 additions & 3 deletions requirements-fmt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile ./requirements-fmt.in
# pip-compile requirements-fmt.in
#
black==23.7.0
# via -r ./requirements-fmt.in
# via -r requirements-fmt.in
click==8.1.6
# via black
isort==5.12.0
# via -r ./requirements-fmt.in
# via -r requirements-fmt.in
mypy-extensions==1.0.0
# via black
packaging==23.1
Expand Down
18 changes: 9 additions & 9 deletions requirements-lint.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile ./requirements-lint.in
# pip-compile requirements-lint.in
#
black==23.7.0
# via -r ./requirements-lint.in
# via -r requirements-lint.in
click==8.1.6
# via black
codespell==2.2.5
# via -r ./requirements-lint.in
# via -r requirements-lint.in
flake8==6.0.0
# via
# -r ./requirements-lint.in
# -r requirements-lint.in
# flake8-builtins
# pep8-naming
# pyproject-flake8
flake8-builtins==2.1.0
# via -r ./requirements-lint.in
# via -r requirements-lint.in
flake8-copyright==0.2.4
# via -r ./requirements-lint.in
# via -r requirements-lint.in
isort==5.12.0
# via -r ./requirements-lint.in
# via -r requirements-lint.in
mccabe==0.7.0
# via flake8
mypy-extensions==1.0.0
Expand All @@ -31,15 +31,15 @@ packaging==23.1
pathspec==0.11.2
# via black
pep8-naming==0.13.3
# via -r ./requirements-lint.in
# via -r requirements-lint.in
platformdirs==3.10.0
# via black
pycodestyle==2.10.0
# via flake8
pyflakes==3.0.1
# via flake8
pyproject-flake8==6.0.0.post1
# via -r ./requirements-lint.in
# via -r requirements-lint.in
tomli==2.0.1
# via
# black
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile ./requirements.in
# pip-compile requirements.in
#
anyio==3.7.1
# via httpcore
Expand Down Expand Up @@ -63,14 +63,14 @@ jinja2==3.1.2
# via pytest-operator
juju==2.9.44.0
# via
# -r ./requirements.in
# -r requirements.in
# pytest-operator
jujubundlelib==0.5.7
# via theblues
kubernetes==27.2.0
# via juju
lightkube==0.14.0
# via -r ./requirements.in
# via -r requirements.in
lightkube-models==1.27.1.4
# via lightkube
macaroonbakery==1.3.1
Expand Down Expand Up @@ -131,13 +131,13 @@ pyrfc3339==1.1
# macaroonbakery
pytest==7.4.0
# via
# -r ./requirements.in
# -r requirements.in
# pytest-asyncio
# pytest-operator
pytest-asyncio==0.21.1
# via pytest-operator
pytest-operator==0.28.0
# via -r ./requirements.in
# via -r requirements.in
python-dateutil==2.8.2
# via kubernetes
pytz==2023.3
Expand Down Expand Up @@ -176,7 +176,7 @@ sniffio==1.3.0
stack-data==0.6.2
# via ipython
tenacity==8.2.2
# via -r ./requirements.in
# via -r requirements.in
theblues==0.5.2
# via juju
tomli==2.0.1
Expand Down
8 changes: 7 additions & 1 deletion tests/notebooks/e2e-wine/e2e-wine-kfp-mlflow-seldon.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@
"execution_count": null,
"id": "6e34b594",
"metadata": {
"tags": []
"tags": [
"pytest-skip"
]
},
"outputs": [],
"source": [
"# pin kfp to the latest <2.0 version to ensure compatibility\n",
"# with the KFP API server version deployed in CKF 1.7\n",
"# pin the mlflow client to match the version of the deployed MLflow server\n",
"# pin scikit-learn to ensure compatibility with the installed mlflow client\n",
"!pip install boto3 kfp==1.8.22 minio mlflow==2.1.1 numpy pyarrow requests \"scikit-learn<1.2\" tenacity -q"
]
},
Expand Down
13 changes: 13 additions & 0 deletions tests/notebooks/e2e-wine/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
boto3
# pin to the latest <2.0 version to ensure compatibility
# with the KFP API server version deployed in CKF 1.7
kfp==1.8.22
minio
# pin the client to match the version of the deployed MLflow server
mlflow==2.1.1
numpy
pyarrow
requests
# pin to ensure compatibility with the installed mlflow client
scikit-learn<1.2
tenacity
Loading

0 comments on commit c376579

Please sign in to comment.