Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ body:
description: |
Please provide:
- Python version
- toon-format version
- python-toon version
- Operating system
placeholder: |
- Python 3.12.0
- toon-format 0.1.0
- python-toon 1.0.0
- macOS 14.0
validations:
required: true
Expand Down
71 changes: 65 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,83 @@ Closes #

- [ ] All existing tests pass
- [ ] Added new tests for changes
- [ ] Tested on Python 3.8
- [ ] Tested on Python 3.9
- [ ] Tested on Python 3.10
- [ ] Tested on Python 3.11
- [ ] Tested on Python 3.12
- [ ] Tested on Python 3.13
- [ ] Tested on Python 3.14

### Test Output

```bash
# Paste test output here
```

## Code Quality

<!-- Confirm code quality checks -->

- [ ] Ran `ruff check src/toon_format tests` - no issues
- [ ] Ran `ruff format src/toon_format tests` - code formatted
- [ ] Ran `mypy src/toon_format` - no critical errors
- [ ] All tests pass: `pytest tests/ -v`

## Checklist

<!-- Mark completed items with an [x] -->

- [ ] My code follows the project's coding standards
- [ ] My code follows the project's coding standards (PEP 8, line length 100)
- [ ] I have added type hints to new code
- [ ] I have run `ruff check` and `ruff format`
- [ ] I have run `mypy` on my changes
- [ ] I have added tests that prove my fix/feature works
- [ ] New and existing tests pass locally
- [ ] I have updated documentation (if needed)
- [ ] I have updated documentation (README.md, CLAUDE.md if needed)
- [ ] My changes do not introduce new dependencies
- [ ] I have maintained Python 3.8+ compatibility
- [ ] I have reviewed the [TOON specification](https://github.com/toon-format/spec) for relevant sections

## Performance Impact

<!-- If applicable, describe any performance implications -->

- [ ] No performance impact
- [ ] Performance improvement (describe below)
- [ ] Potential performance regression (describe and justify below)

<!-- Details: -->

## Breaking Changes

<!-- If this is a breaking change, describe the migration path for users -->

- [ ] No breaking changes
- [ ] Breaking changes (describe migration path below)

<!-- Migration path: -->

## Screenshots / Examples

<!-- If applicable, add screenshots or example output -->

```python
# Example usage
```

Output:
```
# Example output
```

## Additional Context

<!-- Add any other context about the PR here (optional) -->

## Checklist for Reviewers

<!-- For maintainers reviewing this PR -->

- [ ] Code changes are clear and well-documented
- [ ] Tests adequately cover the changes
- [ ] Documentation is updated
- [ ] No security concerns
- [ ] Follows TOON specification
- [ ] Backward compatible (or breaking changes are justified and documented)
70 changes: 60 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,78 @@ name: Publish to PyPI
on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
publish:
name: Publish to PyPI
build:
name: Build distribution
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.x"

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build

- name: Build package
run: uv build
run: python -m build

- name: Store distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish to PyPI
if: github.event_name == 'release' && github.event.action == 'published'
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/python-toon
permissions:
id-token: write

steps:
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

publish-to-testpypi:
name: Publish to TestPyPI
if: github.event_name == 'workflow_dispatch'
needs: build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/python-toon
permissions:
id-token: write

steps:
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
57 changes: 36 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,62 @@ name: Tests

on:
push:
branches: [main]
branches: [main, develop]
pull_request:
branches: [main]
branches: [main, develop]

jobs:
test:
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13", "3.14"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest pytest-cov

- name: Run tests
run: uv run pytest tests/ -v

- name: Run tests with coverage
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
run: |
uv run pytest tests/ --cov=src/toon_format --cov-report=xml --cov-report=term-missing
run: pytest --cov=toon_format --cov-report=xml --cov-report=term

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
- name: Upload coverage
uses: codecov/codecov-action@v4
if: matrix.python-version == '3.12'
with:
file: ./coverage.xml
fail_ci_if_error: false

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff mypy

- name: Run ruff
run: ruff check src/toon_format tests

- name: Run mypy
run: mypy src/toon_format
continue-on-error: true # Mypy is informational only
69 changes: 56 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
Expand All @@ -23,7 +27,36 @@ share/python-wheels/
*.egg
MANIFEST

# Virtual environments
# Package-specific
toon_format.egg-info/

# Ruff cache
.ruff_cache/

# Mypy cache
.mypy_cache/
.dmypy.json
dmypy.json

# PyInstaller
*.manifest
*.spec

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Environments
.env
.venv
env/
Expand All @@ -38,20 +71,30 @@ venv.bak/
*.swp
*.swo
*~
.claude/
CLAUDE.md

# macOS
.DS_Store
.AppleDouble
.LSOverride
._*

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/
.nox/
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Type checking
.mypy_cache/
.pytype/
.pyre/
.pyright/
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# uv
.uv/
Expand Down
Loading
Loading