Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/matrix-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -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
```

Expand Down
33 changes: 14 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,34 +96,30 @@ The compiler should already be there, but run `<your package manager> 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
Expand Down Expand Up @@ -151,15 +147,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)
Expand Down Expand Up @@ -259,8 +254,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
```

Expand Down
2 changes: 1 addition & 1 deletion docs/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
50 changes: 33 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,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
Expand All @@ -78,10 +70,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 = [
Expand All @@ -94,10 +107,10 @@ docs = [
"mike>=2.1.1",
]

all = [
"readalongs[dev]",
"readalongs[ci]",
"readalongs[docs]",
ci = [
"readalongs[api]",
"coverage",
"licensecheck",
]

[project.scripts]
Expand All @@ -115,7 +128,10 @@ include = [
requires = [ "hatch-pip-compile" ]

[tool.hatch.envs.hatch-test]
features = [ "dev" ]
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" ]
Expand Down
10 changes: 1 addition & 9 deletions readalongs/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
),
Expand Down
Loading