Skip to content

Apprise Build System Modernization (PEP 621 / RPM CI)#1368

Merged
caronc merged 6 commits into
masterfrom
1313-pyproject-toml-conversion
Jul 28, 2025
Merged

Apprise Build System Modernization (PEP 621 / RPM CI)#1368
caronc merged 6 commits into
masterfrom
1313-pyproject-toml-conversion

Conversation

@caronc

@caronc caronc commented Jul 9, 2025

Copy link
Copy Markdown
Owner

Related issue (if applicable): #1313 , #1322
Also addresses: Red Hat Bugzilla 2377453


🔧 Description

This pull request modernizes the Apprise build system by:

  • Migrating from setup.py to pyproject.toml per PEP 621
  • Consolidating translation support and package building into tox environments
  • Fully integrating an RPM build+verify pipeline into GitHub Actions
  • Updating the RPM .spec file to follow Fedora packaging guidelines and reflect the new Python packaging metadata
  • Replacing .coveragerc with [tool.coverage] in pyproject.toml
  • Enabling multi-platform CI (macOS + Windows) using matrix builds
  • Resolving long-standing GitHub Actions coverage upload conflicts with artifact naming and .coverage handling

These changes aim to provide a reproducible, CI-friendly, standards-compliant release process for both Python and RPM packages.


🚀 Key Changes

  • ✅ Replaced setup.py with pyproject.toml (setuptools.build_meta backend)
  • ✅ Replaced legacy dynamic keyword loading with static [project.keywords]
  • ✅ Added SPDX-compliant license (BSD-2-Clause)
  • ✅ Introduced tox -e release for full packaging lifecycle
  • ✅ Man page generation and translation compilation included in CI
  • ✅ Verified RPM builds using Fedora-compatible GitHub Actions
  • ✅ CI test matrix now supports Python 3.9–3.12, across Ubuntu, macOS, and Windows
  • .coverage files now consistently written to root; parallel coverage disabled for simpler merging
  • ✅ Artifact uploads now uniquely named per ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.tox_env }}
  • tox.ini now supports clean qa, minimal, and release testing workflows
  • ruff linter applied to entire code-base
  • .pyi files dropped and type hinting integrated into main code base

🧪 tox Command Summary

Command Purpose
tox -e validate Validates pyproject.toml metadata
tox -e clean Cleans working tree + caches
tox -e i18n Extracts/updates .po files
tox -e compile Compiles .mo translation binaries
tox -e build Builds sdist and wheel to dist/
tox -e twine-check Verifies build artifacts for PyPI upload
tox -e release Full release lifecycle (all the above)
tox -e qa Full plugin coverage + test + reporting
tox -e minimal Fast test run with base dependencies only

🧪 GitHub Actions Improvements

  • 🧪 Full matrix testing across Python 3.9–3.12
  • 🖥️ Includes macOS and Windows minimal tests for cross-platform validation
  • ☂️ Fixes .coverage merging logic using consistent naming and upload paths
  • 📦 Coverage upload conflicts resolved by using include-hidden-files: true and unique artifact names
  • 🔄 Dropped Python 3.7 due to EOL and GitHub runner deprecation
  • 🔄 Dropped Python 3.8 due to EOL and GitHub runner deprecation

🗂️ Files Affected

  • pyproject.toml: new canonical build + lint + coverage + metadata source
  • tox.ini: restructured with environments for build, QA, lint, clean, i18n
  • .coveragerc: removed (superseded by [tool.coverage] in pyproject.toml)
  • .github/workflows/tests.yml: matrix test and coverage pipeline overhauled
  • .github/workflows/pkgbuild.yml: CI-based RPM builder
  • Dockerfile.el9: non-root compatible for tox RPM building
  • build-rpm.sh: now tox-aware and CI-friendly
  • KEYWORDS: removed (now handled in pyproject.toml)
  • .spec file: modernized and compliant with Fedora packaging

🛠️ Developer Quickstart

If you're contributing to the code base; you can use the following tools to assist you:

🔬 Run Tests

You can run tests for different environments using tox:

# Run full QA suite (with all plugin dependencies)
tox -e qa

# Run minimal tests (base dependencies only)
tox -e minimal

# You can also focus on just specifc tests like so:
tox -e minimal -- -k email

# or
tox -e qa -- -k email

# Run only against one Python version (e.g., local 3.11)
tox -e py311-qa  # or just use `tox -e qa` in a venv

💡 Tip: Install tox globally via pip install tox.


🧼 Lint and Style Checks

Static checks are handled by Ruff:

# Check for style, safety, and formatting issues
tox -e lint

🧽 Auto-format Code

Apply automatic style fixes using:

tox -e format

This runs Ruff in fix mode and will auto-correct most common issues.


🧪 Try the CLI Directly

If you're modifying apprise.cli, or want to test output locally:

tox -e apprise -- --version
tox -e apprise -- --debug -b "notify body here" mailto://credentials

🛠️ This runs your changes using the local editable install (-e .), so changes to code are immediately reflected.


📖 Validate Build Metadata

Ensure your pyproject.toml is PEP 621 compliant before release:

tox -e validate

✅ Checklist

  • Code builds correctly locally via tox -e release
  • RPM builds and installs successfully on EL9 (Rocky Linux)
  • GitHub Actions workflow passes all tox and RPM matrix builds
  • Cross-platform validation via macOS and Windows (minimal testenv)
  • Code coverage is merged and uploaded to Codecov
  • .coverage file handling no longer conflicts across jobs
  • flake8 replaced with ruff (modern static checks)

This PR brings Apprise in line with modern Python and Linux packaging practices while improving test visibility, platform coverage, and CI artifact hygiene.

@caronc caronc force-pushed the 1313-pyproject-toml-conversion branch 14 times, most recently from ca5710d to 7ff5972 Compare July 11, 2025 02:29
@caronc caronc changed the title Reworked Apprise to use pyproject.toml and tox.ini Apprise Build System Modernization (PEP 621 / RPM CI) Jul 11, 2025
@caronc caronc force-pushed the 1313-pyproject-toml-conversion branch 15 times, most recently from c7bcdca to 5f7048b Compare July 12, 2025 16:56
@caronc caronc force-pushed the 1313-pyproject-toml-conversion branch from 78da6fd to a54d332 Compare July 18, 2025 00:34
Comment thread apprise/apprise.py Fixed
Comment thread apprise/apprise.py Fixed
Comment thread apprise/plugins/__init__.py Fixed
Comment thread apprise/plugins/simplepush.py Fixed
Comment thread apprise/url.py Fixed
Comment thread apprise/url.py Fixed
@caronc caronc force-pushed the 1313-pyproject-toml-conversion branch from a54d332 to c0d7cd1 Compare July 18, 2025 00:44
@caronc caronc force-pushed the 1313-pyproject-toml-conversion branch from c0d7cd1 to cc933ef Compare July 18, 2025 00:48
@caronc caronc force-pushed the 1313-pyproject-toml-conversion branch 2 times, most recently from 7807c7a to e675351 Compare July 20, 2025 16:46
@caronc caronc force-pushed the 1313-pyproject-toml-conversion branch from e675351 to 8a18e6b Compare July 20, 2025 16:51
Comment thread apprise/apprise.py Dismissed
@caronc caronc force-pushed the 1313-pyproject-toml-conversion branch 4 times, most recently from 8630adf to 0d8f00a Compare July 28, 2025 01:50
@caronc caronc force-pushed the 1313-pyproject-toml-conversion branch from 0d8f00a to 7d65b32 Compare July 28, 2025 01:54
@caronc caronc merged commit 70667a5 into master Jul 28, 2025
16 of 17 checks passed
caronc added a commit that referenced this pull request Jul 31, 2025
@caronc caronc mentioned this pull request Jul 31, 2025
4 tasks
caronc added a commit that referenced this pull request Jul 31, 2025
@caronc caronc deleted the 1313-pyproject-toml-conversion branch August 1, 2025 22:29
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.

2 participants