Skip to content

Commit 943bb0e

Browse files
committed
Correct build and publish workflows.
1 parent e3cf1df commit 943bb0e

File tree

5 files changed

+51
-13
lines changed

5 files changed

+51
-13
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,27 @@ jobs:
2525
with:
2626
pre-commit-source: "--group pre-commit"
2727

28+
package:
29+
name: Build Package
30+
needs: [ pre-commit ]
31+
runs-on: "ubuntu-24.04"
32+
permissions:
33+
id-token: write
34+
attestations: write
35+
steps:
36+
- name: Checkout
37+
uses: actions/[email protected]
38+
with:
39+
fetch-depth: 0
40+
41+
- name: Build and inspect package
42+
uses: hynek/[email protected]
43+
with:
44+
attest-build-provenance-github: 'true'
45+
2846
unit-tests:
2947
name: Unit tests
30-
needs: [ pre-commit ]
48+
needs: [ package ]
3149
runs-on: "ubuntu-24.04"
3250
strategy:
3351
fail-fast: false
@@ -46,6 +64,15 @@ jobs:
4664
python-version: "${{ matrix.python-version }}"
4765
allow-prereleases: true
4866

67+
- name: Install test requirements
68+
run: |
69+
python -m pip install -U pip
70+
python -m pip install --group ci
71+
72+
- name: Test
73+
run: |
74+
python -m tox -e py
75+
4976
# # This step is only needed if you're trying to diagnose test failures that
5077
# # only occur in CI, and can't be reproduced locally. When it runs, it will
5178
# # open an SSH server (URL reported in the logs) so you can ssh into the CI

.github/workflows/release.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
contents: write
1919
# This permission is required for trusted publishing.
2020
id-token: write
21-
attestations: write
2221
steps:
2322
- name: Set build variables
2423
run: |
@@ -32,8 +31,7 @@ jobs:
3231
- name: Get packages
3332
uses: actions/[email protected]
3433
with:
35-
pattern: wheels-*
36-
merge-multiple: true
34+
pattern: Packages
3735
path: dist
3836

3937
- name: Create release
@@ -44,11 +42,6 @@ jobs:
4442
artifacts: dist/*
4543
artifactErrorsFailBuild: true
4644

47-
- name: Generate attestations
48-
uses: actions/[email protected]
49-
with:
50-
subject-path: "dist/*"
51-
5245
- name: Publish release to Test PyPI
5346
uses: pypa/gh-action-pypi-publish@release/v1
5447
with:

pyproject.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ test = [
6060
]
6161
ci = [
6262
"setuptools_scm == 9.2.0",
63-
"tox == 4.29.0",
63+
"tox-uv == 1.28.0",
6464
]
6565
dev = [
6666
{include-group = "pre-commit"},
@@ -91,3 +91,18 @@ extend-select = [
9191
# use improvement.
9292
# "SIM", # flake8-simplify
9393
]
94+
95+
[tool.ruff.lint.isort]
96+
known-first-party = [
97+
"xbuild",
98+
"xvenv",
99+
]
100+
known-third-party = [
101+
"build",
102+
]
103+
104+
[tool.check-wheel-contents]
105+
toplevel = [
106+
"xbuild",
107+
"xvenv",
108+
]

tests/test_xvenv.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def test_dummy():
2+
# A placeholder test for now.
3+
pass

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = package,py{310,311,312,313,314}
2+
envlist = pre-commit,py{313,314}
33
skip_missing_interpreters = true
44

55
[testenv:pre-commit]
@@ -8,8 +8,8 @@ wheel_build_env = .pkg
88
dependency_groups = pre-commit
99
commands = pre-commit run --all-files --show-diff-on-failure --color=always
1010

11-
[testenv:py{,39,310,311,312,313,314}]
11+
[testenv:py{,313,314}]
1212
depends = pre-commit
1313
dependency_groups = test
1414
commands =
15-
python -m pytest {posargs:-vv --color yes}
15+
python -m pytest tests {posargs:-vv --color yes}

0 commit comments

Comments
 (0)