Skip to content

Commit 5c58e1a

Browse files
authored
Attest build provenance of artifacts (#219)
2 parents 191b1d5 + 71ae13b commit 5c58e1a

File tree

6 files changed

+43
-8
lines changed

6 files changed

+43
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
permissions:
1515
contents: read
1616

17+
env:
18+
FORCE_COLOR: 1
19+
1720
jobs:
1821
# Always build & lint package.
1922
build-package:
@@ -38,6 +41,7 @@ jobs:
3841
needs: build-package
3942

4043
permissions:
44+
attestations: write
4145
id-token: write
4246

4347
steps:
@@ -47,6 +51,11 @@ jobs:
4751
name: Packages
4852
path: dist
4953

54+
- name: Attest build provenance
55+
uses: actions/attest-build-provenance@v1
56+
with:
57+
subject-path: "dist/*"
58+
5059
- name: Upload package to Test PyPI
5160
uses: pypa/gh-action-pypi-publish@release/v1
5261
with:
@@ -62,6 +71,7 @@ jobs:
6271
needs: build-package
6372

6473
permissions:
74+
attestations: write
6575
id-token: write
6676

6777
steps:
@@ -71,5 +81,10 @@ jobs:
7181
name: Packages
7282
path: dist
7383

84+
- name: Attest build provenance
85+
uses: actions/attest-build-provenance@v1
86+
with:
87+
subject-path: "dist/*"
88+
7489
- name: Upload package to PyPI
7590
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on: [push, pull_request, workflow_dispatch]
44

55
env:
66
FORCE_COLOR: 1
7+
PIP_DISABLE_PIP_VERSION_CHECK: 1
78

89
permissions:
910
contents: read

.github/workflows/test.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@ name: Test
22

33
on: [push, pull_request, workflow_dispatch]
44

5+
permissions:
6+
contents: read
7+
58
env:
69
FORCE_COLOR: 1
10+
PIP_DISABLE_PIP_VERSION_CHECK: 1
711

812
jobs:
913
test:
1014
runs-on: ${{ matrix.os }}
1115
strategy:
1216
fail-fast: false
1317
matrix:
14-
# Will be fixed in 3.13.0a6: Tuesday, 2024-04-09
15-
# qs = bytes(qs)
16-
# ~~~~~^^^^
17-
# TypeError: cannot convert 'NoneType' object to bytes
18-
python-version:
19-
["pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0-alpha.4"]
18+
python-version: ["pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
2019
os: [windows-latest, macos-latest, ubuntu-latest]
2120

2221
steps:
@@ -32,7 +31,6 @@ jobs:
3231
- name: Install dependencies
3332
run: |
3433
python -m pip install -U pip
35-
python -m pip install -U wheel
3634
python -m pip install -U tox
3735
3836
- name: Tox tests

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ repos:
3232
- id: check-github-workflows
3333
- id: check-renovate
3434

35+
- repo: https://github.com/rhysd/actionlint
36+
rev: v1.7.1
37+
hooks:
38+
- id: actionlint
39+
3540
# - repo: https://github.com/pre-commit/mirrors-mypy
3641
# rev: v1.7.0
3742
# hooks:

pyproject.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,27 @@ lint.select = [
7878
"EM", # flake8-errmsg
7979
"F", # pyflakes errors
8080
"I", # isort
81+
"ICN", # flake8-import-conventions
8182
"ISC", # flake8-implicit-str-concat
8283
"LOG", # flake8-logging
8384
"PGH", # pygrep-hooks
85+
"PYI", # flake8-pyi
86+
"RUF022", # unsorted-dunder-all
8487
"RUF100", # unused noqa (yesqa)
8588
"UP", # pyupgrade
8689
"W", # pycodestyle warnings
8790
"YTT", # flake8-2020
8891
]
89-
lint.extend-ignore = [
92+
lint.ignore = [
9093
"E203", # Whitespace before ':'
9194
"E221", # Multiple spaces before operator
9295
"E226", # Missing whitespace around arithmetic operator
9396
"E241", # Multiple spaces after ','
9497
]
98+
lint.flake8-import-conventions.aliases.datetime = "dt"
99+
lint.flake8-import-conventions.banned-from = [
100+
"datetime",
101+
]
95102
lint.isort.known-first-party = [
96103
"norwegianblue",
97104
]
@@ -104,3 +111,10 @@ max_supported_python = "3.13"
104111

105112
[tool.pytest.ini_options]
106113
addopts = "--color=yes"
114+
filterwarnings = [
115+
# Python <= 3.11
116+
"ignore:sys.monitoring isn't available, using default core:coverage.exceptions.CoverageWarning",
117+
]
118+
testpaths = [
119+
"tests",
120+
]

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ env_list =
1111
[testenv]
1212
extras =
1313
tests
14+
set_env =
15+
COVERAGE_CORE = sysmon
1416
commands =
1517
{envpython} -m pytest \
1618
--cov norwegianblue \

0 commit comments

Comments
 (0)