From 737110ff1cd073c7bb68026339b9f46493faf87d Mon Sep 17 00:00:00 2001 From: Thomas Lazarus Date: Sun, 28 Apr 2024 16:08:49 -0500 Subject: [PATCH 1/5] Removes Python 3.8 support --- .github/workflows/build-test.yml | 148 +++++++++++++++---------------- setup.py | 3 +- 2 files changed, 73 insertions(+), 78 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 206f067c..ebba9b62 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -10,18 +10,15 @@ concurrency: jobs: pytest: - runs-on: ${{ matrix.os }} if: "github.repository == 'skops-dev/skops'" strategy: - fail-fast: false # need to see which ones fail + fail-fast: false # need to see which ones fail matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python: ["3.8", "3.9", "3.10", "3.11"] + python: ["3.9", "3.10", "3.11"] # this is to make the CI run on different sklearn versions include: - - python: "3.8" - sklearn_version: "1.0" - python: "3.9" sklearn_version: "1.1" - python: "3.10" @@ -33,74 +30,73 @@ jobs: timeout-minutes: 15 steps: - - # The following two steps are workarounds to retrieve the "real" commit - # message and make it available in later steps. This is because we want to - # check the content of the commit message, but on PRs, it's replaced by an - # artificial commit message. See https://github.com/skops-dev/skops/pull/147 - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{github.event.after}} - - - run: | - echo PR_COMMIT_MESSAGE=$(git log -1 --pretty=format:\"%s\") >> $GITHUB_ENV - shell: bash - - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - - - name: Install dependencies - run: | - pip install "pytest<8" - pip install .[docs,tests] - pip install black=="23.9.1" ruff=="0.0.292" mypy=="1.6.0" - pip uninstall --yes scikit-learn - if [ ${{ matrix.sklearn_version }} == "nightly" ]; - then pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple scikit-learn; - else pip install "scikit-learn~=${{ matrix.sklearn_version }}"; - fi - if [ ${{ matrix.os }} == "ubuntu-latest" ]; - then sudo apt install pandoc && pandoc --version; - fi - python --version - pip --version - pip list - shell: bash - - - name: Check black - run: black --check --diff . - - - name: Check ruff - run: ruff check --diff . - - - name: Tests - env: - SUPER_SECRET: ${{ secrets.HF_HUB_TOKEN }} - PYTHONIOENCODING: "utf-8" - run: | - python -m pytest -s -v --cov-report=xml -m "not inference" skops/ - - - name: Mypy - run: mypy --config-file pyproject.toml skops - - - name: Inference tests (conditional) - if: contains(env.PR_COMMIT_MESSAGE, '[CI inference]') - run: | - python -m pytest -s -v -m "inference" skops/ - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - env_vars: OS,PYTHON - fail_ci_if_error: true - files: ./coverage.xml - flags: unittests - name: codecov-umbrella - verbose: true - # the coverage is uploaded with or without a token. This only helps with some - # codecov errors. It's a recommended action from here: - # https://github.com/codecov/codecov-action/issues/837#issuecomment-1453877750 - token: 79395387-e193-4b18-b2ee-74a3b8dce269 + # The following two steps are workarounds to retrieve the "real" commit + # message and make it available in later steps. This is because we want to + # check the content of the commit message, but on PRs, it's replaced by an + # artificial commit message. See https://github.com/skops-dev/skops/pull/147 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{github.event.after}} + + - run: | + echo PR_COMMIT_MESSAGE=$(git log -1 --pretty=format:\"%s\") >> $GITHUB_ENV + shell: bash + + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Install dependencies + run: | + pip install "pytest<8" + pip install .[docs,tests] + pip install black=="23.9.1" ruff=="0.0.292" mypy=="1.6.0" + pip uninstall --yes scikit-learn + if [ ${{ matrix.sklearn_version }} == "nightly" ]; + then pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple scikit-learn; + else pip install "scikit-learn~=${{ matrix.sklearn_version }}"; + fi + if [ ${{ matrix.os }} == "ubuntu-latest" ]; + then sudo apt install pandoc && pandoc --version; + fi + python --version + pip --version + pip list + shell: bash + + - name: Check black + run: black --check --diff . + + - name: Check ruff + run: ruff check --diff . + + - name: Tests + env: + SUPER_SECRET: ${{ secrets.HF_HUB_TOKEN }} + PYTHONIOENCODING: "utf-8" + run: | + python -m pytest -s -v --cov-report=xml -m "not inference" skops/ + + - name: Mypy + run: mypy --config-file pyproject.toml skops + + - name: Inference tests (conditional) + if: contains(env.PR_COMMIT_MESSAGE, '[CI inference]') + run: | + python -m pytest -s -v -m "inference" skops/ + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + env_vars: OS,PYTHON + fail_ci_if_error: true + files: ./coverage.xml + flags: unittests + name: codecov-umbrella + verbose: true + # the coverage is uploaded with or without a token. This only helps with some + # codecov errors. It's a recommended action from here: + # https://github.com/codecov/codecov-action/issues/837#issuecomment-1453877750 + token: 79395387-e193-4b18-b2ee-74a3b8dce269 diff --git a/setup.py b/setup.py index db4d3d85..002dc743 100644 --- a/setup.py +++ b/setup.py @@ -67,13 +67,12 @@ def setup_package(): "Operating System :: Unix", "Operating System :: MacOS", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", ], - python_requires=">=3.8", + python_requires=">=3.9", install_requires=min_deps.tag_to_packages["install"], extras_require={ "docs": min_deps.tag_to_packages["docs"], From 9794b3b271cfaea4eb805b9a23caf825f2b1dbd5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:21:18 +0200 Subject: [PATCH 2/5] Bump pypa/gh-action-pypi-publish from 1.8.12 to 1.8.14 (#416) Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.12 to 1.8.14. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.12...v1.8.14) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/publish-pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 7f618af2..52e1e958 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -39,11 +39,11 @@ jobs: python -m build - name: Publish package to TestPyPI - uses: pypa/gh-action-pypi-publish@v1.8.12 + uses: pypa/gh-action-pypi-publish@v1.8.14 with: repository-url: https://test.pypi.org/legacy/ if: ${{ github.event.inputs.pypi_repo == 'testpypi' }} - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@v1.8.12 + uses: pypa/gh-action-pypi-publish@v1.8.14 if: ${{ github.event.inputs.pypi_repo == 'pypi' }} From f67d93a1ef055b5a1be1ebfccba114abf34c551d Mon Sep 17 00:00:00 2001 From: Thomas Lazarus Date: Tue, 30 Apr 2024 19:48:27 -0500 Subject: [PATCH 3/5] Adds support for python 3.12 --- .github/workflows/build-test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index ebba9b62..714dbb98 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false # need to see which ones fail matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python: ["3.9", "3.10", "3.11"] + python: ["3.9", "3.10", "3.11", "3.12"] # this is to make the CI run on different sklearn versions include: - python: "3.9" @@ -24,6 +24,8 @@ jobs: - python: "3.10" sklearn_version: "1.2" - python: "3.11" + sklearn_version: "1.4" + - python: "3.12" sklearn_version: "nightly" # Timeout: https://stackoverflow.com/a/59076067/4521646 From a09685612e0b38baa724845b95e6d313d8dc8379 Mon Sep 17 00:00:00 2001 From: Thomas Lazarus Date: Tue, 30 Apr 2024 19:49:59 -0500 Subject: [PATCH 4/5] Pins Macos version to see if this works --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 714dbb98..8bc21b89 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false # need to see which ones fail matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-12] python: ["3.9", "3.10", "3.11", "3.12"] # this is to make the CI run on different sklearn versions include: From 9a563c5565287b3d8d292430d741626ce16bbe39 Mon Sep 17 00:00:00 2001 From: Thomas Lazarus <46943923+lazarust@users.noreply.github.com> Date: Thu, 2 May 2024 08:08:25 -0500 Subject: [PATCH 5/5] Update setup.py to include Python 3.12 Co-authored-by: Adrin Jalali --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 002dc743..52d61eef 100644 --- a/setup.py +++ b/setup.py @@ -70,6 +70,7 @@ def setup_package(): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", ], python_requires=">=3.9",