From 1e82116288495f29e14f4a5b89cb375f13cbbae1 Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Fri, 23 Oct 2026 14:43:19 -0400 Subject: [PATCH 1/6] refactor: move dev dependencies from extras to groups https://docs.astral.sh/uv/concepts/projects/dependencies/#dependency-groups https://packaging.python.org/en/latest/specifications/dependency-groups/ --- .github/workflows/docs.yml | 2 +- .github/workflows/matrix-tests.yml | 2 +- .github/workflows/pythonpublish.yml | 4 +-- .github/workflows/tests.yml | 4 +-- Contributing.md | 6 ++-- README.md | 11 +++---- docs/Contributing.md | 2 +- pyproject.toml | 47 ++++++++++++++++++----------- 8 files changed, 45 insertions(+), 33 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 68f52d89..a3662738 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,7 +18,7 @@ jobs: python-version: "3.10" - name: Install dependencies and Studio run: | - pip install -e .[docs] + pip install --group docs -e . - name: Setup doc deploy run: | git config user.name 'github-actions[bot]' diff --git a/.github/workflows/matrix-tests.yml b/.github/workflows/matrix-tests.yml index 795500ba..83f10541 100644 --- a/.github/workflows/matrix-tests.yml +++ b/.github/workflows/matrix-tests.yml @@ -48,6 +48,6 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install Python dependencies run: | - pip install -e .[all] + pip install --group dev -e . - name: Run tests run: pytest diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 9a304db1..4d353aa5 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -46,7 +46,7 @@ jobs: shell: bash run: diff <(echo "VERSION = \"${VERSION#v}\"") <(head -1 readalongs/_version.py) - - name: Install dependencies + - name: Install build dependencies run: | python -m pip install --upgrade pip pip install build @@ -101,7 +101,7 @@ jobs: python-version: "3.10" - name: Install dependencies and Studio run: | - pip install -e .[docs] + pip install --group dev -e . - name: Setup doc deploy run: | git config user.name 'github-actions[bot]' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 12320d5d..412b1d97 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,7 +46,7 @@ jobs: # Keep pip up to date python -m pip install --upgrade pip # Install all Python dependencies in just one pip call, including Studio itself - pip install -e .[all] + pip install --group all -e . - name: Run tests run: | @@ -138,7 +138,7 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - pip install -e .[all] + pip install --group all -e . - name: Run tests on Windows run: pytest diff --git a/Contributing.md b/Contributing.md index dc060c29..c3ba9452 100644 --- a/Contributing.md +++ b/Contributing.md @@ -16,7 +16,7 @@ commits. Run these commands in each of your sandboxes to enable our pre-commit hooks and commitlint: ```sh -pip install -e '.[dev]' +pip install --group dev -e . prek install gitlint install-hook ``` @@ -53,7 +53,7 @@ We've listed all the developper dependencies for the project in [pyproject.toml](pyproject.toml) to make them easy to install: ```sh -pip install -e '.[dev]' +pip install --group dev -e . prek install ``` @@ -115,7 +115,7 @@ commit-msg hook in Git. Run this command in your g2p sandbox to install and enable the commit-msg hook: ```sh -pip install -e '.[dev]' +pip install --group dev -e . gitlint install-hook ``` diff --git a/README.md b/README.md index 658b5f34..bb9a397a 100644 --- a/README.md +++ b/README.md @@ -151,15 +151,14 @@ environment](https://docs.python.org/3/library/venv.html) though!): Run `readalongs -h` to confirm that installation was successful. -If you installed the current development version with Git, you can also run the +If you installed the current development version from GitHub, you can also run the full test suite, either with `hatch`: hatch test -or test the installed version (requires installing dev dependencies): +or with pytest (requires installing dev dependencies): - pip install 'readalongs[dev]' # if you installed from PyPI, or - pip install -e '.[dev]' # if you installed from a local clone + pip install --group dev -e . pytest And you can download our [open samples on GitHub](https://github.com/ReadAlongs/OpenSamples) @@ -259,8 +258,8 @@ This repo follows the [Contributor Covenant](http://contributor-covenant.org/ver You can install our standard Git hooks by running these commands in your sandbox: ```sh -pip install -e '.[dev]' -pre-commit install +pip install --group dev -e . +prek install gitlint install-hook ``` diff --git a/docs/Contributing.md b/docs/Contributing.md index e9ffa710..449157df 100644 --- a/docs/Contributing.md +++ b/docs/Contributing.md @@ -14,7 +14,7 @@ commands at the root of your Studio sandbox: 1. Install Studio and the required build software (mkdocs and friends): - pip install -e '.[docs]' + pip install --group docs -e . 2. Run this command to serve the documentation locally: diff --git a/pyproject.toml b/pyproject.toml index db29f1f1..cee79e6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,15 +54,7 @@ dependencies = [ ] [project.optional-dependencies] -dev = [ - "readalongs[api]", - "gitlint-core>=0.17.0", - "httpx>=0.24.1", # for testing with starlette<1.2 - "httpx2", # for testing with starlette>=1.2 - "pep440>=0.1.2", - "prek", - "pytest", -] +# Optional production dependency extras api = [ # gunivorn is only available on *nix, but it's only required for production deployments @@ -77,10 +69,31 @@ heroku = [ "ilt-panphon>=0.21.4,<0.22", ] -ci = [ +[dependency-groups] +# Optional development dependency groups + +dev = [ + {include-group = "test"}, + {include-group = "lint"}, +] + +all = [ + {include-group = "dev"}, + {include-group = "ci"}, + {include-group = "docs"}, +] + +test = [ "readalongs[api]", - "coverage", - "licensecheck", + "httpx>=0.24.1", # for testing with starlette<1.2 + "httpx2", # for testing with starlette>=1.2 + "pep440>=0.1.2", + "pytest", +] + +lint = [ + "gitlint-core>=0.17.0", + "prek", ] docs = [ @@ -93,10 +106,10 @@ docs = [ "mike>=2.1.1", ] -all = [ - "readalongs[dev]", - "readalongs[ci]", - "readalongs[docs]", +ci = [ + "readalongs[api]", + "coverage", + "licensecheck", ] [project.scripts] @@ -114,7 +127,7 @@ include = [ requires = [ "hatch-pip-compile" ] [tool.hatch.envs.hatch-test] -features = [ "dev" ] +dependency-groups = [ "dev" ] [tool.hatch.envs.prod] features = [ "heroku", "api" ] From 68fec00cc1376755bced5a23c176d66fa800f518 Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Fri, 23 Oct 2026 14:44:48 -0400 Subject: [PATCH 2/6] docs: clarify windows dep installs and remove references to Anaconda --- README.md | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index bb9a397a..d16050f0 100644 --- a/README.md +++ b/README.md @@ -96,34 +96,30 @@ The compiler should already be there, but run ` install gc ##### The easy way, using conda The `conda` package manager can install Python 3 and the required compiler automatically for you, -and simplifies ffmpeg and git installation. We recommend this solution. +and simplifies ffmpeg and git installation. -If the Anaconda Terms of Service are compatible with your organization, you can -use Miniconda3: download and run the latest "Miniconda3 Windows 64-bit" -installer from https://docs.conda.io/en/latest/miniconda.html. - -Fully open-source alternative, free for all organizations: Miniforge3. Download and run the latest "Miniforge3-Windows-x86_64" installer from -https://github.com/conda-forge/miniforge. - -Either way, you can accept all the default options suggested by the installer. +https://github.com/conda-forge/miniforge. You can accept all the default options suggested by the installer. -Launch an Anaconda Prompt or a Miniforge Prompt (this should be available from +Launch a Miniforge Prompt (this should be available from your Start Menu after installation) and run: conda install ffmpeg conda install git You can then run the pip install and git commands below, and use readalongs, all -from the Anaconda or Miniforge Prompt. +from the Miniforge Prompt. ##### The hard way If you know what you're doing, you can install the dependencies directly on your machine: - Install Python3 for Windows. - - Install [FFmpeg builds for Windows](https://ffmpeg.zeranoe.com/builds/) ([alternative instructions](https://windowsloop.com/install-ffmpeg-windows-10/)). - - Install [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017) (search for "Build Tools", select C++ when prompted). + - Install ffmpeg one of these ways: + - Install [Pixi](https://pixi.prefix.dev/latest/installation/) and run `pixi global install ffmpeg` + - or download from the [Official FFmpeg source](https://ffmpeg.org/download.html#build-windows) + - or use [alternative instructions](https://windowsloop.com/install-ffmpeg-windows-10/). + - If the `pip install` commands below fail during a compilation step, install [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017) (search for "Build Tools", select C++ when prompted). - Install Git for Windows (optional). ### Installing ReadAlongs Studio itself From a16b51dfb23dbe3407576315608e379cf13cef06 Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Fri, 23 Oct 2026 14:47:33 -0400 Subject: [PATCH 3/6] test: configure hatch matrix testing Run with all python versions 3.10+ using `hatch test -a`. But hatch no longer supports Python 3.9, so keep running that one with `uv run --python 3.9 pytest`. That point will be moot once #323 is merged, but leaving the comment here anyway. --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index cee79e6e..d7d76aa6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,6 +129,9 @@ requires = [ "hatch-pip-compile" ] [tool.hatch.envs.hatch-test] dependency-groups = [ "dev" ] +[[tool.hatch.envs.hatch-test.matrix]] +python = ["3.10", "3.11", "3.12", "3.13", "3.14"] + [tool.hatch.envs.prod] features = [ "heroku", "api" ] type = "pip-compile" From 95e6e7e155c433943ff61b192e281933022316d6 Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Fri, 23 Oct 2026 16:12:04 -0400 Subject: [PATCH 4/6] fix: address deprecation warning by not using LazyFile directly In testing, we get warnings about the name click.utils.LazyFile being deprecated in click 9. Turns out we don't need that logic anyway, so just remove it. --- readalongs/api.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/readalongs/api.py b/readalongs/api.py index 165b2498..0706a117 100644 --- a/readalongs/api.py +++ b/readalongs/api.py @@ -150,14 +150,6 @@ def make_xml( Returns: (status, exception, log_text) """ - # plaintextfile is not a file object if passed from click - - plaintextfile = ( - plaintextfile.name - if isinstance(plaintextfile, click.utils.LazyFile) - else plaintextfile - ) - xmlfile = str(xmlfile) if isinstance(xmlfile, os.PathLike) else xmlfile logging_stream = io.StringIO() logging_handler = logging.StreamHandler(logging_stream) try: @@ -169,7 +161,7 @@ def make_xml( with open(plaintextfile, encoding="utf-8-sig") as plaintextfile_handle: make_xml_args.update( plaintextfile=plaintextfile_handle, - xmlfile=xmlfile, + xmlfile=str(xmlfile), language=JoinerCallbackForClick(get_langs_deferred())( value_groups=language ), From 297861c7d0976b58d39de807b0b305ba5d505d87 Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Mon, 2 Nov 2026 11:26:49 -0500 Subject: [PATCH 5/6] fix(deps): remove obsolete conditional dependency for python <3.10 --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d7d76aa6..e91462c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,8 +44,7 @@ dependencies = [ "lxml>=4.9.4", "numpy>=1.20.2", "pydantic>=1.8.2,<3", - "pydub>=0.25.1; python_version < '3.10'", - "pydub-ng==0.2.0; python_version >= '3.10'", + "pydub-ng==0.2.0", "pympi-ling>=1.69,<2.0", "python-slugify==5.0.0", "requests>=2.31.0", From bcea44c001dfd50db860fc972fa4c93532aa5b3f Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Mon, 2 Nov 2026 11:27:48 -0500 Subject: [PATCH 6/6] feat: declare Python 3.15 support and matrix test it --- .github/workflows/matrix-tests.yml | 2 +- pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/matrix-tests.yml b/.github/workflows/matrix-tests.yml index 83f10541..06c0aa14 100644 --- a/.github/workflows/matrix-tests.yml +++ b/.github/workflows/matrix-tests.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-24.04, windows-latest, macos-latest] - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 diff --git a/pyproject.toml b/pyproject.toml index e91462c1..3267cdc4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Topic :: Multimedia :: Sound/Audio :: Speech", "Typing :: Typed", ] @@ -129,7 +130,7 @@ requires = [ "hatch-pip-compile" ] dependency-groups = [ "dev" ] [[tool.hatch.envs.hatch-test.matrix]] -python = ["3.10", "3.11", "3.12", "3.13", "3.14"] +python = ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] [tool.hatch.envs.prod] features = [ "heroku", "api" ]