Skip to content

Modernise packaging and clean up Python 2 residue#100

Merged
mpcabd merged 7 commits intomasterfrom
modernize/python3-cleanup
Apr 28, 2026
Merged

Modernise packaging and clean up Python 2 residue#100
mpcabd merged 7 commits intomasterfrom
modernize/python3-cleanup

Conversation

@mpcabd
Copy link
Copy Markdown
Owner

@mpcabd mpcabd commented Apr 28, 2026

Modernise packaging, drop legacy CI, and prepare for automated PyPI releases.

  • Migrate from setuptools/setup.py to hatchling via pyproject.toml
  • Drop support for Python < 3.10; add Python 3.14 to the test matrix
  • Replace Travis CI with GitHub Actions for CI (ci.yml)
  • Add a release workflow (release.yml) that runs the full test matrix then publishes to PyPI via OIDC trusted publishing — no API token required
  • Remove obsolete files: MANIFEST.in, .travis.yml, meta.yaml, upload-to-anaconda.sh
  • Add type hints and improve test coverage for font configuration
  • Bump version to 3.0.1 and update README version history

mpcabd and others added 7 commits April 28, 2026 16:23
- Replace setup.py with pyproject.toml (hatchling build backend, uv-native)
- Add uv.lock and dependency-groups for dev dependencies (pytest, pytest-cov)
- Drop tox.ini in favour of direct `uv run pytest`
- Replace .travis.yml with GitHub Actions CI (uv, Python 3.10–3.13 matrix)
- Drop Python <3.10 support (3.6–3.9 all EOL)
- Remove (object) base class and super() call on ArabicReshaper
- Switch _ligatures_re from @Property with hidden mutation to @cached_property
- Add -> str type hint and sentinel comment to reshape()
- Add ArabicReshaperConfigurationError(ValueError); replace bare Exception raises
- Add docstring and ImportError to config_for_true_type_font()
- Fix LETTERS -> letters parameter naming in letters.py helper functions
- Add comment explaining the RIAL SIGN regex pattern in ligatures.py
- Remove unused import os from __init__.py; export ArabicReshaperConfigurationError
- Remove debug print() from test_003_reshaping.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Wire pytest-cov into addopts so `uv run pytest` always reports coverage
- Add type hints to auto_config() and config_for_true_type_font()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add fonts/ to .gitignore so local test fonts are never committed
- Skip tests gracefully when fonts/ is absent or contains no .otf files
- Replace smoke tests with correctness tests: _expected_config() independently
  reads the font's cmap via fonttools and computes the expected config, then
  asserts config_for_true_type_font() == expected — catches any mis-detection
  of glyph support rather than just checking the function doesn't crash
- Add fonttools to dev dependency group so the tests run out of the box

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove .travis.yml, MANIFEST.in, meta.yaml, and upload-to-anaconda.sh
which are all superseded by the modernised pyproject.toml/hatchling setup
and GitHub Actions CI. Update README version history accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Uses OIDC trusted publishing (no API token needed). Runs the full test
matrix first, then builds and publishes on success.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mpcabd mpcabd merged commit ed35ce4 into master Apr 28, 2026
5 checks passed
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.

1 participant