From afeda299822ab6b7f835a79169973a074bb4289b Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 11 Jan 2024 12:00:14 -0300 Subject: [PATCH] Drop Python 3.6 and 3.7, add CI for 3.10+ Also revamped our CI to build the package once and test many times, and publish GitHub release on deploy. --- .github/workflows/deploy.yml | 28 ++++++++++++---------- .github/workflows/test.yml | 46 ++++++++++++++++++++++-------------- .pre-commit-config.yaml | 1 - CHANGELOG.rst | 2 ++ setup.py | 19 +++++++-------- tox.ini | 13 ++-------- 6 files changed, 56 insertions(+), 53 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0cb0da9..420a784 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,28 +7,32 @@ on: jobs: - deploy: + package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build and Check Package + uses: hynek/build-and-inspect-python-package@v1.5 + + deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + + - name: Download Package + uses: actions/download-artifact@v3 with: - python-version: "3.x" - - name: Install build - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: | - python -m build + name: Packages + path: dist + + - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@v1.8.11 with: user: __token__ password: ${{ secrets.pypi_token }} + - name: Publish GitHub Release uses: softprops/action-gh-release@v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3cff688..c2ca507 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,43 +2,53 @@ name: test on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + jobs: + + package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build and Check Package + uses: hynek/build-and-inspect-python-package@v1.5 + test: runs-on: ${{ matrix.os }} + needs: package + strategy: fail-fast: false matrix: - python: ["3.7", "3.8", "3.9"] + python: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, windows-latest] - include: - - python: "3.6" - os: ubuntu-20.04 - tox_env: "py36" - - python: "3.6" - os: windows-latest - tox_env: "py36" - - python: "3.7" - tox_env: "py37" - - python: "3.8" - tox_env: "py38" - - python: "3.9" - tox_env: "py39" - exclude: - - python: "3.6" - os: "windows-latest" steps: - uses: actions/checkout@v4 + + - name: Download Package + uses: actions/download-artifact@v3 + with: + name: Packages + path: dist + - name: Set up Python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} + - name: Install tox run: | python -m pip install --upgrade pip pip install tox + - name: Test + shell: bash run: | - tox -e ${{ matrix.tox_env }} + tox run -e ${{ matrix.tox_env }} --installpkg `find dist/*.tar.gz` diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d386003..b811ce6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,6 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - id: debug-statements - - id: flake8 - repo: https://github.com/asottile/reorder-python-imports rev: v3.12.0 hooks: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 35cd516..1cc3a2c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,8 @@ UNRELEASED ========== +* Dropped support for Python 3.6 and 3.7 (EOL). +* Added official support for Python 3.10, 3.11 and 3.12. * Test execution order using ``--replay`` now follows the recorded order, not the collection order, as was always intended (`#52`_). .. _`#52`: https://github.com/ESSS/pytest-replay/pull/53 diff --git a/setup.py b/setup.py index 2de12fe..313ec92 100644 --- a/setup.py +++ b/setup.py @@ -13,11 +13,8 @@ def read(fname): setup( name="pytest-replay", - version="0.0.0", - author="Bruno Oliveira", + author="ESSS", author_email="foss@esss.co", - maintainer="Bruno Oliveira", - maintainer_email="bruno@esss.com.br", license="MIT", url="https://github.com/ESSS/pytest-replay", description="Saves previous test runs and allow re-execute previous pytest runs " @@ -25,24 +22,24 @@ def read(fname): long_description=read("README.rst"), packages=find_packages(where="src"), package_dir={"": "src"}, - install_requires=["pytest>=3.0.0"], + install_requires=["pytest"], use_scm_version=True, setup_requires=[ - "setuptools_scm; python_version>'3.6'", - "setuptools_scm <7.0; python_version=='3.6'", + "setuptools_scm", ], - python_requires=">=3.6", + python_requires=">=3.8", classifiers=[ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Framework :: Pytest", "Intended Audience :: Developers", "Topic :: Software Development :: Testing", "Programming Language :: Python", "Programming Language :: Python :: 3", - "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", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Operating System :: OS Independent", "License :: OSI Approved :: MIT License", diff --git a/tox.ini b/tox.ini index a019ace..a2d6651 100644 --- a/tox.ini +++ b/tox.ini @@ -1,19 +1,10 @@ [tox] -envlist = py36,py37,py38,py39,linting +envlist = py38,py39,py310,py311,py312 [testenv] deps = pytest-xdist commands = pytest {posargs:tests} -[testenv:linting] -skip_install = True -basepython = python3.7 -deps = pre-commit>=1.11.0 -commands = pre-commit run --all-files --show-diff-on-failure - -[flake8] -max-line-length = 100 - [pytest] -addopts = -ra +addopts = -ra --color=yes