Skip to content

epuplayer: workflow improvements and CLI alignment with smartem-workspace #123

@vredchenko

Description

@vredchenko

Summary

Improvements to EPUPlayer release workflow and CLI consistency with smartem-workspace.

Workflow Improvements

1. Skip RC release when commit has stable release tag

When pushing a commit to main AND a tag simultaneously, two workflow runs currently trigger (RC + stable). Add detection to skip RC release if the commit already has a release tag:

if git tag --points-at HEAD | grep -q "^epuplayer-v"; then
  echo "Commit has release tag, skipping RC"
  SHOULD_RELEASE="false"
fi

2. Version validation against __init__.py

Current workflow only validates tag version against pyproject.toml. Also validate against __init__.py to catch mismatches early:

INIT_VERSION=$(grep -m1 '__version__' $PACKAGE_DIR/smartem_epuplayer/__init__.py | sed 's/__version__ = "\(.*\)"/\1/')
if [[ "$TAG_VERSION" != "$INIT_VERSION" ]]; then
  echo "Error: Tag version ($TAG_VERSION) does not match __init__.py version ($INIT_VERSION)"
  exit 1
fi

CLI Consistency (alignment with smartem-workspace)

3. Add --version / -V flag

Standard CLI convention. Currently epuplayer --version does nothing.

parser.add_argument(
    "--version", "-V",
    action="version",
    version=f"%(prog)s {__version__}",
)

4. Add --no-colors and --plain flags

Align with smartem-workspace output control flags for consistent UX across tools.

5. Add verbosity modes

Add -v / --verbose and -q / --quiet flags for controlling output verbosity, matching smartem-workspace patterns.

README Improvements

6. Add shields.io badges

[![PyPI version](https://img.shields.io/pypi/v/smartem-epuplayer.svg)](https://pypi.org/project/smartem-epuplayer/)
[![Python Versions](https://img.shields.io/pypi/pyversions/smartem-epuplayer.svg)](https://pypi.org/project/smartem-epuplayer/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![CI](https://github.com/DiamondLightSource/smartem-devtools/actions/workflows/release-epuplayer.yml/badge.svg)](https://github.com/DiamondLightSource/smartem-devtools/actions/workflows/release-epuplayer.yml)

Files to modify

  • .github/workflows/release-epuplayer.yml - workflow improvements
  • packages/smartem-epuplayer/smartem_epuplayer/cli.py - CLI flags
  • packages/smartem-epuplayer/README.md - badges

Related Issues

These issues should be tackled together for consistent CLI UX and workflow patterns across both packages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementMinor improvements to existing functionalitysmartem-devtoolsDeveloper tooling, documentation, and workspace configuration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions