Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @gaborbernat
2 changes: 2 additions & 0 deletions .github/FUNDING.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: gaborbernat
thanks_dev: u/gh/gaborbernat
45 changes: 45 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Security policy

hatch-pep770 is a hatchling build hook that writes a CycloneDX SBOM into wheels, plus a command line tool that renders
that SBOM as SPDX and validates it. This policy says how to report a security problem and how we decide whether a report
is one.

## Reporting a vulnerability

**Do not open a public issue for a security problem.** Use
[GitHub's private vulnerability reporting](https://github.com/tox-dev/hatch-pep770/security/advisories/new). If you do
not have a GitHub account, email [gaborjbernat@gmail.com](mailto:gaborjbernat@gmail.com).

Include what the attacker controls and what they gain, the steps or a proof of concept, and the versions and platform
you tested. Write the report yourself; unreviewed tool or model output takes longer to triage.

## What to expect

Volunteers maintain hatch-pep770, with no on-call rotation. We aim to acknowledge a report within **5 working days** and
assess it within **15 working days**. Fixes are developed in a private fork attached to the draft advisory, ship in a
new release, and the advisory, with a CVE requested through GitHub, goes out with that release. The default embargo is
**90 days** from the report; we agree any change with the reporter. We credit reporters in the advisory under the name
they choose, or not at all. There is no bug bounty.

## Supported versions

Only the latest release receives fixes. Confirm the problem reproduces on it before reporting.

## Vulnerability or bug

The build hook runs inside a project's own build, with the trust that build already has: the project source, its
`pyproject.toml`, its build requirements and the build environment are trusted. A report that needs control of one of
those is a bug: we fix it in the open and publish no advisory.

**In scope**

- A wheel bundled as a data file, or an SBOM given to `hatch-pep770 spdx` or `validate`, that makes the tool write
outside its output file or the wheel's `.dist-info/sboms/` directory, or run code.
- An SBOM that misstates what the wheel contains in a way the project's own inputs cannot explain, such as a wrong hash.

**Out of scope**

- Anything hatchling's own build trusts.
- Vulnerabilities in the packages the SBOM lists; report those to their projects.

If you cannot tell which side a finding falls on, report it privately and we will decide.
30 changes: 30 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2
multi-ecosystem-groups:
dependencies:
schedule:
interval: weekly
day: tuesday
labels:
- dependencies
- skip news
updates:
- package-ecosystem: github-actions
directory: /
patterns:
- '*'
multi-ecosystem-group: dependencies
labels:
- dependencies
- skip news
cooldown:
default-days: 7
- package-ecosystem: pre-commit
directory: /
patterns:
- '*'
multi-ecosystem-group: dependencies
labels:
- dependencies
- skip news
cooldown:
default-days: 7
5 changes: 5 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
exclude:
authors:
- dependabot[bot]
- pre-commit-ci[bot]
63 changes: 63 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: 🧪 check
on:
workflow_dispatch:
push:
branches: ["main"]
tags-ignore: ["**"]
pull_request:
types: [opened, synchronize, reopened]
schedule:
- cron: "27 8 * * *"
concurrency:
group: check-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
test:
name: 🧪 Test
uses: tox-dev/github-workflows/.github/workflows/check.yaml@e1361e2efa1e9dd9705bb9be719d923cd9154707 # 6.7.1
permissions:
contents: read
with:
include: |
[
{"env": "3.15"},
{"env": "3.15t", "python": "3.15t"},
{"env": "3.14", "python": "3.14"},
{"env": "3.13", "python": "3.13"},
{"env": "3.12", "python": "3.12"},
{"env": "3.11", "python": "3.11"},
{"env": "3.10", "python": "3.10"},
{"env": "3.9", "python": "3.9"},
{"env": "type"},
{"env": "dev"},
{"env": "pkg_meta"},
{"env": "3.15", "os": "windows-2025-vs2026"},
{"env": "3.14", "python": "3.14", "os": "windows-2025-vs2026"},
{"env": "3.9", "python": "3.9", "os": "windows-2025-vs2026"},
{"env": "3.15", "os": "macos-26"}
]
release:
name: 🏷️ Release dry run
uses: ./.github/workflows/prepare-release.yaml # zizmor: ignore[self-repository] actionlint rejects the $/ form
permissions:
contents: read
pull-requests: read
with:
dry-run: true
hooks:
name: 🧹 Hooks under the cooldown
uses: tox-dev/github-workflows/.github/workflows/cooled-hooks.yaml@e1361e2efa1e9dd9705bb9be719d923cd9154707 # 6.7.1
permissions:
contents: read
gate:
name: 🚦 ${{ github.event_name == 'pull_request' && 'Required checks pass' || 'Non-PR checks pass' }}
if: ${{ !cancelled() }} # codespell:ignore cancelled
needs: [test, release, hooks]
runs-on: ubuntu-26.04
steps:
- name: 🚦 Require all needed jobs to pass
uses: tox-dev/github-workflows/required-checks@e1361e2efa1e9dd9705bb9be719d923cd9154707 # 6.7.1
with:
needs: ${{ toJSON(needs) }}
22 changes: 22 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 🛡️ CodeQL
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
schedule:
- cron: "35 8 * * 2"
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
analyze:
name: 🛡️ Analyze
uses: tox-dev/github-workflows/.github/workflows/codeql.yaml@e1361e2efa1e9dd9705bb9be719d923cd9154707 # 6.7.1
permissions:
contents: read
security-events: write
with:
languages: '["actions","python"]'
paths-ignore: '["tests"]'
30 changes: 30 additions & 0 deletions .github/workflows/news.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 📝 Changelog
on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]
permissions:
contents: read
pull-requests: read
jobs:
changelog:
name: 📝 News fragment
runs-on: ubuntu-26.04
steps:
- name: 📥 Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: 🐍 Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
version: latest-known
python-version: "3.15"
enable-cache: false
- name: 📦 Install locked release tools
uses: tox-dev/github-workflows/install-locked-tools@e1361e2efa1e9dd9705bb9be719d923cd9154707 # 6.7.1
with:
groups: release-news
venv: ${{ runner.temp }}/release-tools
- name: 🔍 Validate news fragments
uses: tox-dev/github-workflows/validate-news@e1361e2efa1e9dd9705bb9be719d923cd9154707 # 6.7.1
33 changes: 33 additions & 0 deletions .github/workflows/prepare-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 🏷️ Prepare release
on:
workflow_dispatch:
inputs:
bump:
description: Version bump strategy
required: true
type: choice
options:
- auto
- major
- minor
- patch
default: auto
workflow_call:
inputs:
dry-run:
description: Assemble the release without pushing, for the pull request gate
type: boolean
required: true
permissions: {}
jobs:
prepare:
name: 🏷️ Prepare Towncrier release
uses: tox-dev/github-workflows/.github/workflows/prepare-towncrier-release.yaml@e1361e2efa1e9dd9705bb9be719d923cd9154707 # 6.7.1
permissions:
contents: read
pull-requests: read
secrets:
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
with:
bump: ${{ inputs.bump || 'auto' }}
dry-run: ${{ inputs.dry-run == true }}
56 changes: 56 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 🚀 Release to PyPI
on:
push:
tags: ["*"]
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: 🏗️ Build
uses: tox-dev/github-workflows/.github/workflows/validate-python-release.yaml@e1361e2efa1e9dd9705bb9be719d923cd9154707 # 6.7.1
permissions:
contents: read
notes:
name: 📝 Render GitHub Release notes
uses: tox-dev/github-workflows/.github/workflows/release-notes.yaml@e1361e2efa1e9dd9705bb9be719d923cd9154707 # 6.7.1
permissions:
contents: read
with:
tag: ${{ github.ref_name }}
changelog: CHANGELOG.md
artifact-url: https://pypi.org/project/hatch-pep770/${{ github.ref_name }}/
publish-pypi:
name: 🚀 Publish to PyPI
needs: [build, notes]
runs-on: ubuntu-26.04
environment:
name: release
url: https://pypi.org/project/hatch-pep770/${{ github.ref_name }}
permissions:
id-token: write
steps:
- name: 📩 Download distributions
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
artifact-ids: ${{ needs.build.outputs.distributions-artifact-id }}
path: dist
- name: 🚀 Publish to PyPI
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
with:
attestations: true
packages-dir: dist
github-release:
name: 🚀 Publish GitHub Release
needs: [build, notes, publish-pypi]
uses: tox-dev/github-workflows/.github/workflows/github-release.yaml@e1361e2efa1e9dd9705bb9be719d923cd9154707 # 6.7.1
permissions:
contents: write
with:
project: hatch-pep770
version: ${{ github.ref_name }}
tag: ${{ github.ref_name }}
artifact-pattern: python-package-distributions
notes-artifact-id: ${{ needs.notes.outputs.artifact-id }}
26 changes: 26 additions & 0 deletions .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 🛡️ scorecard
on:
branch_protection_rule:
schedule:
- cron: "43 8 * * 2"
push:
branches: ["main"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
analysis:
name: 🛡️ Scorecard analysis
if: github.repository == 'tox-dev/hatch-pep770'
permissions:
actions: read # read workflow runs for the Packaging check
checks: read # read check runs for the CI-Tests and SAST checks
contents: read # check out and scan the repository
id-token: write # authenticate the results published to the scorecard API
issues: read # read issue activity for the Maintained check
pull-requests: read # read reviews for the Code-Review check
security-events: write # upload the SARIF results to code scanning
statuses: read # read commit statuses for the CI-Tests check
uses: tox-dev/github-workflows/.github/workflows/scorecard.yaml@e1361e2efa1e9dd9705bb9be719d923cd9154707 # 6.7.1
2 changes: 2 additions & 0 deletions .mdformat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
wrap = 120
number = true
54 changes: 54 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
ci:
autoupdate_schedule: quarterly
default_language_version:
python: python3.15
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: a76b92851fc9eede9f9bc4073eb55202f34eb0df # frozen: 0.39.0
hooks:
- id: check-github-workflows
args: ["--verbose"]
- repo: https://github.com/rhysd/actionlint
rev: 914e7df21a07ef503a81201c76d2b11c789d3fca # frozen: v1.7.12
hooks:
- id: actionlint
args: ["-ignore", 'label "ubuntu-26[.]04" is unknown'] # GitHub offers this runner before actionlint lists it.
- repo: https://github.com/codespell-project/codespell
rev: 57b21406f092110c18776e39b0bda50d37c945c8 # frozen: v2.4.3
hooks:
- id: codespell
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "50e0f3aee9dc5747a5f173f79a7417403c18dda6" # frozen: v2.30.3
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "25bcf95026b96e2dd3c0aec3090c3d6ef6ca2e6c" # frozen: v0.17.3
hooks:
- id: ruff-format
- id: ruff-check
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
- repo: https://github.com/hukkin/mdformat
rev: "82912cdaea4fb830f751504486a7879c70526547" # frozen: 1.0.0
hooks:
- id: mdformat
additional_dependencies:
- mdformat-config==0.2.1
- mdformat-gfm==1.0.0
- mdformat-toc==0.5.0
- repo: https://github.com/google/yamlfmt
rev: "21ca5323a9c87ee37a434e0ca908efc0a89daa07" # frozen: v0.21.0
hooks:
- id: yamlfmt
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: c92afdf2c6ca336aaa8f39e2bd8d48f62dbd8e1f # frozen: v1.31.1
hooks:
- id: zizmor
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

<!-- towncrier release notes start -->
Loading
Loading