From c8c7bd28452f10eec879a48ba53b88c21cfaed64 Mon Sep 17 00:00:00 2001 From: loggger101 Date: Mon, 26 Oct 2026 00:12:02 -0400 Subject: [PATCH] Add --version, Node 24 CI actions, fuller package metadata, an Unreleased changelog - `quietlaunch --version` prints the version read from `quietlaunch.__version__`; a test holds it to that, and fails when a different string is planted. - CI uses actions/checkout@v5 and actions/setup-python@v6. The v4/v5 pair targeted Node 20 and drew a deprecation warning on every job. - pyproject lists Python 3.9-3.14 and macOS among its classifiers (all checked against trove-classifiers) and links the issues and the changelog. - CHANGELOG has an Unreleased section for what landed since v0.1.0. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/tests.yml | 8 ++++---- CHANGELOG.md | 15 +++++++++++++++ README.md | 4 ++-- pyproject.toml | 11 +++++++++++ quietlaunch/launcher.py | 8 ++++++++ tests/test_config.py | 10 ++++++++++ 6 files changed, 50 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4427f84..97f5d67 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,8 +26,8 @@ jobs: - os: ubuntu-24.04 python-version: "3.9" steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v5 + - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install @@ -42,8 +42,8 @@ jobs: hooks: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v5 + - uses: actions/setup-python@v6 with: python-version: "3.14" - name: Hooks match samebytes diff --git a/CHANGELOG.md b/CHANGELOG.md index abb966d..32416bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## Unreleased + +- **`--version`** prints `quietlaunch X.Y.Z`, read from + `quietlaunch.__version__`. +- README names each option's command-line flag beside its `LaunchConfig` + field, and the docs describe what happens rather than how much it matters. +- Tests pick ports below every OS's ephemeral range, so they pass on macOS, + and the fake server listens without a reverse-DNS lookup. +- `.githooks/` carries samebytes' stat-cache hook for working copies in a + synced folder; CI's `hooks` job checks the copies against the samebytes tag. +- CI runs `actions/checkout@v5` and `actions/setup-python@v6`, which run on + Node 24; the v4 and v5 they replace targeted the deprecated Node 20. +- Package metadata lists each supported Python version and macOS, and links + the issue tracker and this changelog. + ## v0.1.0 (2026-10-20) First release: economicspace's `launch_ui.py` (as of economicspace d9c6093), diff --git a/README.md b/README.md index dbe1b28..3e1c2ba 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,8 @@ sys.exit(quietlaunch.launch(quietlaunch.LaunchConfig( ))) ``` -`python -m quietlaunch --help` lists every option; each sets a `LaunchConfig` -field: +`python -m quietlaunch --help` lists every option, and `--version` prints the +version. Each option sets a `LaunchConfig` field: | field | flag | default | what | |---|---|---|---| diff --git a/pyproject.toml b/pyproject.toml index f3244c7..1220174 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,13 +19,22 @@ keywords = [ ] classifiers = [ "Development Status :: 4 - Beta", + "Environment :: MacOS X", "Environment :: Win32 (MS Windows)", "Environment :: X11 Applications", "Intended Audience :: Developers", "Intended Audience :: Science/Research", + "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Desktop Environment", "Topic :: Software Development :: User Interfaces", ] @@ -40,6 +49,8 @@ test = ["pytest>=7.0"] [project.urls] Repository = "https://github.com/loggger101/quietlaunch" +Issues = "https://github.com/loggger101/quietlaunch/issues" +Changelog = "https://github.com/loggger101/quietlaunch/blob/main/CHANGELOG.md" # A gui-script, so on Windows the installed `quietlaunch.exe` starts with no # console, which is the point of the package. diff --git a/quietlaunch/launcher.py b/quietlaunch/launcher.py index c9568d0..668c737 100644 --- a/quietlaunch/launcher.py +++ b/quietlaunch/launcher.py @@ -1001,6 +1001,14 @@ def _parser(): help="requirements file for the first-run install") p.add_argument("--no-install", action="store_false", dest="auto_install", help="never pip-install Streamlit") + # Read here, not at import: `__init__` imports this module, and run as a + # script there is no package to read it from. + try: + from . import __version__ as version + except ImportError: + version = "unknown" + p.add_argument("--version", action="version", + version="quietlaunch %s" % version) return p diff --git a/tests/test_config.py b/tests/test_config.py index b428e5d..a50b19c 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -102,3 +102,13 @@ def test_cli_defaults_match_the_dataclass(tmp_path, monkeypatch): app = str(tmp_path / "ui.py") launcher.main([app]) assert seen[0] == LaunchConfig(app=app) + + +def test_cli_version_is_the_package_version(capsys): + """`--version` names the version pyproject.toml reads, and exits 0.""" + import quietlaunch + with pytest.raises(SystemExit) as exc: + launcher.main(["--version"]) + assert exc.value.code == 0 + assert capsys.readouterr().out.strip() == ( + "quietlaunch " + quietlaunch.__version__)