-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: modernize package config and build/release workflow
This modernizes the overall project structure. feat: drops support for Python 2.7 (long overdue), Python 3.6 (end-of-life) feat: centralizes project metadata and config into a single `pyproject.toml`
- Loading branch information
Showing
12 changed files
with
152 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Release Please | ||
uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
release-type: python | ||
package-name: gTTS | ||
|
||
# Only do the rest (package build/push) if a release was created | ||
- name: Checkout | ||
if: ${{ steps.release.outputs.release_created }} | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
if: ${{ steps.release.outputs.release_created }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install build dependencies | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: | | ||
pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: python -m build | ||
- name: Publish package | ||
if: ${{ steps.release.outputs.release_created }} | ||
uses: pypa/gh-action-pypi-publish@37f50c210e3d2f9450da2cd423303d6a14a6e29f | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
# References: | ||
# * Release Please: | ||
# https://github.com/googleapis/release-please | ||
# * Release Please (GitHub Action) | ||
# https://github.com/google-github-actions/release-please-action | ||
# * Conventional Commits: | ||
# https://www.conventionalcommits.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# Build PDF as extra | ||
formats: | ||
|
||
version: 2 | ||
python: | ||
version: 3.7 | ||
pip_install: true | ||
extra_requirements: | ||
- docs | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- docs |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,89 @@ | ||
[project] | ||
name = "gTTS" | ||
description = "gTTS (Google Text-to-Speech), a Python library and CLI tool to interface with Google Translate text-to-speech API" | ||
authors = [{name = "Pierre Nicolas Durette", email = "pndurette@gmail.com"}] | ||
requires-python = ">=3.7" | ||
readme = "README.md" | ||
license = {text = "MIT"} | ||
keywords = [ | ||
"gtts", | ||
"text to speech", | ||
"Google Translate", | ||
"TTS", | ||
] | ||
classifiers = [ | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: MacOS", | ||
"Operating System :: Unix", | ||
"Operating System :: POSIX", | ||
"Operating System :: POSIX :: Linux", | ||
"Operating System :: Microsoft :: Windows", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Software Development :: Libraries", | ||
"Topic :: Multimedia :: Sound/Audio :: Speech", | ||
] | ||
dependencies = [ | ||
"requests ~= 2.28.0", | ||
"click ~= 8.1.3", | ||
"six ~= 1.16.0" | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.optional-dependencies] | ||
tests = [ | ||
"pytest ~= 7.1.3", | ||
"pytest-cov", | ||
"testfixtures", | ||
"mock" | ||
] | ||
docs = [ | ||
"sphinx", | ||
"sphinx-autobuild", | ||
"sphinx_rtd_theme", | ||
"sphinx-click" | ||
] | ||
|
||
[project.scripts] | ||
gtts-cli = "gtts.cli:tts_cli" | ||
|
||
[project.urls] | ||
homepage = "https://github.com/pndurette/gTTS" | ||
documentation = "https://gtts.readthedocs.io" | ||
repository = "https://github.com/pndurette/gTTS" | ||
changelog = "https://github.com/pndurette/gTTS/blob/main/CHANGELOG.rst" | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "gtts.version.__version__"} | ||
|
||
[tool.setuptools.packages.find] | ||
#where = ["src"] # list of folders that contain the packages (["."] by default) | ||
#include = ["my_package*"] # package names should match these glob patterns (["*"] by default) | ||
#exclude = ["my_package.tests*"] # exclude packages matching these glob patterns (empty by default) | ||
namespaces = false # to disable scanning PEP 420 namespaces (true by default) | ||
|
||
[tool.coverage.run] | ||
omit = [ | ||
"gtts/tests/*", | ||
"gtts/tokenizer/tests/*", | ||
] | ||
|
||
[tool.coverage.report] | ||
exclude_lines = [ | ||
"pragma: no cover", | ||
"def __repr__", | ||
"log.debug", | ||
"log.warning", | ||
] | ||
|
||
[tool.pytest.ini_options] | ||
markers = ["net: marks tests that call use the net (using the URL endpoint, deselect with '-m \"not net\"')"] | ||
|
||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
|
||
[tool.towncrier] | ||
package = "gtts" | ||
filename = "CHANGELOG.rst" | ||
directory = "news/" | ||
underlines = ["-", "~", "_"] | ||
title_format = "{version} ({project_date})" | ||
issue_format = "`#{issue} <https://github.com/pndurette/gTTS/issues/{issue}>`_" | ||
requires = ["setuptools>=61", "wheel"] | ||
build-backend = "setuptools.build_meta" |
This file was deleted.
Oops, something went wrong.