Skip to content

Commit

Permalink
Drop Python 3.6 and 3.7, add CI for 3.10+
Browse files Browse the repository at this point in the history
Also revamped our CI to build the package once and test many times, and publish GitHub release on deploy.
  • Loading branch information
nicoddemus committed Jan 11, 2024
1 parent 666aba3 commit afeda29
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 53 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,32 @@ on:

jobs:

deploy:
package:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build and Check Package
uses: hynek/[email protected]

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/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_token }}

- name: Publish GitHub Release
uses: softprops/action-gh-release@v1
with:
Expand Down
46 changes: 28 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]

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`
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 8 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,33 @@ def read(fname):

setup(
name="pytest-replay",
version="0.0.0",
author="Bruno Oliveira",
author="ESSS",
author_email="[email protected]",
maintainer="Bruno Oliveira",
maintainer_email="[email protected]",
license="MIT",
url="https://github.com/ESSS/pytest-replay",
description="Saves previous test runs and allow re-execute previous pytest runs "
"to reproduce crashes or flaky tests",
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",
Expand Down
13 changes: 2 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit afeda29

Please sign in to comment.