From 43c5c0f2310ea7171a843fc1b9054f8d5edec515 Mon Sep 17 00:00:00 2001 From: Maxime Liquet <35924738+maximlt@users.noreply.github.com> Date: Mon, 12 Jun 2023 18:47:03 +0200 Subject: [PATCH] Drop Python 2.7 and 3.6 and add 3.11 (#110) * drop 2.7 and 3.6, add 3.11 * update tox config and python_requires * limit number of python versions tested on GH actions --- .github/workflows/test.yaml | 146 ++---------------------------------- README.md | 2 +- setup.py | 5 +- tox.ini | 2 +- 4 files changed, 10 insertions(+), 145 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c298d56..d774d47 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,6 +11,10 @@ on: schedule: - cron: '0 9 * * SUN' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: test_suite: name: Pytest on ${{ matrix.python-version }}, ${{ matrix.os }} @@ -19,7 +23,8 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.7', '3.8', '3.9', '3.10'] + # Run on the full set on schedule, workflow_dispatch and push&tags events, otherwise on a subset. + python-version: ${{ ( github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'push' && github.ref_type == 'tag' ) ) && fromJSON('["3.7", "3.8", "3.9", "3.10", "3.11"]') || fromJSON('["3.7", "3.11"]') }} timeout-minutes: 60 defaults: run: @@ -50,11 +55,6 @@ jobs: run: | conda activate ${{ env.ENV_NAME }} doit develop_install -o tests -o examples - - name: Panel 3.6 - if: matrix.python-version == '3.6' - run: | - conda activate ${{ env.ENV_NAME }} - conda install "panel=0.12.6" - name: doit env_capture run: | conda activate ${{ env.ENV_NAME }} @@ -78,137 +78,3 @@ jobs: doit test_unit_extra - uses: codecov/codecov-action@v3 if: github.event_name == 'push' - - test_suite_36: - name: Pytest on ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ['ubuntu-latest', 'macos-latest'] - python-version: ['3.6'] - timeout-minutes: 60 - defaults: - run: - shell: bash -l {0} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ENV_NAME: "colorcet" - MPLBACKEND: "Agg" - DISPLAY: ":99.0" - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: "100" - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - - name: Fetch - run: git fetch --prune --tags -f - - name: conda setup - run: | - conda update -n base conda - conda install -n base -c conda-forge "mamba>=0.23" --no-update-deps - conda create -n ${{ env.ENV_NAME }} - conda activate ${{ env.ENV_NAME }} - conda config --env --prepend channels pyviz - conda config --env --show-sources - conda install python=${{ matrix.python-version }} pyctdev - - name: doit develop_install - run: | - conda activate ${{ env.ENV_NAME }} - doit develop_install -o tests -o examples --conda-mode=mamba - - name: doit env_capture - run: | - conda activate ${{ env.ENV_NAME }} - doit env_capture - - name: doit test_lint - run: | - conda activate ${{ env.ENV_NAME }} - doit test_lint - - name: doit test_unit - run: | - conda activate ${{ env.ENV_NAME }} - doit test_unit - - name: doit test_examples - run: | - conda activate ${{ env.ENV_NAME }} - doit test_examples - - name: doit test_unit_extra - run: | - conda activate ${{ env.ENV_NAME }} - pip install pytest-mpl - doit test_unit_extra - - uses: codecov/codecov-action@v3 - if: github.event_name == 'push' - - test_suite_py27: - name: Pytest on Python 2.7 only - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ['ubuntu-latest'] - python-version: [2.7] - timeout-minutes: 60 - defaults: - run: - shell: bash -l {0} - env: - HV_REQUIREMENTS: "tests" - CHANS: "-c pyviz -c bokeh" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ENV_NAME: "colorcet" - MPLBACKEND: "Agg" - DISPLAY: ":99.0" - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: "100" - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: "latest" - python-version: ${{ matrix.python-version }} - - name: conda setup - run: | - conda config --set always_yes True - conda --version - conda install -c pyviz "pyctdev>=0.5" - doit ecosystem_setup - doit env_create --name=${{ env.ENV_NAME }} --python=${{ matrix.python-version }} - - name: doit develop_install - run: | - eval "$(conda shell.bash hook)" - conda activate ${{ env.ENV_NAME }} - doit develop_install ${{ env.CHANS}} -o ${{ env.HV_REQUIREMENTS }} - - name: doit env_capture - run: | - eval "$(conda shell.bash hook)" - conda activate ${{ env.ENV_NAME }} - doit env_capture - - name: Handling backports on 'ubuntu-latest' and the decorator package - if: matrix.os == 'ubuntu-latest' - run: | - eval "$(conda shell.bash hook)" - conda activate ${{ env.ENV_NAME }} - conda install ${{ env.CHANS}} backports.functools_lru_cache 'decorator=4.4.2' - - name: doit env_capture again - run: | - eval "$(conda shell.bash hook)" - conda activate ${{ env.ENV_NAME }} - doit env_capture - - name: doit test_unit - if: matrix.os == 'ubuntu-latest' - run: | - eval "$(conda shell.bash hook)" - conda activate ${{ env.ENV_NAME }} - doit test_unit - - name: doit test_unit - if: matrix.os == 'macos-latest' - run: | - eval "$(conda shell.bash hook)" - conda activate ${{ env.ENV_NAME }} - pytest colorcet diff --git a/README.md b/README.md index 8c0518b..535e0e5 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ by Peter Kovesi at the Center for Exploration Targeting. ## Installation -Colorcet supports Python 2.7, 3.6, 3.7, 3.8, 3.9 and 3.10 on Linux, Windows, or Mac +Colorcet supports Python 3.7, 3.8, 3.9, 3.10 and 3.11 on Linux, Windows, or Mac and can be installed with conda: ```sh diff --git a/setup.py b/setup.py index 64c4737..b025bed 100644 --- a/setup.py +++ b/setup.py @@ -78,12 +78,11 @@ def get_setup_version(reponame): "License :: OSI Approved", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.6", "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", "Development Status :: 5 - Production/Stable", ], author="James A. Bednar", @@ -98,7 +97,7 @@ def get_setup_version(reponame): }, include_package_data=True, packages=find_packages(), - python_requires=">=2.7", + python_requires=">=3.7", install_requires=install_requires, extras_require=extras_require, entry_points={ diff --git a/tox.ini b/tox.ini index 230d06b..981fd67 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ # For use with pyctdev (but should work with tox alone) [tox] -envlist = {py27,py36,py37,py38,py39,py310}-{lint,unit,unit_extra,examples,all}-{default}-{dev,pkg} +envlist = {py37,py38,py39,py310,py311}-{lint,unit,unit_extra,examples,all}-{default}-{dev,pkg} build = wheel [_lint]