Skip to content

Commit

Permalink
Merge pull request #3 from idiap/prepare-release
Browse files Browse the repository at this point in the history
Update GH actions, repository links, package names
  • Loading branch information
eginhard committed Apr 4, 2024
2 parents 51cb842 + 892fced commit 5b32333
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 86 deletions.
51 changes: 22 additions & 29 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ defaults:
bash
jobs:
build-sdist:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Verify tag matches version
run: |
set -ex
Expand All @@ -19,7 +19,7 @@ jobs:
if [[ "$version" != "$tag" ]]; then
exit 1
fi
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: 3.9
- run: |
Expand All @@ -28,18 +28,18 @@ jobs:
python -m build
- run: |
pip install dist/*.tar.gz
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
build-wheels:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: |
Expand All @@ -48,53 +48,46 @@ jobs:
python -m build
- run: |
python -m pip install dist/*.whl
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python-version }}
path: dist/*.whl
publish-artifacts:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [build-sdist, build-wheels]
environment:
name: release
url: https://pypi.org/p/coqui-tts-trainer
permissions:
id-token: write
steps:
- run: |
mkdir dist
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: "sdist"
path: "dist/"
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: "wheel-3.8"
path: "dist/"
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: "wheel-3.9"
path: "dist/"
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: "wheel-3.10"
path: "dist/"
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: "wheel-3.11"
path: "dist/"
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: "wheel-3.12"
path: "dist/"
- run: |
ls -lh dist/
- name: Setup PyPI config
run: |
cat << EOF > ~/.pypirc
[pypi]
username=__token__
password=${{ secrets.PYPI_TOKEN }}
EOF
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: |
python -m pip install twine
- run: |
twine upload --repository pypi dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
13 changes: 3 additions & 10 deletions .github/workflows/style_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,16 @@ on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
check_skip:
runs-on: ubuntu-latest
if: "! contains(github.event.head_commit.message, '[ci skip]')"
steps:
- run: echo "${{ github.event.head_commit.message }}"

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.9]
experimental: [false]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -44,4 +37,4 @@ jobs:
python3 setup.py egg_info
- name: Lint check
run: |
make lint
make lint
11 changes: 2 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,16 @@ on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
check_skip:
runs-on: ubuntu-latest
if: "! contains(github.event.head_commit.message, '[ci skip]')"
steps:
- run: echo "${{ github.event.head_commit.message }}"

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
experimental: [false]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand Down
26 changes: 11 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Welcome to the 👟!

This repository is governed by [the Contributor Covenant Code of Conduct](https://github.com/coqui-ai/Trainer/blob/main/CODE_OF_CONDUCT.md).
This repository is governed by [the Contributor Covenant Code of Conduct](https://github.com/idiap/coqui-ai-Trainer/blob/main/CODE_OF_CONDUCT.md).

## Where to start.
We welcome everyone who likes to contribute to 👟.
Expand All @@ -11,13 +11,13 @@ You can contribute not only with code but with bug reports, comments, questions,

If you like to contribute code, squash a bug but if you don't know where to start, here are some pointers.

- [Github Issues Tracker](https://github.com/coqui-ai/Trainer/issues)
- [Github Issues Tracker](https://github.com/idiap/coqui-ai-Trainer/issues)

This is a place to find feature requests, bugs.

Issues with the ```good first issue``` tag are good place for beginners to take on.

-**PR**[pages](https://github.com/coqui-ai/Trainer/pulls) with the ```🚀new version``` tag.
-**PR**[pages](https://github.com/idiap/coqui-ai-Trainer/pulls) with the ```🚀new version``` tag.

We list all the target improvements for the next version. You can pick one of them and start contributing.

Expand All @@ -31,14 +31,14 @@ Let us know if you encounter a problem along the way.

The following steps are tested on an Ubuntu system.

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

2. Clone 👟 and add the main repo as a new remote named ```upsteam```.

```bash
$ git clone git@github.com:<your Github name>/Trainer.git
$ cd Trainer
$ git remote add upstream https://github.com/coqui-ai/Trainer.git
$ git clone git@github.com:<your Github name>/coqui-ai-Trainer.git
$ cd coqui-ai-Trainer
$ git remote add upstream https://github.com/idiap/coqui-ai-Trainer.git
```

3. Install 👟 for development.
Expand Down Expand Up @@ -89,12 +89,10 @@ The following steps are tested on an Ubuntu system.

```bash
$ git fetch upstream
$ git rebase upstream/master
# or for the development version
$ git rebase upstream/dev
$ git rebase upstream/main
```

12. Send a PR to ```dev``` branch.
12. Send a PR to ```main``` branch.

Push your branch to your fork.

Expand All @@ -104,13 +102,11 @@ The following steps are tested on an Ubuntu system.

Then go to your fork's Github page and click on 'Pull request' to send your ✨**PR**✨.

Please set ✨**PR**✨'s target branch to ```dev``` as we use ```dev``` to work on the next version.

13. Let's discuss until it is perfect. 💪

We might ask you for certain changes that would appear in the ✨**PR**✨'s page under 👟[https://github.com/coqui-ai/Trainer/pulls].
We might ask you for certain changes that would appear in the ✨**PR**✨'s page under 👟[https://github.com/idiap/coqui-ai-Trainer/pulls].

14. Once things look perfect, We merge it to the ```dev``` branch and make it ready for the next version.
14. Once things look perfect, We merge it to the ```main``` branch and make it ready for the next version.

Feel free to ping us at any step you need help using our communication channels.

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@

# 👟 Trainer
An opinionated general purpose model trainer on PyTorch with a simple code base.
Fork of the [original, unmaintained repository](https://github.com/coqui-ai/Trainer). New PyPI package: [coqui-tts-trainer](https://pypi.org/project/coqui-tts-trainer)

## Installation

From Github:

```console
git clone https://github.com/coqui-ai/Trainer
cd Trainer
git clone https://github.com/idiap/coqui-ai-Trainer
cd coqui-ai-Trainer
make install
```

From PyPI:

```console
pip install trainer
pip install coqui-tts-trainer
```

Prefer installing from Github as it is more stable.

## Implementing a model
Subclass and overload the functions in the [```TrainerModel()```](trainer/model.py)

Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[build_py]
build-lib=temp_build
build_lib=temp_build

[bdist_wheel]
bdist-dir=temp_build
bdist_dir=temp_build

[install_lib]
build-dir=temp_build
build_dir=temp_build
24 changes: 10 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
version = fin.read().strip()


class build_py(
setuptools.command.build_py.build_py
): # pylint: disable=too-many-ancestors
class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors
def run(self):
setuptools.command.build_py.build_py.run(self)

Expand All @@ -55,6 +53,7 @@ def run(self):
def pip_install(package_name):
subprocess.call([sys.executable, "-m", "pip", "install", package_name])


requirements = open(os.path.join(cwd, "requirements.txt"), "r").readlines()
with open(os.path.join(cwd, "requirements.dev.txt"), "r") as f:
requirements_dev = f.readlines()
Expand All @@ -66,11 +65,13 @@ def pip_install(package_name):
README = readme_file.read()

setup(
name="trainer",
name="coqui-tts-trainer",
version=version,
url="https://github.com/coqui-ai/Trainer",
url="https://github.com/idiap/coqui-ai-Trainer",
author="Eren Gölge",
author_email="egolge@coqui.ai",
maintainer="Enno Hermann",
maintainer_email="enno.hermann@gmail.com",
description="General purpose model trainer for PyTorch that is more flexible than it should be, by 🐸Coqui.",
long_description=README,
long_description_content_type="text/markdown",
Expand All @@ -84,21 +85,16 @@ def pip_install(package_name):
]
},
project_urls={
"Documentation": "https://github.com/coqui-ai/Trainer/",
"Tracker": "https://github.com/coqui-ai/Trainer/issues",
"Repository": "https://github.com/coqui-ai/Trainer",
"Discussions": "https://github.com/coqui-ai/Trainer/discussions",
"Documentation": "https://github.com/idiap/coqui-ai-Trainer",
"Tracker": "https://github.com/idiap/coqui-ai-Trainer/issues",
"Repository": "https://github.com/idiap/coqui-ai-Trainer",
},
cmdclass={
"build_py": build_py,
"develop": develop,
},
install_requires=requirements,
extras_require={
"dev": requirements_dev,
"test": requirements_test,
"all": requirements_all
},
extras_require={"dev": requirements_dev, "test": requirements_test, "all": requirements_all},
python_requires=">=3.6.0, <3.13",
classifiers=[
"Environment :: Console",
Expand Down
2 changes: 1 addition & 1 deletion trainer/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.0.36
v0.1.0

0 comments on commit 5b32333

Please sign in to comment.