Skip to content

Commit 4721c8d

Browse files
committed
first commit
1 parent 1854fe3 commit 4721c8d

20 files changed

Lines changed: 3250 additions & 274 deletions

.github/workflows/publish.yml

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,78 @@ name: Publish to PyPI
33
on:
44
release:
55
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
610

711
jobs:
8-
publish:
9-
name: Publish to PyPI
12+
build:
13+
name: Build distribution
1014
runs-on: ubuntu-latest
11-
permissions:
12-
id-token: write
13-
contents: read
1415

1516
steps:
1617
- uses: actions/checkout@v4
1718

18-
- name: Install uv
19-
uses: astral-sh/setup-uv@v5
20-
2119
- name: Set up Python
2220
uses: actions/setup-python@v5
2321
with:
24-
python-version: "3.12"
22+
python-version: "3.x"
23+
24+
- name: Install build dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build
2528
2629
- name: Build package
27-
run: uv build
30+
run: python -m build
31+
32+
- name: Store distribution packages
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: python-package-distributions
36+
path: dist/
37+
38+
publish-to-pypi:
39+
name: Publish to PyPI
40+
if: github.event_name == 'release' && github.event.action == 'published'
41+
needs: build
42+
runs-on: ubuntu-latest
43+
environment:
44+
name: pypi
45+
url: https://pypi.org/p/toon-format
46+
permissions:
47+
id-token: write
48+
49+
steps:
50+
- name: Download distributions
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: python-package-distributions
54+
path: dist/
2855

2956
- name: Publish to PyPI
3057
uses: pypa/gh-action-pypi-publish@release/v1
58+
59+
publish-to-testpypi:
60+
name: Publish to TestPyPI
61+
if: github.event_name == 'workflow_dispatch'
62+
needs: build
63+
runs-on: ubuntu-latest
64+
environment:
65+
name: testpypi
66+
url: https://test.pypi.org/p/toon-format
67+
permissions:
68+
id-token: write
69+
70+
steps:
71+
- name: Download distributions
72+
uses: actions/download-artifact@v4
73+
with:
74+
name: python-package-distributions
75+
path: dist/
76+
77+
- name: Publish to TestPyPI
78+
uses: pypa/gh-action-pypi-publish@release/v1
79+
with:
80+
repository-url: https://test.pypi.org/legacy/

.github/workflows/test.yml

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,62 @@ name: Tests
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, develop]
66
pull_request:
7-
branches: [main]
7+
branches: [main, develop]
88

99
jobs:
1010
test:
11-
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
12-
runs-on: ${{ matrix.os }}
11+
name: Test Python ${{ matrix.python-version }}
12+
runs-on: ubuntu-latest
1313
strategy:
14-
fail-fast: false
1514
matrix:
16-
os: [ubuntu-latest, macos-latest, windows-latest]
17-
python-version: ["3.11", "3.12", "3.13", "3.14"]
15+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1816

1917
steps:
2018
- uses: actions/checkout@v4
2119

22-
- name: Install uv
23-
uses: astral-sh/setup-uv@v5
24-
with:
25-
enable-cache: true
26-
2720
- name: Set up Python ${{ matrix.python-version }}
2821
uses: actions/setup-python@v5
2922
with:
3023
python-version: ${{ matrix.python-version }}
3124

3225
- name: Install dependencies
33-
run: uv sync
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -e .
29+
pip install pytest pytest-cov
3430
3531
- name: Run tests
36-
run: uv run pytest tests/ -v
37-
38-
- name: Run tests with coverage
39-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
40-
run: |
41-
uv run pytest tests/ --cov=src/toon_format --cov-report=xml --cov-report=term-missing
32+
run: pytest --cov=toon_format --cov-report=xml --cov-report=term
4233

43-
- name: Upload coverage to Codecov
44-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
34+
- name: Upload coverage
4535
uses: codecov/codecov-action@v4
36+
if: matrix.python-version == '3.12'
4637
with:
4738
file: ./coverage.xml
4839
fail_ci_if_error: false
40+
41+
lint:
42+
name: Lint
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Set up Python
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: "3.12"
52+
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install ruff mypy
57+
58+
- name: Run ruff
59+
run: ruff check src/toon_format tests
60+
61+
- name: Run mypy
62+
run: mypy src/toon_format
63+
continue-on-error: true # Mypy is informational only

.gitignore

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# Python
1+
# Byte-compiled / optimized / DLL files
22
__pycache__/
33
*.py[cod]
44
*$py.class
5+
6+
# C extensions
57
*.so
8+
9+
# Distribution / packaging
610
.Python
711
build/
812
develop-eggs/
@@ -23,7 +27,36 @@ share/python-wheels/
2327
*.egg
2428
MANIFEST
2529

26-
# Virtual environments
30+
# Package-specific
31+
toon_format.egg-info/
32+
33+
# Ruff cache
34+
.ruff_cache/
35+
36+
# Mypy cache
37+
.mypy_cache/
38+
.dmypy.json
39+
dmypy.json
40+
41+
# PyInstaller
42+
*.manifest
43+
*.spec
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.nox/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*.cover
55+
*.py,cover
56+
.hypothesis/
57+
.pytest_cache/
58+
59+
# Environments
2760
.env
2861
.venv
2962
env/
@@ -38,20 +71,30 @@ venv.bak/
3871
*.swp
3972
*.swo
4073
*~
74+
.claude/
75+
CLAUDE.md
76+
77+
# macOS
4178
.DS_Store
79+
.AppleDouble
80+
.LSOverride
81+
._*
4282

43-
# Testing
44-
.pytest_cache/
45-
.coverage
46-
htmlcov/
47-
.tox/
48-
.nox/
83+
# Files that might appear in the root of a volume
84+
.DocumentRevisions-V100
85+
.fseventsd
86+
.Spotlight-V100
87+
.TemporaryItems
88+
.Trashes
89+
.VolumeIcon.icns
90+
.com.apple.timemachine.donotpresent
4991

50-
# Type checking
51-
.mypy_cache/
52-
.pytype/
53-
.pyre/
54-
.pyright/
92+
# Directories potentially created on remote AFP share
93+
.AppleDB
94+
.AppleDesktop
95+
Network Trash Folder
96+
Temporary Items
97+
.apdisk
5598

5699
# uv
57100
.uv/

0 commit comments

Comments
 (0)