diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e636ef..66f15d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,13 +13,17 @@ on: jobs: run-test: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - name: Check out repository - uses: actions/checkout@v2 - - name: Set up python - uses: actions/setup-python@v2 + uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip @@ -28,14 +32,16 @@ jobs: pip install -r requirements-dev.txt - name: Run tests run: | - scripts/test.sh + set -o pipefail + scripts/test.sh | tee ./pytest-coverage.txt - name: my-artifact - if: always() + if: always() && !env.ACT uses: actions/upload-artifact@v3 with: name: pytest-coverage path: pytest-coverage.txt - name: Pytest coverage comment + if: always() && !env.ACT uses: MishaKav/pytest-coverage-comment@main with: pytest-coverage-path: ./pytest-coverage.txt diff --git a/connect/_version.py b/connect/_version.py index f7972ce..eba77d7 100644 --- a/connect/_version.py +++ b/connect/_version.py @@ -2,4 +2,4 @@ # 1) we don't load dependencies by storing it in __init__.py # 2) we can import it in setup.py for the same reason # 3) we can import it into your module module -__version__ = "0.1.1" +__version__ = "0.1.2" diff --git a/connect/evidence/evidence.py b/connect/evidence/evidence.py index b8dd48a..a810172 100644 --- a/connect/evidence/evidence.py +++ b/connect/evidence/evidence.py @@ -194,7 +194,7 @@ def __init__( def data(self): columns = [ {"value": k, "type": self._transform_type(v)} - for k, v in self._data.dtypes.iteritems() + for k, v in self._data.dtypes.items() ] return { "columns": columns, diff --git a/connect/evidence/lens_evidence/containers.py b/connect/evidence/lens_evidence/containers.py index 5aa680f..8edf28c 100644 --- a/connect/evidence/lens_evidence/containers.py +++ b/connect/evidence/lens_evidence/containers.py @@ -4,9 +4,9 @@ from connect.utils import Scrubber, ValidationError from .evidence import DataProfilerEvidence, ModelProfilerEvidence -from .utils import get_pandas_profile_type +from .utils import get_ydata_profile_type -PandasProfileType = get_pandas_profile_type() +ydataProfileType = get_ydata_profile_type() class DataProfilerContainer(EvidenceContainer): @@ -30,9 +30,9 @@ def _validate(self, data): pass def _validate_inputs(self, data): - if not isinstance(data, PandasProfileType): + if not isinstance(data, ydataProfileType): raise ValidationError( - "'data' must be a pandas_profiling.profile_report.ProfileReport" + "'data' must be a ydata_profiling.profile_report.ProfileReport" ) diff --git a/connect/evidence/lens_evidence/utils.py b/connect/evidence/lens_evidence/utils.py index d90cf5a..ea00188 100644 --- a/connect/evidence/lens_evidence/utils.py +++ b/connect/evidence/lens_evidence/utils.py @@ -2,17 +2,17 @@ from typing import TYPE_CHECKING, TypeVar -def get_pandas_profile_type(): - """check if deepchecks is imported. If not, define object for type checking""" +def get_ydata_profile_type(): + """check if ydata profiling is imported. If not, define object for type checking""" if TYPE_CHECKING: try: - from pandas_profiling import ProfileReport + from ydata_profiling import ProfileReport - pandas_profile_type = ProfileReport + ydata_profiling = ProfileReport except ImportError: - pandas_profile_type = TypeVar("Profilereport") + ydata_profiling = TypeVar("ProfileReport") else: - from pandas_profiling import ProfileReport + from ydata_profiling import ProfileReport - pandas_profile_type = ProfileReport - return pandas_profile_type + ydata_profiling = ProfileReport + return ydata_profiling diff --git a/requirements.txt b/requirements.txt index d47e1ef..d3839c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ json-api-doc>=0.15.0 python-dotenv>=0.19.2 -numpy >= 1.22.0 -pandas >= 1.4.1 +numpy >= 1.21.6 +pandas >= 1.3.5 diff --git a/setup.py b/setup.py index 494c22b..8470b31 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ LICENSE = "" DOWNLOAD_URL = "https://github.com/credo-ai/credoai_connect" VERSION = __version__ -PYTHON_REQUIRES = ">=3.8" +PYTHON_REQUIRES = ">=3.7" # Fetch ReadMe with open("README.md", "r") as fh: @@ -36,9 +36,11 @@ CLASSIFIERS = [ "Intended Audience :: Information Technology", - "Intended Audience :: Science/Research", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Operating System :: OS Independent", ] @@ -47,7 +49,6 @@ if __name__ == "__main__": - import sys from setuptools import setup diff --git a/tests/governance/test_governance.py b/tests/governance/test_governance.py index 5ea17a9..7f553f5 100644 --- a/tests/governance/test_governance.py +++ b/tests/governance/test_governance.py @@ -136,7 +136,6 @@ def test_register_with_use_case_name_and_policy_pack_key_not_exist(self, gov, ap assert False == gov.registered def test_register_with_assessment_plan(self, gov): - gov.register(assessment_plan=ASSESSMENT_PLAN_JSON_STR) assert USE_CASE_ID == gov._use_case_id @@ -148,7 +147,6 @@ def test_register_with_assessment_plan(self, gov): assert {"metric_type": "accuracy_score"} == req.label def test_register_with_assessment_plan_file(self, gov, plan_file_mock): - gov.register(assessment_plan_file="filename") assert USE_CASE_ID == gov._use_case_id