Skip to content

Commit 3f7ac33

Browse files
ryan-williamsclaude
andcommitted
Add sdist exclusions and TestPyPI workflow
- Exclude `node_modules/`, `.idea/`, `.claude/`, `.venv/`, `screenshots/`, `tmp/`, `*.iml` from sdist (reduces tarball from 103MB to 1.9MB) - Add `test-release.yml` workflow for TestPyPI publishing via `workflow_dispatch` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 0b292af commit 3f7ac33

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

.github/workflows/test-release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test Release to TestPyPI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test-release:
8+
name: Build and Release to TestPyPI
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write # Required for trusted publishing
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
# Build UI
16+
- uses: pnpm/action-setup@v4
17+
with:
18+
version: 9
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
cache: pnpm
23+
cache-dependency-path: ui/pnpm-lock.yaml
24+
- name: Build UI
25+
run: |
26+
cd ui
27+
pnpm install --frozen-lockfile
28+
pnpm build
29+
30+
# Build Python package (includes ui/dist as disk_tree/static)
31+
- uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.12"
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v4
36+
- name: Build wheel
37+
run: uv build
38+
39+
- name: Show build artifacts
40+
run: |
41+
ls -lh dist/
42+
echo "--- Wheel contents ---"
43+
python -c "import zipfile; z = zipfile.ZipFile('dist/disk_tree-0.1.0-py3-none-any.whl'); [print(f) for f in z.namelist() if 'static' in f]"
44+
echo "--- Tarball size check ---"
45+
tar -tzf dist/*.tar.gz | wc -l
46+
47+
# Publish to TestPyPI using trusted publishing
48+
- name: Publish to TestPyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1
50+
with:
51+
repository-url: https://test.pypi.org/legacy/

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ packages = ["disk_tree"]
5050
requires = ["hatchling"]
5151
build-backend = "hatchling.build"
5252

53+
[tool.hatch.build.targets.sdist]
54+
exclude = [
55+
".claude/",
56+
".idea/",
57+
".venv/",
58+
"screenshots/",
59+
"tmp/",
60+
"ui/node_modules/",
61+
"*.iml",
62+
]
63+
5364
[tool.hatch.build.targets.wheel]
5465
packages = ["src/disk_tree"]
5566

0 commit comments

Comments
 (0)