diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index fcb3832..1e6f95f 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -5,13 +5,12 @@ name: Python package on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] jobs: build: - runs-on: ubuntu-latest strategy: fail-fast: false @@ -19,30 +18,30 @@ jobs: python-version: ["3.10"] steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install . - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - env: - USERNAME: ${{ secrets.USERNAME }} - APIKEY: ${{ secrets.APIKEY }} - URL: ${{ secrets.URL }} - INSTANCE_ID: ${{ secrets.INSTANCE_ID }} - VERSION: ${{ secrets.VERSION }} - DEPLOYMENT_SPACE_NAME: ${{ secrets.DEPLOYMENT_SPACE_NAME }} - run: | - pytest + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install . + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --ignore=F821 --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + env: + USERNAME: ${{ secrets.USERNAME }} + APIKEY: ${{ secrets.APIKEY }} + URL: ${{ secrets.URL }} + INSTANCE_ID: ${{ secrets.INSTANCE_ID }} + VERSION: ${{ secrets.VERSION }} + DEPLOYMENT_SPACE_NAME: ${{ secrets.DEPLOYMENT_SPACE_NAME }} + run: | + pytest diff --git a/.gitignore b/.gitignore index 6aa9340..773a139 100644 --- a/.gitignore +++ b/.gitignore @@ -133,5 +133,4 @@ mlruns/ # playground file playground.py -_version.py .DS_Store diff --git a/mlflow_watsonml/_version.py b/mlflow_watsonml/_version.py new file mode 100644 index 0000000..fee46bd --- /dev/null +++ b/mlflow_watsonml/_version.py @@ -0,0 +1 @@ +__version__ = "0.11.1" diff --git a/requirements.txt b/requirements.txt index 56d749f..ed2b8d8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -ibm_watson_machine_learning~=1.0.327 -mlflow~=2.8.0 +ibm_watson_machine_learning==1.0.327 +mlflow>=2.6.0 python-dotenv~=1.0.0 boto3>=1.24.59 \ No newline at end of file diff --git a/setup.py b/setup.py index 95e5378..7d0fd03 100644 --- a/setup.py +++ b/setup.py @@ -7,8 +7,11 @@ with open("requirements.txt", "r") as fh: install_requires = fh.readlines() +exec(open("mlflow_watsonml/_version.py").read()) + setup( name="mlflow-watsonml", + version=__version__, # type: ignore description="WatsonML MLflow deployment plugin", long_description=long_description, long_description_content_type="text/markdown", @@ -24,6 +27,6 @@ }, entry_points={"mlflow.deployments": "watsonml=mlflow_watsonml.deploy"}, python_requires=">=3.9", - use_scm_version=True, - setup_requires=["setuptools_scm"], + # use_scm_version=True, + # setup_requires=["setuptools_scm"], )