Skip to content

Commit 7453172

Browse files
Merge pull request #13 from WoosterTech/dev_pypi
build(publish.yml): add github action to publish to pypi
2 parents 1bc9c6d + 43b27ba commit 7453172

File tree

5 files changed

+44
-6
lines changed

5 files changed

+44
-6
lines changed

.github/workflows/publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Publish Package"
2+
3+
on:
4+
push:
5+
tags:
6+
- 0.*
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
permissions:
14+
id-token: write
15+
contents: read
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v5
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
21+
- name: Install Python 3.13
22+
run: uv python install 3.13
23+
- name: Build
24+
run: uv build
25+
- name: Smoke test (wheel)
26+
run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py
27+
- name: Smoke test (source distribution)
28+
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py
29+
- name: Publish
30+
run: uv publish

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
77
- id: check-yaml
88
- id: check-added-large-files
99
- repo: https://github.com/commitizen-tools/commitizen
10-
rev: v4.8.3
10+
rev: v4.10.0
1111
hooks:
1212
- id: commitizen
1313
# - id: commitizen-branch
1414
# stages:
1515
# - pre-push
1616
- repo: https://github.com/fpgmaas/deptry.git
17-
rev: 0.23.0
17+
rev: 0.24.0
1818
hooks:
1919
- id: deptry
2020
- repo: https://github.com/astral-sh/ruff-pre-commit
21-
rev: v0.12.5
21+
rev: v0.14.5
2222
hooks:
2323
- id: ruff-check
2424
args: [ --fix ]
2525
- id: ruff-format
2626
- repo: https://github.com/astral-sh/uv-pre-commit
27-
rev: 0.8.2
27+
rev: 0.9.10
2828
hooks:
2929
- id: uv-lock

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.PHONY: install-dev
2+
3+
install-dev:
4+
uv sync --all-groups --all-extras

ruff.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ convention = "google"
1717
[format]
1818
quote-style = "double"
1919
docstring-code-format = true
20-
docstring-code-line-length = "dynamic"

tests/smoke_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from attrmagic.utils import coerce_to_decimal
2+
3+
_ = coerce_to_decimal("123.456")
4+
5+
print("Smoke test passed.")

0 commit comments

Comments
 (0)