Skip to content

Commit

Permalink
ci: simplify ci setup
Browse files Browse the repository at this point in the history
  • Loading branch information
eginhard committed Oct 15, 2024
1 parent 2f13956 commit 49bd561
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 118 deletions.
25 changes: 4 additions & 21 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
pip install dist/*.tar.gz
- uses: actions/upload-artifact@v4
with:
name: sdist
name: build-sdist
path: dist/*.tar.gz
build-wheels:
runs-on: ubuntu-latest
Expand All @@ -50,7 +50,7 @@ jobs:
python -m pip install dist/*.whl
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python-version }}
name: build-wheel-${{ matrix.python-version }}
path: dist/*.whl
publish-artifacts:
runs-on: ubuntu-latest
Expand All @@ -61,28 +61,11 @@ jobs:
permissions:
id-token: write
steps:
- run: |
mkdir dist
- uses: actions/download-artifact@v4
with:
name: "sdist"
path: "dist/"
- uses: actions/download-artifact@v4
with:
name: "wheel-3.9"
path: "dist/"
- uses: actions/download-artifact@v4
with:
name: "wheel-3.10"
path: "dist/"
- uses: actions/download-artifact@v4
with:
name: "wheel-3.11"
path: "dist/"
- uses: actions/download-artifact@v4
with:
name: "wheel-3.12"
path: "dist/"
pattern: build-*
merge-multiple: true
- run: |
ls -lh dist/
- name: Publish package distributions to PyPI
Expand Down
24 changes: 8 additions & 16 deletions .github/workflows/style_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,13 @@ jobs:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
cache-dependency-path: 'requirements*'
- name: check OS
run: cat /etc/os-release
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git make gcc
- name: Install/upgrade dev dependencies
run: python3 -m pip install -r requirements.dev.txt
version: "0.4.21"
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Lint check
run: |
make lint
run: uv run --only-dev make lint
26 changes: 8 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,16 @@ jobs:
uv-resolution: ["lowest-direct", "highest"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
cache-dependency-path: 'requirements*'
- name: check OS
run: cat /etc/os-release
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends git make gcc
- name: Install/upgrade Python setup deps
run: python3 -m pip install --upgrade pip setuptools uv
- name: Install Trainer
run: |
python3 -m uv pip install --resolution=${{ matrix.uv-resolution }} --system "coqui-tts-trainer[dev,test] @ ."
version: "0.4.21"
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Unit tests
run: make test_all
run: uv run --resolution=${{ matrix.uv-resolution }} --all-extras make test_all
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
Expand Down
11 changes: 2 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.10
rev: v0.6.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: local
hooks:
- id: generate_requirements.py
name: generate_requirements.py
language: system
entry: python bin/generate_requirements.py
files: "pyproject.toml|requirements.*\\.txt|tools/generate_requirements.py"
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ style: ## update code style.

lint: ## run linter.
ruff check ${target_dirs}
ruff format --check ${target_dirs}

dev-deps: ## install development deps
pip install -r requirements.dev.txt
Expand Down
39 changes: 0 additions & 39 deletions bin/generate_requirements.py

This file was deleted.

16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ dependencies = [
]

[project.optional-dependencies]
# Development dependencies
dev = [
"coverage>=7",
"pre-commit>=3",
"pytest>=8",
"ruff==0.4.10",
"tomli>=2; python_version < '3.11'",
]
# Dependencies for running the tests
test = [
"accelerate>=0.20.0",
"torchvision>=0.15.1",
]

[tool.uv]
dev-dependencies = [
"coverage>=7",
"pre-commit>=3",
"pytest>=8",
"ruff==0.6.9",
]

[project.urls]
Homepage = "https://github.com/idiap/coqui-ai-Trainer"
Repository = "https://github.com/idiap/coqui-ai-Trainer"
Expand Down
7 changes: 0 additions & 7 deletions requirements.dev.txt

This file was deleted.

0 comments on commit 49bd561

Please sign in to comment.