Skip to content

Commit

Permalink
Merge pull request #11 from nederlandsespoorwegen/bump/versions
Browse files Browse the repository at this point in the history
Allow python versions higher than 3.10
  • Loading branch information
wradstok authored Feb 29, 2024
2 parents 3a3cc79 + ad38beb commit d3ff538
Show file tree
Hide file tree
Showing 8 changed files with 1,413 additions and 1,517 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: Gr1N/setup-poetry@v8
python-version: "3.10"
- uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.3.1"
poetry-version: "1.7.1"
- run: poetry install
- run: poetry build --format wheel
- uses: ncipollo/release-action@v1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: Gr1N/setup-poetry@v8
python-version: "3.10"
- uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.3.1"
poetry-version: "1.7.1"
- run: poetry install
- run: poetry run black --check .
- run: poetry run pylint --fail-under=9 */
Expand Down
10 changes: 6 additions & 4 deletions environment_mlflow_client/env_mlflow_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""mlflow client that is aware of the application environment. The main target is Databricks mlflow within one workspace."""

import os
from collections import defaultdict
from typing import Any, Dict, List, Optional, Tuple
Expand Down Expand Up @@ -29,8 +30,9 @@ def __init__(
):
"""
Create an EnvMlflowClient instance scoped for one logical environment.
The environment is set by the environment variable MLFLOW_ENV or by passing the env_name argument.
note: On Databricks we do not provide the arguments and rely on environment variables.
The environment is set by the environment variable MLFLOW_ENV or by
passing the env_name argument. note: On Databricks we do not provide the
arguments and rely on environment variables.
Args:
env_name: environment name overrides the environment variable MLFLOW_ENV
Expand Down Expand Up @@ -131,7 +133,7 @@ def create_model_version(
tags: Tags to set on the model
run_link: Link to the run that created the model
description: Description of the model
await_creation_for: Number of seconds to wait for the model version to finish being created.
await_creation_for: # seconds to wait for the model version to finish being created.
Returns:
mlflow ModelVersion
"""
Expand Down Expand Up @@ -253,7 +255,7 @@ def log_model_helper(
kwargs: parameters for model_flavor.log_model, see documentation of model_flavor
i.e. mlflow.sklearn.log_model
Returns:
Tuple of a mlflow.entities.model_registry.ModelVersion object and mlflow.models.model.ModelInfo object.
Mlflow ModelVersion and ModelInfo
"""
if "artifact_path" in kwargs:
Expand Down
2,893 changes: 1,393 additions & 1,500 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ packages = [{include = "environment_mlflow_client"}]
homepage = "https://github.com/nederlandsespoorwegen/environment_mlflow_client"

[tool.poetry.dependencies]
python = "^3.9,<3.11"
python = "^3.10"
mlflow = "^2.1.0"

[tool.poetry.group.dev.dependencies]
psutil = "^5.9.4"
pytest = "^7.2.0"
black = "^23.1.0"
pylint = "^2.15.9"
llvmlite = "==0.38.0" # Databricks runtime 12.1
numba = "==0.55.1" # Databricks runtime 12.1
llvmlite = "==0.39.1" # Databricks runtime 14.3
numba = "==0.56.4" # Databricks runtime 14.3
coverage = "*"
pytest-cov = "*"

Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
session wide MLFlow instance fixture
"""

import os
import subprocess
import tempfile
Expand Down
2 changes: 1 addition & 1 deletion tests/test_custom_model_with_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class FakeModel(mlflow.pyfunc.PythonModel):
"""Fake model to log"""

def predict(self, context, model_input):
def predict(self, context, model_input): # pylint: disable=unused-argument
return None


Expand Down
2 changes: 1 addition & 1 deletion tests/test_env_mlflow_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class FakeModel(mlflow.pyfunc.PythonModel):
"""Fake model to log"""

def predict(self, context, model_input):
def predict(self, context, model_input): # pylint: disable=unused-argument
return None


Expand Down

0 comments on commit d3ff538

Please sign in to comment.