Skip to content

Commit cfb3d4d

Browse files
authored
Mix fixes and prep release for 0.0.17 (#72)
1 parent d684a65 commit cfb3d4d

File tree

5 files changed

+32
-25
lines changed

5 files changed

+32
-25
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ jobs:
3434
name: distributions
3535
path: dist/
3636

37+
generate-provenance:
38+
name: Generate GitHub build provenances
39+
runs-on: ubuntu-latest
40+
needs: [build]
41+
permissions:
42+
id-token: write # to sign the provenance
43+
attestations: write # to persist the attestation files
44+
steps:
45+
- name: Download distributions
46+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
47+
with:
48+
name: distributions
49+
path: dist/
50+
- name: Create provenances
51+
uses: actions/attest-build-provenance@v1
52+
with:
53+
subject-path: 'dist/*'
3754

3855
publish:
3956
name: Publish Python 🐍 distributions 📦 to PyPI

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.0.17]
11+
1012
### Fixed
1113

1214
- The `GitLabPublisher` policy now takes the workflow file path in order to
@@ -17,6 +19,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1719
similar to `GitHubPublisher`'s behavior
1820
([#71](https://github.com/trailofbits/pypi-attestations/pull/71)).
1921

22+
23+
### Changed
24+
25+
- Publisher classes (`GitLabPublisher` and `GitHubPublisher`) no longer take a claims
26+
dictionary during construction
27+
([#72](https://github.com/trailofbits/pypi-attestations/pull/72)).
28+
2029
## [0.0.16]
2130

2231
### Added
@@ -184,8 +193,9 @@ This is a corrective release for [0.0.14].
184193

185194
- Initial implementation
186195

187-
[Unreleased]: https://github.com/trailofbits/pypi-attestation-models/compare/v0.0.16...HEAD
188-
[0.0.16]: https://github.com/trailofbits/pypi-attestation-models/compare/v0.0.15...v0.0.15
196+
[Unreleased]: https://github.com/trailofbits/pypi-attestation-models/compare/v0.0.17...HEAD
197+
[0.0.17]: https://github.com/trailofbits/pypi-attestation-models/compare/v0.0.16...v0.0.17
198+
[0.0.16]: https://github.com/trailofbits/pypi-attestation-models/compare/v0.0.15...v0.0.16
189199
[0.0.15]: https://github.com/trailofbits/pypi-attestation-models/compare/v0.0.14...v0.0.15
190200
[0.0.14]: https://github.com/trailofbits/pypi-attestation-models/compare/v0.0.13...v0.0.14
191201
[0.0.13]: https://github.com/trailofbits/pypi-attestation-models/compare/v0.0.12...v0.0.13

src/pypi_attestations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""The `pypi-attestations` APIs."""
22

3-
__version__ = "0.0.16"
3+
__version__ = "0.0.17"
44

55
from ._impl import (
66
Attestation,

src/pypi_attestations/_impl.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ class _PublisherBase(BaseModel):
406406
model_config = ConfigDict(alias_generator=to_snake)
407407

408408
kind: str
409-
claims: Optional[dict[str, Any]] = None
410409

411410
def _as_policy(self) -> VerificationPolicy:
412411
"""Return an appropriate `sigstore.policy.VerificationPolicy` for this publisher."""

test/test_impl.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55
from hashlib import sha256
66
from pathlib import Path
7-
from typing import Any, Optional
7+
from typing import Any
88

99
import pretend
1010
import pytest
@@ -136,12 +136,10 @@ def test_verify_github_attested(self) -> None:
136136
assert predicate_type == "https://docs.pypi.org/attestations/publish/v1"
137137
assert predicate == {}
138138

139-
@pytest.mark.parametrize("claims", (None, {}, {"ref": "refs/tags/v0.0.4a2"}))
140-
def test_verify_from_github_publisher(self, claims: Optional[dict]) -> None:
139+
def test_verify_from_github_publisher(self) -> None:
141140
publisher = impl.GitHubPublisher(
142141
repository="trailofbits/pypi-attestation-models",
143142
workflow="release.yml",
144-
claims=claims,
145143
)
146144

147145
bundle = Bundle.from_json(gh_signed_dist_bundle_path.read_bytes())
@@ -586,23 +584,6 @@ def test_wrong_kind(self) -> None:
586584
with pytest.raises(ValueError, match="Input should be 'GitLab'"):
587585
impl.GitLabPublisher(kind="GitHub", repository="foo/bar")
588586

589-
def test_claims(self) -> None:
590-
raw = {
591-
"kind": "GitHub",
592-
"repository": "foo/bar",
593-
"workflow": "publish.yml",
594-
"claims": {
595-
"this": "is-preserved",
596-
"this-too": 123,
597-
},
598-
}
599-
pub: impl.Publisher = TypeAdapter(impl.Publisher).validate_python(raw)
600-
601-
assert pub.claims == {
602-
"this": "is-preserved",
603-
"this-too": 123,
604-
}
605-
606587

607588
class TestProvenance:
608589
def test_version(self) -> None:

0 commit comments

Comments
 (0)