From fe433430c6a8415e5c5949efd9aaa60188332947 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Wed, 11 May 2022 08:21:48 +0000 Subject: [PATCH 1/5] add tests for newer Pythion versions --- .github/workflows/basic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index 16160b3..3aa6f8d 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.6, 3.7, 3.8, 3.9, '3.10'] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} From f5714fb8e08ba48bce50540fad6e55c368403928 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Wed, 11 May 2022 08:34:26 +0000 Subject: [PATCH 2/5] update packaging to use the non-deprecated setuptools_scm setup The versioning scheme shouldn't change, hopefully, with the new settings. --- pyproject.toml | 7 +++++++ setup.py | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a8f43fe..7c81c14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,9 @@ [tool.black] line-length = 79 + +[tool.setuptools_scm] +version_scheme = "post-release" + +[build-system] +requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 3e6f797..20c5a3d 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,6 @@ author_email="opensource@faculty.ai", license="Apache Software License", py_modules=["hiplot_mlflow"], - use_scm_version={"version_scheme": "post-release"}, setup_requires=["setuptools_scm"], install_requires=["hiplot", "mlflow", "numpy"], extras_require={ From 3df66c4dc4223f66e805e7cf2a1fbe161ce005f8 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Wed, 11 May 2022 08:43:09 +0000 Subject: [PATCH 3/5] changes made by black --- hiplot_mlflow.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hiplot_mlflow.py b/hiplot_mlflow.py index b06f475..2d73528 100644 --- a/hiplot_mlflow.py +++ b/hiplot_mlflow.py @@ -101,8 +101,7 @@ def fetch_by_uri(uri: str) -> hiplot.Experiment: def _get_experiment_id_from_name(name: str) -> Any: - """Get an MLflow experiment's ID from its name - """ + """Get an MLflow experiment's ID from its name""" client = tracking.MlflowClient() experiment = client.get_experiment_by_name(name) if experiment is None: @@ -147,7 +146,8 @@ def _create_experiment_from_dataframe( values[t] = row[t] dp = hiplot.Datapoint( - uid=str(uuid.UUID(row["run_id"])), values=values, + uid=str(uuid.UUID(row["run_id"])), + values=values, ) exp.datapoints.append(dp) return exp From a7b93c537b9fb50c70903c9f9005e65580293ceb Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Wed, 11 May 2022 08:54:09 +0000 Subject: [PATCH 4/5] more black setup for repeatability and fixing formatting --- setup.py | 9 ++++++++- tests/test_basic.py | 6 ++---- tox.ini | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 20c5a3d..3b4efa1 100644 --- a/setup.py +++ b/setup.py @@ -30,6 +30,13 @@ setup_requires=["setuptools_scm"], install_requires=["hiplot", "mlflow", "numpy"], extras_require={ - "dev": ["black", "flake8", "flake8-black", "mypy", "pytest", "tox"] + "dev": [ + "black==22.3.0", + "flake8", + "flake8-black", + "mypy", + "pytest", + "tox", + ] }, ) diff --git a/tests/test_basic.py b/tests/test_basic.py index aaff0e5..9a9ebb9 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -77,15 +77,13 @@ def test_wrong_schema(): - """Test passing unsupported schema. - """ + """Test passing unsupported schema.""" with pytest.raises(hiplot.ExperimentFetcherDoesntApply): hiplot_mlflow.fetch_by_uri("something://") def test_unsupported_reference_type(): - """Test passing correct schema and unsupported reference type. - """ + """Test passing correct schema and unsupported reference type.""" with pytest.raises(hiplot.ExperimentValidationError): hiplot_mlflow.fetch_by_uri(f"mlflow://something/else") diff --git a/tox.ini b/tox.ini index 9113822..73a02ff 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ commands = [testenv:black] skip_install = True deps = - black + black==22.3.0 commands = black {posargs:--check setup.py hiplot_mlflow.py tests} From 68a7c01304f0587c515f2dabc4c879ef01f15be6 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Wed, 11 May 2022 08:57:23 +0000 Subject: [PATCH 5/5] linting changes --- tests/test_basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_basic.py b/tests/test_basic.py index 9a9ebb9..a7c69d3 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -85,7 +85,7 @@ def test_wrong_schema(): def test_unsupported_reference_type(): """Test passing correct schema and unsupported reference type.""" with pytest.raises(hiplot.ExperimentValidationError): - hiplot_mlflow.fetch_by_uri(f"mlflow://something/else") + hiplot_mlflow.fetch_by_uri("mlflow://something/else") @pytest.mark.parametrize(