Skip to content

Commit 05282a4

Browse files
committed
Use PDM only for management again
This reverts commit 192f8cf.
1 parent 63bd4fd commit 05282a4

File tree

8 files changed

+615
-316
lines changed

8 files changed

+615
-316
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
---
22
github: hynek
3+
ko_fi: the_hynek

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ repos:
99
- id: trailing-whitespace
1010
- id: end-of-file-fixer
1111
- id: check-yaml
12-
- id: check-toml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Build and Inspect Python Packages
1+
# build-and-inspect-python-package
22

33
This action provides the following functionality for GitHub Actions users that are maintaining Python packages:
44

action.yml

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,35 @@ outputs:
1818

1919
runs:
2020
using: composite
21-
2221
steps:
23-
- name: Resolve Lock Path
24-
shell: bash
25-
run: echo "PDM_CACHE=$(realpath ${{ github.action_path }}/pdm.lock)" >>$GITHUB_ENV
26-
27-
- uses: pdm-project/setup-pdm@v3
28-
id: setup-pdm
22+
- uses: actions/setup-python@v4
23+
id: python-baipp
2924
with:
30-
python-version: 3.x
31-
update-python: false
32-
cache: true
33-
cache-dependency-path: ${{ env.PDM_CACHE }}
25+
python-version: "3.x"
26+
update-environment: false
27+
cache: pip
3428

3529
- name: Create venv for tools
30+
run: ${{ steps.python-baipp.outputs.python-path }} -Im venv /tmp/baipp
3631
shell: bash
37-
run: |
38-
cd ${{ github.action_path }}
3932

40-
pdm venv create --name baipp ${{ steps.setup-pdm.outputs.python-path }}
41-
pdm use --venv baipp
42-
pdm sync
43-
pdm info --json
33+
- name: Install our tools
34+
run: >
35+
/tmp/baipp/bin/python
36+
-Im pip
37+
--disable-pip-version-check
38+
--no-python-version-warning
39+
install -r ${{ github.action_path }}/requirements/tools.txt
40+
shell: bash
4441

4542
# Build SDist, then build wheel out of it.
4643
# Set 'SOURCE_DATE_EPOCH' based on the last commit for build
4744
# reproducibility.
48-
- run: |
49-
PROJECT=$(pwd)
45+
- run: >
5046
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
51-
52-
pdm run build --outdir /tmp/baipp/dist "$PROJECT"
47+
/tmp/baipp/bin/python -m build --outdir /tmp/baipp/dist
5348
shell: bash
5449
working-directory: ${{ inputs.path }}
55-
env:
56-
PDM_PROJECT: ${{ github.action_path }}
5750
5851
- name: Set output
5952
id: setter
@@ -71,30 +64,27 @@ runs:
7164
name: Packages
7265
path: /tmp/baipp/dist/*
7366

74-
- run: pdm run check-wheel-contents /tmp/baipp/dist/*.whl
67+
- run: /tmp/baipp/bin/check-wheel-contents /tmp/baipp/dist/*.whl
7568
shell: bash
7669
working-directory: ${{ inputs.path }}
77-
env:
78-
PDM_PROJECT: ${{ github.action_path }}
7970

8071
- name: Check PyPI README
8172
shell: bash
8273
working-directory: ${{ inputs.path }}
83-
run: pdm run check-readme /tmp/baipp/dist/*
84-
env:
85-
PDM_PROJECT: ${{ github.action_path }}
74+
run: >
75+
/tmp/baipp/bin/python
76+
-m twine check
77+
--strict
78+
/tmp/baipp/dist/*
8679
8780
- name: Show wheel & SDist contents hierarchically, including metadata.
8881
shell: bash
8982
working-directory: ${{ inputs.path }}
90-
env:
91-
PDM_PROJECT: ${{ github.action_path }}
9283
run: |
9384
cd /tmp/baipp/dist
9485
mkdir -p out/sdist
9586
mkdir -p out/wheels
96-
97-
pdm run wheel unpack --dest /tmp/baipp/dist/out/wheels /tmp/baipp/dist/*.whl
87+
/tmp/baipp/bin/python -m wheel unpack --dest out/wheels *.whl
9888
tar xf *.tar.gz -C out/sdist
9989
10090
echo -e '\n<details><summary>SDist contents</summary>\n' >> $GITHUB_STEP_SUMMARY
@@ -121,7 +111,7 @@ runs:
121111
shell: bash
122112
working-directory: /tmp/baipp/dist/out/sdist/
123113
run: |
124-
cat */PKG-INFO | ${{ steps.setup-pdm.outputs.python-path }} -c '
114+
cat */PKG-INFO | python -c '
125115
import email.parser
126116
import sys
127117

pdm.lock

Lines changed: 278 additions & 269 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
[build-system]
2-
requires = ["pdm-backend"]
3-
build-backend = "pdm.backend"
4-
5-
[tool.pdm.scripts]
6-
build = "python -Im build"
7-
check-wheel-contents = "python -Im check_wheel_contents"
8-
check-readme = "python -Im twine check --strict"
9-
wheel = "python -Im wheel"
10-
111
[project]
122
name = "build-and-inspect-python-package"
133
version = "0" # we're not an actual package.
@@ -19,5 +9,5 @@ dependencies = [
199
"twine>=4.0.2",
2010
"wheel>=0.38.4",
2111
]
22-
license = { text = "MIT" }
12+
license = {text = "MIT"}
2313
requires-python = ">=3.10"

requirements/tools.txt

Lines changed: 310 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)