Skip to content

Commit

Permalink
Adds support for 3.12. Switches to PyPI trusted publishers workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daverball committed Aug 21, 2024
1 parent 100c886 commit 2e25fa2
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11']
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/python-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,28 @@ jobs:

runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/project/libres

permissions:
id-token: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build -s -w
twine upload dist/*
pip install build
- name: Build package distributions
run: python -m build -s -w

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
6 changes: 3 additions & 3 deletions .github/workflows/python-tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11']
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Get branch name (merge)
if: github.event_name != 'pull_request'
Expand All @@ -28,7 +28,7 @@ jobs:
>> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
exclude: '^(.bumpversion.cfg)$'
Expand All @@ -14,19 +14,19 @@ repos:
- id: rst-linter
files: '^[A-Z]+\.rst$'
- repo: https://github.com/seantis/pre-commit-hooks
rev: v1.0.1
rev: v1.1.0
hooks:
- id: nocheckin
exclude: .pre-commit-config.yaml
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
files: '^(src/.*|tests/.*)\.py$'
- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
rev: 1.7.9
hooks:
- id: bandit
args: ["-c", "pyproject.toml", "--quiet"]
Expand Down
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changelog
---------

- Adds support for Python 3.12.
[Daverball]

0.7.2 (2024-02-07)
~~~~~~~~~~~~~~~~~~~

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ python =
3.9: py39
3.10: py310,flake8,bandit,mypy
3.11: py311
3.12: py312
[testenv]
usedevelop = true
setenv =
py{38,39,310,311}: COVERAGE_FILE = .coverage.{envname}
py{38,39,310,311,312}: COVERAGE_FILE = .coverage.{envname}
deps =
-e{toxinidir}[test]
commands = pytest --cov --cov-report= {posargs}
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Software Development :: Libraries :: Python Modules

[options]
Expand Down

0 comments on commit 2e25fa2

Please sign in to comment.