From 2b2eee3fb2728b6ce2d03606ba4000b7d75ce09c Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Tue, 4 Feb 2025 13:13:47 -0500 Subject: [PATCH 1/2] build: convert setup.py to pyproject.toml --- aligner/_version.py | 1 + pyproject.toml | 53 ++++++++++++++++++++++++++++++++++++++++++++ requirements.dev.txt | 13 ----------- requirements.txt | 9 -------- setup.py | 35 ----------------------------- 5 files changed, 54 insertions(+), 57 deletions(-) create mode 100644 aligner/_version.py create mode 100644 pyproject.toml delete mode 100644 requirements.dev.txt delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/aligner/_version.py b/aligner/_version.py new file mode 100644 index 0000000..9f68fef --- /dev/null +++ b/aligner/_version.py @@ -0,0 +1 @@ +VERSION = "1.0" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..61a88db --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,53 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "ctc-segmentation-aligner" +dynamic = ["version"] +description = "Module for performing zero-shot forced alignment" +readme = "README.md" +license = "MIT" +requires-python = ">=3.8" +authors = [ + { name = "Aidan Pine", email = "hello@aidanpine.ca" }, + { name = "Eric Joanis", email = "Eric.Joanis@nrc-cnrc.gc.ca" }, +] +classifiers = [ + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", +] +dependencies = [ + "g2p>=1.0.20230417", + "pydub>=0.23.1", + "pympi-ling", + "rich>=10.11.0", + "shellingham>=1.3.0", + "soundfile>=0.10.2", + "torch>=2.1.0", + "torchaudio>=2.1.0", + "typer>=0.12.4", +] + +[project.scripts] +ctc-segmenter = "aligner.cli:app" + +[tool.hatch.version] +path = "aligner/_version.py" + +[tool.hatch.build.targets.sdist] +include = ["/aligner"] + +[tool.hatch.build.targets.wheel] +include = ["/aligner"] + +[project.optional-dependencies] +dev = [ + "black~=24.3", + "flake8>=4.0.1", + "gitlint-core>=0.19.0", + "isort>=5.10.1", + "mypy>=1.8.0", + "pre-commit>=3.2.0", +] diff --git a/requirements.dev.txt b/requirements.dev.txt deleted file mode 100644 index b188a61..0000000 --- a/requirements.dev.txt +++ /dev/null @@ -1,13 +0,0 @@ -# This is a set of development dependencies -black~=24.3 -flake8>=4.0.1 -gitlint-core>=0.19.0 -isort>=5.10.1 -mypy>=1.8.0 -pre-commit>=3.2.0 -types-pyyaml>=6.0.5 -types-requests>=2.27.11 -types-setuptools>=57.4.9 -types-tabulate==0.8.11 -# Also install the test suite requirements --r requirements.test.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 327085e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -g2p>=1.0.20230417 -pydub>=0.23.1 -pympi-ling -rich>=10.11.0 -shellingham>=1.3.0 -soundfile>=0.10.2 -torch>=2.1.0 -torchaudio>=2.1.0 -typer>=0.12.4 diff --git a/setup.py b/setup.py deleted file mode 100644 index e569399..0000000 --- a/setup.py +++ /dev/null @@ -1,35 +0,0 @@ -""" Setup for wav2vec2aligner -""" - -import datetime as dt -from os import path - -from setuptools import find_packages, setup - -build_no = dt.datetime.today().strftime("%Y%m%d") - -this_directory = path.abspath(path.dirname(__file__)) - -with open(path.join(this_directory, "requirements.txt"), encoding="utf8") as f: - REQS = f.read().splitlines() - -setup( - name="ctc-segmentation-aligner", - python_requires=">=3.8", - version="1.0", - author="Aidan Pine", - author_email="hello@aidanpine.ca", - license="MIT", - description="Module for performing zero-shot forced alignment", - platform=["any"], - packages=find_packages(), - include_package_data=True, - install_requires=REQS, - entry_points={"console_scripts": ["ctc-segmenter = aligner.cli:app"]}, - zip_safe=False, - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], -) From ee9e8e5407af18f0609f3fbd9a72a834b04bc578 Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Fri, 7 Feb 2025 15:04:19 -0500 Subject: [PATCH 2/2] docs: add URLs to pyproject.toml Co-authored-by: Samuel Larkin --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 61a88db..018f887 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,3 +51,8 @@ dev = [ "mypy>=1.8.0", "pre-commit>=3.2.0", ] + +[project.urls] +Homepage = "https://github.com/EveryVoiceTTS/wav2vec2aligner" +Repository = "https://github.com/EveryVoiceTTS/wav2vec2aligner" +Issues = "https://github.com/EveryVoiceTTS/wav2vec2aligner/issues"