Skip to content

Conversation

@Justar96
Copy link
Contributor

@Justar96 Justar96 commented Nov 7, 2025

Publishing Setup for v0.9.0-beta.1

Description

This PR adds the publishing documentation and configuration needed for releasing toon_format v0.9.0-beta.1 to PyPI. It builds on the comprehensive test suite and features already merged in PR #6.

Type of Change

  • Documentation update
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bug fix (non-breaking change that fixes an issue)
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Related Issues

Addresses setup requirements for initial PyPI publication and beta testing phase.

Changes Made

1. Publishing Documentation

  • ✅ Created PUBLISHING.md - Complete 200+ line guide for releasing to PyPI:
    • Prerequisites (PyPI accounts, GitHub environments)
    • Trusted publisher configuration steps (no API tokens needed!)
    • Step-by-step release process
    • Local testing procedures
    • Version numbering guidelines (0.9.x → 1.0.0 roadmap)
    • Troubleshooting section
    • Release checklist

2. GitHub Actions Updates

  • ✅ Updated publish.yml workflow:
    • Updated action versions (upload-artifact v4→v6, download-artifact v4→v6)
    • Aligned with dependabot updates from main branch
  • ✅ Updated test.yml workflow:
    • Minor workflow improvements
    • Aligned with latest main branch changes
  • ✅ Updated lint.yml workflow:
    • Minor configuration updates
  • ✅ Disabled dependabot.yml temporarily:
    • Will re-enable after 1.0.0 release

3. README Updates

  • ✅ Added beta status warning at the top:
    • Clear indication this is v0.9.x beta
    • API may change before 1.0.0 notice
  • ✅ Updated installation instructions:
    • Changed from "install from PyPI" to "install from source" (for now)
    • Added GitHub installation option
    • Will update to PyPI installation after first successful publish
  • ✅ Added Project Status & Roadmap section:
    • Documented version progression (0.8.x → 0.9.x → 1.0.0-rc.x → 1.0.0)
    • Clear milestones and current status
  • ✅ Minor copy improvements:
    • Changed "battle-tested" to "comprehensive test coverage"
    • Updated CI/CD description

4. Documentation Updates

  • ✅ Updated docs/api.md:
    • Improved token counting function documentation
    • Added more examples and use cases
    • Clarified optional dependencies

5. Version Bump

  • ✅ Bumped version to 0.9.0-beta.1 in pyproject.toml
  • ✅ Updated __version__ in src/toon_format/__init__.py

6. Minor Code Updates

  • ✅ Updated src/toon_format/utils.py:
    • Improved error messaging for token counting
    • Better handling of optional tiktoken dependency

SPEC Compliance

  • This PR implements/fixes spec compliance
  • Spec section(s) affected: N/A (documentation and publishing setup only)
  • Spec version: TOON v1.3

This PR does not change spec compliance - it focuses on publishing infrastructure and documentation. Full spec compliance testing was completed in PR #6.

Testing

  • All existing tests pass
  • Added new tests for changes (N/A - documentation only)
  • 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

Test Output

All 792 existing tests continue to pass with the version bump:

$ uv run pytest
============================= test session starts =============================
platform win32 -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: D:\_Project\toon-python
configfile: pyproject.toml
plugins: cov-6.0.0
collected 792 items

tests/test_api.py ........................                               [  3%]
tests/test_cli.py .....                                                  [  3%]
tests/test_decoder.py ..........................................         [ 10%]
tests/test_encoder.py .............................................      [ 15%]
tests/test_internationalization.py ............................          [ 20%]
tests/test_normalization.py .......................................     [ 25%]
tests/test_normalize_functions.py .........................             [ 29%]
tests/test_parsing_utils.py ................................................ [ 36%]
.......                                                                  [ 37%]
tests/test_scanner.py ......................................             [ 42%]
tests/test_security.py ................................                  [ 46%]
tests/test_spec_fixtures.py ................................................ [ 53%]
.................................................. [100%]
tests/test_string_utils.py .......................................       [ 58%]

============================= 792 passed in 2.45s =============================

Coverage Report:

$ uv run pytest --cov=toon_format --cov-report=term
Coverage: 91%

Code Quality

  • 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

  • My code follows the project's coding standards (PEP 8, line length 100)
  • I have added type hints to new code (N/A - documentation only)
  • I have added tests that prove my fix/feature works (N/A - documentation only)
  • New and existing tests pass locally
  • I have updated documentation (PUBLISHING.md, README.md, docs/api.md)
  • My changes do not introduce new dependencies
  • I have maintained Python 3.8+ compatibility
  • I have reviewed the TOON specification for relevant sections

Performance Impact

  • No performance impact

This PR only adds documentation and updates version numbers. No code changes that affect runtime performance.

Breaking Changes

  • No breaking changes

All changes are documentation and configuration only. No API changes.

Screenshots / Examples

PUBLISHING.md Guide

The new publishing guide includes:

  • Complete setup instructions for PyPI trusted publishing
  • Step-by-step release checklist
  • Troubleshooting section
  • Version numbering guidelines

README Beta Warning

Added clear beta status indicator:

> **⚠️ Beta Status (v0.9.x):** This library is in active development and working towards spec compliance. Beta published to PyPI. API may change before 1.0.0 release.

Publishing Workflow

The updated GitHub Actions workflow is ready for:

  1. Automatic PyPI Release (on GitHub release creation):

    • Creates distribution packages
    • Validates with twine
    • Publishes to PyPI with trusted publishing (no API tokens!)
  2. Manual TestPyPI Release (workflow dispatch):

    • Test releases before production
    • Validate package structure
    • Verify installation

Additional Context

Release Roadmap

Following the agreed version strategy:

  • v0.8.x - Initial code set, tests, documentation ✅ (completed in previous PRs)
  • v0.9.x - Serializer improvements, spec compliance, publishing setup ✅ (this PR)
  • v1.0.0-rc.x - Release candidates for production readiness (next phase)
  • v1.0.0 - Official stable release 🎯

Next Steps After Merge

  1. Re-tag v0.9.0-beta.1 on the merged commit:

    git checkout main
    git pull
    git tag -d v0.9.0-beta.1              # Delete old tag
    git push origin :refs/tags/v0.9.0-beta.1  # Delete remote tag
    git tag -a v0.9.0-beta.1 -m "Release v0.9.0-beta.1"
    git push origin v0.9.0-beta.1
  2. Create GitHub Release for v0.9.0-beta.1:

  3. Verify PyPI publication:

  4. Update README (after successful publish):

    • Change installation instructions from "install from source" to PyPI
    • Update beta status if needed
  5. Begin beta testing phase:

    • Gather user feedback
    • Address any bugs discovered
    • Prepare for 1.0.0-rc.1

Checklist for Reviewers

  • Code changes are clear and well-documented
  • Tests adequately cover the changes
  • Documentation is updated and accurate
  • No security concerns
  • Follows TOON specification
  • Backward compatible (no breaking changes)
  • Publishing workflow configuration is correct
  • Version numbers are consistent across files
  • README accurately reflects beta status
  • All CI checks pass (tests, coverage, linting)

- Configure GitHub Actions for automated PyPI publishing with trusted publishing
- Add comprehensive documentation (PUBLISHING.md)
- Bump version to 0.9.0-beta.1 for beta testing phase
- Update README with beta status and installation instructions
- Add internationalization, security, and normalization test suites
- Configure coverage enforcement at 85% minimum in CI
@Justar96 Justar96 requested review from a team and johannschopplich as code owners November 7, 2025 07:27
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/toon_format
  __init__.py
  utils.py 85-86
Project Total  

This report was generated by python-coverage-comment-action

Copy link
Contributor

@johannschopplich johannschopplich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as far as I'm concerned. :)

@Justar96
Copy link
Contributor Author

Justar96 commented Nov 7, 2025

I have to initiate this PR. I was waiting for someone else to do it, haha!

@Justar96
Copy link
Contributor Author

Justar96 commented Nov 7, 2025

Perhaps we should reduce it to just one approval? @johannschopplich

@johannschopplich
Copy link
Contributor

@Justar96 IMHO, a minimum approval of 2 sounds suitable for a team of 4. However, we can change that at any time. I was only tagged because of the README changes (as code owner). Maybe I'm gonna simplify that in the future as well.

Copy link

@bpradana bpradana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@Justar96 Justar96 merged commit ea48ea3 into main Nov 8, 2025
6 checks passed
@Justar96 Justar96 deleted the feat/publishing-setup branch November 8, 2025 18:27
@Justar96
Copy link
Contributor Author

Justar96 commented Nov 8, 2025

@johannschopplich Beta has been released, thank you guys! It's a bit janky with the auto release, but maybe you could help me set it up to be more robust. @bpradana
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants