Skip to content

Commit

Permalink
Generate digital attestations for PyPI (PEP 740) (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Oct 6, 2024
1 parent 7543a08 commit e2540af
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
permissions:
contents: read

env:
FORCE_COLOR: 1

jobs:
# Always build & lint package.
build-package:
Expand Down Expand Up @@ -47,6 +50,7 @@ jobs:
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
repository-url: https://test.pypi.org/legacy/

# Publish to PyPI on GitHub Releases.
Expand All @@ -71,3 +75,5 @@ jobs:

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: tests

on: [push, pull_request, workflow_dispatch]

permissions:
contents: read

env:
FORCE_COLOR: 1

Expand All @@ -13,24 +16,29 @@ jobs:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [windows-latest, macos-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v4
with:
# fetch all branches and tags
# ref actions/checkout#448
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: pyproject.toml

- name: Install tox
run: |
python -m pip install tox
- name: Run tests
run: tox -e py

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
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/astral-sh/ruff-pre-commit
rev: v0.6.7
rev: v0.6.8
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand Down Expand Up @@ -31,12 +31,12 @@ repos:
- id: check-github-workflows

- repo: https://github.com/rhysd/actionlint
rev: v1.7.1
rev: v1.7.2
hooks:
- id: actionlint

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v1.11.2
hooks:
- id: mypy
args:
Expand All @@ -56,7 +56,7 @@ repos:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.19
rev: v0.20.2
hooks:
- id: validate-pyproject

Expand Down
2 changes: 1 addition & 1 deletion cherry_picker/cherry_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@


WORKFLOW_STATES = enum.Enum(
"Workflow states",
"WORKFLOW_STATES",
"""
FETCHING_UPSTREAM
FETCHED_UPSTREAM
Expand Down

0 comments on commit e2540af

Please sign in to comment.