Skip to content

Commit

Permalink
Merge pull request #67 from nicoddemus/split-ci-workflows
Browse files Browse the repository at this point in the history
Drop Python 3.7, add 3.11 and 3.12, Improve CI
  • Loading branch information
nicoddemus authored Oct 2, 2023
2 parents 5a054df + 35ec689 commit 5bff4f1
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 94 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: deploy

on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
default: '1.2.3'

jobs:

package:
runs-on: ubuntu-latest
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}

steps:
- uses: actions/checkout@v3

- name: Build and Check Package
uses: hynek/[email protected]

deploy:
needs: package
runs-on: ubuntu-latest
environment: deploy
permissions:
id-token: write # For PyPI trusted publishers.
contents: write # For tag and release notes.

steps:
- uses: actions/checkout@v3

- name: Download Package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist

- name: Publish package to PyPI
uses: pypa/[email protected]

- name: Push tag
run: |
git config user.name "pytest bot"
git config user.email "[email protected]"
git tag --annotate --message=v${{ github.event.inputs.version }} v${{ github.event.inputs.version }} ${{ github.sha }}
git push origin v${{ github.event.inputs.version }}
- name: GitHub Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
tag_name: v${{ github.event.inputs.version }}
72 changes: 0 additions & 72 deletions .github/workflows/main.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: test

on:
push:
branches:
- main
- "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/[email protected]

test:

needs: [package]

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12-dev"]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3

- name: Download Package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist

- 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
shell: bash
run: |
tox run -e py --installpkg `find dist/*.tar.gz`
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ pytest-datadir
UNRELEASED
----------

- Added support for Python 3.11 and 3.12.
- Dropped support for Python 3.7.
- Fix handling of UNC paths on Windows (`#33 <https://github.com/gabrielcnr/pytest-datadir/issues/33>`__).

1.4.1 (2022-10-24)
Expand Down
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@ pytest-datadir will copy the original file to a temporary folder, so changing th

Both `datadir` and `shared_datadir` fixtures are `pathlib.Path` objects.

# Releases

Follow these steps to make a new release:

1. Create a new branch `release-X.Y.Z` from `master`.
2. Update `CHANGELOG.rst`.
3. Open a PR.
4. After it is **green** and **approved**, push a new tag in the format `X.Y.Z`.

Travis will deploy to PyPI automatically.

Afterwards, update the recipe in [conda-forge/pytest-datadir-feedstock](https://github.com/conda-forge/pytest-datadir-feedstock).

# License

MIT.
7 changes: 7 additions & 0 deletions RELEASING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Here are the steps on how to make a new release.

1. Create a ``release-VERSION`` branch from ``upstream/master``.
2. Update ``CHANGELOG.rst``.
3. Push the branch to ``upstream``.
4. Once all tests pass, start the ``deploy`` workflow manually.
5. Merge the PR.
11 changes: 4 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
"pytest11": ["pytest-datadir = pytest_datadir.plugin"],
},
package_dir={"": "src"},
setup_requires=[
"setuptools_scm; python_version>'3.6'",
"setuptools_scm <7.0; python_version=='3.6'",
],
setup_requires=["setuptools_scm"],
install_requires=["pytest>=5.0"],
author="Gabriel Reis",
author_email="[email protected]",
Expand All @@ -28,17 +25,17 @@
license="MIT",
keywords="pytest test unittest directory file",
url="http://github.com/gabrielcnr/pytest-datadir",
python_requires=">=3.6",
python_requires=">=3.8",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"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",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
],
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist = py{36,37,38,39,310}
envlist = py{38,39,310,311,312}

[testenv]
commands=
pytest {posargs:tests}
pytest --color=yes {posargs:tests}

0 comments on commit 5bff4f1

Please sign in to comment.