diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..0308ccd --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,39 @@ +name: deploy + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +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 + + deploy: + runs-on: ubuntu-latest + + needs: package + + steps: + - name: Download Package + uses: actions/download-artifact@v3 + with: + 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: + files: dist/* diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 544da87..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: build - -on: [push, pull_request] - -jobs: - build: - - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - python: ["3.7", "3.8", "3.9"] - 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@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - name: Install tox - run: | - python -m pip install --upgrade pip - pip install tox - - name: Test - run: | - tox -e ${{ matrix.tox_env }} - - deploy: - - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - - runs-on: ubuntu-latest - - needs: build - - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: "3.7" - - name: Install wheel - run: | - python -m pip install --upgrade pip - pip install wheel - - name: Build package - run: | - python setup.py sdist bdist_wheel - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_token }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b831cc4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,60 @@ +name: test + +on: + push: + branches: + - "master" + - "test-me-*" + + 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.8", "3.9", "3.10", "3.11", "3.12"] + os: [ubuntu-latest, 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 run -e py --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..9b4e4b3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,8 @@ -UNRELEASED -========== +1.5.1 (2024-01-11) +================== +* 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/README.rst b/README.rst index 0725ac6..b1cf708 100644 --- a/README.rst +++ b/README.rst @@ -9,8 +9,8 @@ pytest-replay .. image:: https://anaconda.org/conda-forge/pytest-replay/badges/version.svg :target: https://anaconda.org/conda-forge/pytest-replay -.. image:: https://github.com/ESSS/pytest-replay/workflows/build/badge.svg - :target: https://github.com/ESSS/pytest-replay/actions?query=workflow%3Abuild +.. image:: https://github.com/ESSS/pytest-replay/workflows/test/badge.svg + :target: https://github.com/ESSS/pytest-replay/actions?query=workflow%3Atest .. image:: https://img.shields.io/pypi/pyversions/pytest-replay.svg :target: https://pypi.python.org/pypi/pytest-replay diff --git a/setup.py b/setup.py index 2de12fe..ed6e0cd 100644 --- a/setup.py +++ b/setup.py @@ -13,36 +13,34 @@ 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 " "to reproduce crashes or flaky tests", long_description=read("README.rst"), + long_description_content_type="text/x-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/src/pytest_replay/__init__.py b/src/pytest_replay/__init__.py index cf6c371..93e4638 100644 --- a/src/pytest_replay/__init__.py +++ b/src/pytest_replay/__init__.py @@ -104,7 +104,7 @@ def pytest_collection_modifyitems(self, items, config): if not replay_file: return - with open(replay_file, "r", encoding="UTF-8") as f: + with open(replay_file, encoding="UTF-8") as f: all_lines = f.readlines() # Use a dict to deduplicate the node ids while keeping the order. nodeids = dict.fromkeys( diff --git a/tests/test_replay.py b/tests/test_replay.py index cebc6d2..6bb18b2 100644 --- a/tests/test_replay.py +++ b/tests/test_replay.py @@ -160,7 +160,7 @@ def test_alternate_serial_parallel_does_not_erase_runs(suite, testdir, reverse): for command_line in command_lines: result = testdir.runpytest_subprocess(*command_line) assert result.ret == 0 - assert set(x.basename for x in (testdir.tmpdir / "replay").listdir()) == { + assert {x.basename for x in (testdir.tmpdir / "replay").listdir()} == { ".pytest-replay.txt", ".pytest-replay-gw0.txt", ".pytest-replay-gw1.txt", @@ -186,7 +186,7 @@ def test_skip_cleanup_does_not_erase_replay_files(suite, testdir): for command_line in command_lines: result = testdir.runpytest_subprocess(*command_line) assert result.ret == 0 - assert set(x.basename for x in dir.listdir()) == { + assert {x.basename for x in dir.listdir()} == { ".pytest-replay-gw0.txt", ".pytest-replay-gw1.txt", } 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