Skip to content

Commit d54c52c

Browse files
committed
ci: simplify ci by using uv where possible
1 parent 073f8de commit d54c52c

11 files changed

+86
-152
lines changed

.github/workflows/style_check.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
python-version: [3.9]
16-
experimental: [false]
1716
steps:
1817
- uses: actions/checkout@v4
19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v5
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v3
2120
with:
22-
python-version: ${{ matrix.python-version }}
23-
architecture: x64
24-
cache: 'pip'
25-
cache-dependency-path: 'requirements*'
26-
- name: Install/upgrade dev dependencies
27-
run: python3 -m pip install -r requirements.dev.txt
21+
version: "0.4.24"
22+
enable-cache: true
23+
cache-dependency-glob: "**/pyproject.toml"
24+
- name: Set up Python ${{ matrix.python-version }}
25+
run: uv python install ${{ matrix.python-version }}
2826
- name: Lint check
2927
run: make lint

.github/workflows/tests.yml

+16-24
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@ jobs:
1616
subset: ["data_tests", "inference_tests", "test_aux", "test_text", "test_tts", "test_tts2", "test_vocoder", "test_xtts", "test_zoo0", "test_zoo1", "test_zoo2"]
1717
steps:
1818
- uses: actions/checkout@v4
19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v5
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v3
2121
with:
22-
python-version: ${{ matrix.python-version }}
23-
architecture: x64
24-
cache: 'pip'
25-
cache-dependency-path: 'requirements*'
26-
- name: check OS
27-
run: cat /etc/os-release
28-
- name: set ENV
29-
run: export TRAINER_TELEMETRY=0
22+
version: "0.4.24"
23+
enable-cache: true
24+
cache-dependency-glob: "**/pyproject.toml"
25+
- name: Set up Python ${{ matrix.python-version }}
26+
run: uv python install ${{ matrix.python-version }}
3027
- name: Install Espeak
3128
if: contains(fromJSON('["inference_tests", "test_text", "test_tts", "test_tts2", "test_xtts", "test_zoo0", "test_zoo1", "test_zoo2"]'), matrix.subset)
3229
run: |
@@ -37,21 +34,17 @@ jobs:
3734
sudo apt-get update
3835
sudo apt-get install -y --no-install-recommends git make gcc
3936
make system-deps
40-
- name: Install/upgrade Python setup deps
41-
run: python3 -m pip install --upgrade pip setuptools wheel uv
4237
- name: Replace scarf urls
4338
if: contains(fromJSON('["data_tests", "inference_tests", "test_aux", "test_tts", "test_tts2", "test_xtts", "test_zoo0", "test_zoo1", "test_zoo2"]'), matrix.subset)
4439
run: |
4540
sed -i 's/https:\/\/coqui.gateway.scarf.sh\//https:\/\/github.com\/coqui-ai\/TTS\/releases\/download\//g' TTS/.models.json
46-
- name: Install TTS
41+
- name: Unit tests
4742
run: |
4843
resolution=highest
4944
if [ "${{ matrix.python-version }}" == "3.9" ]; then
5045
resolution=lowest-direct
5146
fi
52-
python3 -m uv pip install --resolution=$resolution --system "coqui-tts[dev,server,languages] @ ."
53-
- name: Unit tests
54-
run: make ${{ matrix.subset }}
47+
uv run --resolution=$resolution --extra server --extra languages make ${{ matrix.subset }}
5548
- name: Upload coverage data
5649
uses: actions/upload-artifact@v4
5750
with:
@@ -65,18 +58,17 @@ jobs:
6558
runs-on: ubuntu-latest
6659
steps:
6760
- uses: actions/checkout@v4
68-
- uses: actions/setup-python@v5
61+
- name: Install uv
62+
uses: astral-sh/setup-uv@v3
6963
with:
70-
python-version: "3.12"
64+
version: "0.4.24"
7165
- uses: actions/download-artifact@v4
7266
with:
7367
pattern: coverage-data-*
7468
merge-multiple: true
7569
- name: Combine coverage
7670
run: |
77-
python -Im pip install --upgrade coverage[toml]
78-
79-
python -Im coverage combine
80-
python -Im coverage html --skip-covered --skip-empty
81-
82-
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
71+
uv python install
72+
uvx coverage combine
73+
uvx coverage html --skip-covered --skip-empty
74+
uvx coverage report --format=markdown >> $GITHUB_STEP_SUMMARY

.pre-commit-config.yaml

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: "https://github.com/pre-commit/pre-commit-hooks"
3-
rev: v4.5.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-yaml
66
- id: end-of-file-fixer
@@ -11,14 +11,7 @@ repos:
1111
- id: black
1212
language_version: python3
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.3.0
14+
rev: v0.7.0
1515
hooks:
1616
- id: ruff
1717
args: [--fix, --exit-non-zero-on-fix]
18-
- repo: local
19-
hooks:
20-
- id: generate_requirements.py
21-
name: generate_requirements.py
22-
language: system
23-
entry: python scripts/generate_requirements.py
24-
files: "pyproject.toml|requirements.*\\.txt|tools/generate_requirements.py"

CONTRIBUTING.md

+32-21
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,37 @@ If you have a new feature, a model to implement, or a bug to squash, go ahead an
4444
Please use the following steps to send a ✨**PR**✨.
4545
Let us know if you encounter a problem along the way.
4646

47-
The following steps are tested on an Ubuntu system.
47+
The following steps are tested on an Ubuntu system and require
48+
[uv](https://docs.astral.sh/uv/) for virtual environment management. Choose your
49+
preferred [installation
50+
method](https://docs.astral.sh/uv/getting-started/installation/), e.g. the
51+
standalone installer:
52+
53+
```bash
54+
curl -LsSf https://astral.sh/uv/install.sh | sh
55+
```
4856

4957
1. Fork 🐸TTS[https://github.com/idiap/coqui-ai-TTS] by clicking the fork button at the top right corner of the project page.
5058

5159
2. Clone 🐸TTS and add the main repo as a new remote named ```upstream```.
5260

5361
```bash
54-
$ git clone git@github.com:<your Github name>/coqui-ai-TTS.git
55-
$ cd coqui-ai-TTS
56-
$ git remote add upstream https://github.com/idiap/coqui-ai-TTS.git
62+
git clone git@github.com:<your Github name>/coqui-ai-TTS.git
63+
cd coqui-ai-TTS
64+
git remote add upstream https://github.com/idiap/coqui-ai-TTS.git
5765
```
5866

5967
3. Install 🐸TTS for development.
6068

6169
```bash
62-
$ make system-deps # intended to be used on Ubuntu (Debian). Let us know if you have a different OS.
63-
$ make install_dev
70+
make system-deps # intended to be used on Ubuntu (Debian). Let us know if you have a different OS.
71+
make install_dev
6472
```
6573

6674
4. Create a new branch with an informative name for your goal.
6775

6876
```bash
69-
$ git checkout -b an_informative_name_for_my_branch
77+
git checkout -b an_informative_name_for_my_branch
7078
```
7179

7280
5. Implement your changes on your new branch.
@@ -75,47 +83,50 @@ The following steps are tested on an Ubuntu system.
7583

7684
7. Add your tests to our test suite under ```tests``` folder. It is important to show that your code works, edge cases are considered, and inform others about the intended use.
7785

78-
8. Run the tests to see how your updates work with the rest of the project. You can repeat this step multiple times as you implement your changes to make sure you are on the right direction.
86+
8. Run the tests to see how your updates work with the rest of the project. You
87+
can repeat this step multiple times as you implement your changes to make
88+
sure you are on the right direction. **NB: running all tests takes a long time,
89+
it is better to leave this to the CI.**
7990

8091
```bash
81-
$ make test # stop at the first error
82-
$ make test_all # run all the tests, report all the errors
92+
uv run make test # stop at the first error
93+
uv run make test_all # run all the tests, report all the errors
8394
```
8495

8596
9. Format your code. We use ```black``` for code formatting.
8697

8798
```bash
88-
$ make style
99+
make style
89100
```
90101

91102
10. Run the linter and correct the issues raised. We use ```ruff``` for linting. It helps to enforce a coding standard, offers simple refactoring suggestions.
92103

93104
```bash
94-
$ make lint
105+
make lint
95106
```
96107

97108
11. When things are good, add new files and commit your changes.
98109

99110
```bash
100-
$ git add my_file1.py my_file2.py ...
101-
$ git commit
111+
git add my_file1.py my_file2.py ...
112+
git commit
102113
```
103114

104115
It's a good practice to regularly sync your local copy of the project with the upstream code to keep up with the recent updates.
105116
106117
```bash
107-
$ git fetch upstream
108-
$ git rebase upstream/main
118+
git fetch upstream
119+
git rebase upstream/main
109120
# or for the development version
110-
$ git rebase upstream/dev
121+
git rebase upstream/dev
111122
```
112123
113124
12. Send a PR to ```dev``` branch.
114125
115126
Push your branch to your fork.
116127
117128
```bash
118-
$ git push -u origin an_informative_name_for_my_branch
129+
git push -u origin an_informative_name_for_my_branch
119130
```
120131
121132
Then go to your fork's Github page and click on 'Pull request' to send your ✨**PR**✨.
@@ -137,9 +148,9 @@ If you prefer working within a Docker container as your development environment,
137148
2. Clone 🐸TTS and add the main repo as a new remote named ```upsteam```.
138149
139150
```bash
140-
$ git clone git@github.com:<your Github name>/coqui-ai-TTS.git
141-
$ cd coqui-ai-TTS
142-
$ git remote add upstream https://github.com/idiap/coqui-ai-TTS.git
151+
git clone git@github.com:<your Github name>/coqui-ai-TTS.git
152+
cd coqui-ai-TTS
153+
git remote add upstream https://github.com/idiap/coqui-ai-TTS.git
143154
```
144155
145156
3. Build the Docker Image as your development environment (it installs all of the dependencies for you):

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN rm -rf /root/.cache/pip
1414
WORKDIR /root
1515
COPY . /root
1616

17-
RUN make install
17+
RUN pip3 install -e .[all]
1818

1919
ENTRYPOINT ["tts"]
2020
CMD ["--help"]

Makefile

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DEFAULT_GOAL := help
2-
.PHONY: test system-deps dev-deps style lint install install_dev help docs
2+
.PHONY: test system-deps style lint install install_dev help docs
33

44
help:
55
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@@ -50,27 +50,24 @@ test_failed: ## only run tests failed the last time.
5050
coverage run -m nose2 -F -v -B tests
5151

5252
style: ## update code style.
53-
black ${target_dirs}
53+
uv run --only-dev black ${target_dirs}
5454

5555
lint: ## run linters.
56-
ruff check ${target_dirs}
57-
black ${target_dirs} --check
56+
uv run --only-dev ruff check ${target_dirs}
57+
uv run --only-dev black ${target_dirs} --check
5858

5959
system-deps: ## install linux system deps
6060
sudo apt-get install -y libsndfile1-dev
6161

62-
dev-deps: ## install development deps
63-
pip install -r requirements.dev.txt
64-
6562
build-docs: ## build the docs
6663
cd docs && make clean && make build
6764

6865
install: ## install 🐸 TTS
69-
pip install -e .[all]
66+
uv sync --all-extras
7067

7168
install_dev: ## install 🐸 TTS for development.
72-
pip install -e .[all,dev]
73-
pre-commit install
69+
uv sync --all-extras
70+
uv run pre-commit install
7471

7572
docs: ## build the docs
7673
$(MAKE) -C docs clean && $(MAKE) -C docs html

README.md

+9-19
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11

22
## 🐸Coqui TTS News
33
- 📣 Fork of the [original, unmaintained repository](https://github.com/coqui-ai/TTS). New PyPI package: [coqui-tts](https://pypi.org/project/coqui-tts)
4+
- 📣 Prebuilt wheels are now also published for Mac and Windows (in addition to Linux as before) for easier installation across platforms.
45
- 📣 ⓍTTSv2 is here with 16 languages and better performance across the board.
56
- 📣 ⓍTTS fine-tuning code is out. Check the [example recipes](https://github.com/idiap/coqui-ai-TTS/tree/dev/recipes/ljspeech).
67
- 📣 ⓍTTS can now stream with <200ms latency.
78
- 📣 ⓍTTS, our production TTS model that can speak 13 languages, is released [Blog Post](https://coqui.ai/blog/tts/open_xtts), [Demo](https://huggingface.co/spaces/coqui/xtts), [Docs](https://coqui-tts.readthedocs.io/en/latest/models/xtts.html)
89
- 📣 [🐶Bark](https://github.com/suno-ai/bark) is now available for inference with unconstrained voice cloning. [Docs](https://coqui-tts.readthedocs.io/en/latest/models/bark.html)
910
- 📣 You can use [~1100 Fairseq models](https://github.com/facebookresearch/fairseq/tree/main/examples/mms) with 🐸TTS.
10-
- 📣 🐸TTS now supports 🐢Tortoise with faster inference. [Docs](https://coqui-tts.readthedocs.io/en/latest/models/tortoise.html)
11-
12-
<div align="center">
13-
<img src="https://static.scarf.sh/a.png?x-pxid=cf317fe7-2188-4721-bc01-124bb5d5dbb2" />
1411

1512
## <img src="https://raw.githubusercontent.com/idiap/coqui-ai-TTS/main/images/coqui-log-green-TTS.png" height="56"/>
1613

@@ -27,7 +24,6 @@ ______________________________________________________________________
2724
[![Discord](https://img.shields.io/discord/1037326658807533628?color=%239B59B6&label=chat%20on%20discord)](https://discord.gg/5eXr5seRrv)
2825
[![License](<https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg>)](https://opensource.org/licenses/MPL-2.0)
2926
[![PyPI version](https://badge.fury.io/py/coqui-tts.svg)](https://badge.fury.io/py/coqui-tts)
30-
[![Covenant](https://camo.githubusercontent.com/7d620efaa3eac1c5b060ece5d6aacfcc8b81a74a04d05cd0398689c01c4463bb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e7472696275746f72253230436f76656e616e742d76322e3025323061646f707465642d6666363962342e737667)](https://github.com/idiap/coqui-ai-TTS/blob/main/CODE_OF_CONDUCT.md)
3127
[![Downloads](https://pepy.tech/badge/coqui-tts)](https://pepy.tech/project/coqui-tts)
3228
[![DOI](https://zenodo.org/badge/265612440.svg)](https://zenodo.org/badge/latestdoi/265612440)
3329

@@ -43,12 +39,11 @@ ______________________________________________________________________
4339
## 💬 Where to ask questions
4440
Please use our dedicated channels for questions and discussion. Help is much more valuable if it's shared publicly so that more people can benefit from it.
4541

46-
| Type | Platforms |
47-
| ------------------------------- | --------------------------------------- |
48-
| 🚨 **Bug Reports** | [GitHub Issue Tracker] |
49-
| 🎁 **Feature Requests & Ideas** | [GitHub Issue Tracker] |
50-
| 👩‍💻 **Usage Questions** | [GitHub Discussions] |
51-
| 🗯 **General Discussion** | [GitHub Discussions] or [Discord] |
42+
| Type | Platforms |
43+
| -------------------------------------------- | ----------------------------------- |
44+
| 🚨 **Bug Reports, Feature Requests & Ideas** | [GitHub Issue Tracker] |
45+
| 👩‍💻 **Usage Questions** | [GitHub Discussions] |
46+
| 🗯 **General Discussion** | [GitHub Discussions] or [Discord] |
5247

5348
[github issue tracker]: https://github.com/idiap/coqui-ai-TTS/issues
5449
[github discussions]: https://github.com/idiap/coqui-ai-TTS/discussions
@@ -66,15 +61,10 @@ repository are also still a useful source of information.
6661
| 💼 **Documentation** | [ReadTheDocs](https://coqui-tts.readthedocs.io/en/latest/)
6762
| 💾 **Installation** | [TTS/README.md](https://github.com/idiap/coqui-ai-TTS/tree/dev#installation)|
6863
| 👩‍💻 **Contributing** | [CONTRIBUTING.md](https://github.com/idiap/coqui-ai-TTS/blob/main/CONTRIBUTING.md)|
69-
| 📌 **Road Map** | [Main Development Plans](https://github.com/coqui-ai/TTS/issues/378)
7064
| 🚀 **Released Models** | [Standard models](https://github.com/idiap/coqui-ai-TTS/blob/dev/TTS/.models.json) and [Fairseq models in ~1100 languages](https://github.com/idiap/coqui-ai-TTS#example-text-to-speech-using-fairseq-models-in-1100-languages-)|
71-
| 📰 **Papers** | [TTS Papers](https://github.com/erogol/TTS-papers)|
7265

7366
## Features
74-
- High-performance Deep Learning models for Text2Speech tasks.
75-
- Text2Spec models (Tacotron, Tacotron2, Glow-TTS, SpeedySpeech).
76-
- Speaker Encoder to compute speaker embeddings efficiently.
77-
- Vocoder models (MelGAN, Multiband-MelGAN, GAN-TTS, ParallelWaveGAN, WaveGrad, WaveRNN)
67+
- High-performance Deep Learning models for Text2Speech tasks. See lists of models below.
7868
- Fast and efficient model training.
7969
- Detailed training logs on the terminal and Tensorboard.
8070
- Support for Multi-speaker TTS.
@@ -180,8 +170,8 @@ pip install -e .[server,ja]
180170
If you are on Ubuntu (Debian), you can also run following commands for installation.
181171

182172
```bash
183-
$ make system-deps # intended to be used on Ubuntu (Debian). Let us know if you have a different OS.
184-
$ make install
173+
make system-deps # intended to be used on Ubuntu (Debian). Let us know if you have a different OS.
174+
make install
185175
```
186176

187177
If you are on Windows, 👑@GuyPaddock wrote installation instructions

dockerfiles/Dockerfile.dev

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ RUN rm -rf /root/.cache/pip
2020
WORKDIR /root
2121
COPY . /root
2222

23-
RUN make install
23+
RUN pip3 install -e .[all,dev]

0 commit comments

Comments
 (0)