-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from JSchmie/pyproject.toml
Pyproject.toml
- Loading branch information
Showing
12 changed files
with
174 additions
and
275 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,112 +1,73 @@ | ||
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI | ||
|
||
# on: | ||
# workflow_dispatch: | ||
# inputs: | ||
# branch_name: | ||
# description: 'Branch to build from (default is main)' | ||
# required: false | ||
# default: 'main' | ||
# workflow_run: | ||
# workflows: ["Run Tests"] | ||
# types: | ||
# - completed | ||
# branches: [main, develop] # This ensures it only triggers for these branches | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
tags: | ||
- v* # Push tags to trigger the workflow | ||
workflow_dispatch: | ||
inputs: | ||
branch_name: | ||
description: 'Branch to build from (default is main)' | ||
required: false | ||
default: 'main' | ||
|
||
env: | ||
TestPyPI_URL: https://test.pypi.org/p/scraibe | ||
PyPI_URL: https://pypi.org/p/scraibe | ||
PyPI_DEV_URL: https://pypi.org/p/scraibe-nightly | ||
ISRELEASED: true | ||
jobs: | ||
|
||
build: | ||
name: Build distribution 📦 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip install setuptools wheel | ||
- name: Build source distribution | ||
run: | | ||
python3 -c "import os; print('ISRELEASED' in os.environ)" | ||
python3 setup.py sdist | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
test: | ||
description: "Push to TestPyPI not PyPI" | ||
default: true | ||
type: boolean | ||
|
||
publish-to-testpypi: | ||
name: Publish Python 🐍 distribution 📦 to TestPyPI | ||
needs: build | ||
jobs: | ||
Build-and-publish-to-Test-PyPI: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: testpypi | ||
url: env.TestPyPI_URL | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
fetch-depth: '0' | ||
- name: Set up Poetry 📦 | ||
uses: JRubics/[email protected] | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
skip-existing: true | ||
|
||
pypi_token: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
plugins: "poetry-dynamic-versioning" | ||
repository_name: "scraibe" | ||
repository_url: "https://test.pypi.org/legacy/" | ||
|
||
test-install: | ||
name: Test Installation from TestPyPI | ||
needs: publish-to-testpypi | ||
needs: Build-and-publish-to-Test-PyPI | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.9, 3.11, 3.12] | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install package | ||
run: | | ||
python3 -m pip install setuptools | ||
python3 -m pip install --index-url https://test.pypi.org/simple/ scraibe | ||
pip install -U setuptools | ||
pip install -r requirements.txt | ||
python3 -m pip install --no-deps --pre --index-url https://test.pypi.org/simple/ scraibe>=0.1.3 | ||
python3 -c "import scraibe; print(scraibe.__version__)" | ||
publish-to-pypi: | ||
name: Conditional Publish to PyPI or Dev Repository | ||
needs: [build, test-install] | ||
name: Publish to PyPI | ||
needs: test-install | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: env.PyPI_URL | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
steps: | ||
- name: Checkout Repository Tags | ||
uses: actions/checkout@v4 | ||
if: github.ref == 'refs/tags/v*' | ||
with: | ||
fetch-depth: '0' | ||
branch: 'main' | ||
- name: Checkout Repository (Develop) | ||
uses: actions/checkout@v4 | ||
if: github.ref == "refs/heads/develop" | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI or Dev Repository | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
fetch-depth: '0' | ||
branch: 'develop' | ||
- name: Set up Poetry 📦 | ||
uses: JRubics/poetry-publish@v1.16 | ||
with: | ||
repository-url: ${{ github.ref == 'refs/heads/main' && 'env.PyPI_URL' || ' env.PyPI_DEV_URL' }} | ||
password: ${{ secrets.PYPI_API_TOKEN}} | ||
pypi_token: ${{ secrets.PYPI_API_TOKEN }} | ||
plugins: "poetry-dynamic-versioning" | ||
repository_name: "scraibe" |
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
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,48 @@ | ||
name: Semantic Versioning for Tags | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
bump-version: | ||
if: ${{ github.event.pull_request.merged == true $$ github.event.pull_request.base.ref == 'main' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Bump Version and Tag | ||
run: | | ||
# Fetch the latest tags from the remote | ||
git fetch --tags | ||
# Get the latest tag | ||
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
# Split the latest tag into parts | ||
IFS='.' read -r -a parts <<< "${latest_tag#v}" | ||
# Increment the patch version | ||
major=${parts[0]} | ||
minor=${parts[1]} | ||
patch=${parts[2]} | ||
new_patch=$((patch + 1)) | ||
# Create a new tag | ||
new_tag="v$major.$minor.$new_patch" | ||
echo "Bumping version from $latest_tag to $new_tag" | ||
# Tag the new version | ||
git tag $new_tag | ||
# Configure GitHub token authentication | ||
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git | ||
# Push the new tag to the remote repository | ||
git push origin $new_tag |
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[build-system] | ||
requires = ["poetry-core>=1.8.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] | ||
build-backend = "poetry_dynamic_versioning.backend" | ||
|
||
[tool.poetry] | ||
name = "scraibe" | ||
version = "0.0.0" | ||
description = "Transcription tool for audio files based on Whisper and Pyannote" | ||
authors = ["Schmieder, Jacob <[email protected]>"] | ||
license = "GPL-3.0-or-later" | ||
readme = ["README.md", "LICENSE"] | ||
repository = "https://github.com/JSchmie/ScAIbe" | ||
documentation = "https://jschmie.github.io/ScrAIbe/" | ||
keywords = ["transcription", "audio", "whisper", "pyannote", "speech-to-text", "speech-recognition"] | ||
classifiers = [ | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
'Environment :: GPU :: NVIDIA CUDA :: 12 :: 12.1', | ||
'Topic :: Scientific/Engineering :: Artificial Intelligence' | ||
] | ||
packages = [{include = "scraibe"}] | ||
exclude =[ | ||
"__pycache__", | ||
"*.pyc", | ||
"test" | ||
] | ||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
tqdm = "^4.66.4" | ||
numpy = "^1.26.4" | ||
openai-whisper = "^20231117" | ||
"pyannote.audio" = "^3.2.0" | ||
torch = "^2.3.0" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = "^8.1.1" | ||
|
||
[tool.poetry-dynamic-versioning] | ||
enable = true | ||
vcs = "git" | ||
strict = true | ||
format-jinja = """ | ||
{%- if distance == 0 -%} | ||
{{ serialize_pep440(base) }} | ||
{%- elif branch == 'pyproject.toml' -%} | ||
{{ serialize_pep440(bump_version(base), dev = distance) }} | ||
{%- else -%} | ||
{{ serialize_pep440(bump_version(base), dev=distance, metadata=[commit]) }} | ||
{%- endif -%} | ||
""" | ||
|
||
[tool.poetry.group.docs.dependencies] | ||
sphinx = "^7.3.7" | ||
sphinx-rtd-theme = "^2.0.0" | ||
markdown-it-py = {version = "~3.0.0", extras = ["plugins"]} | ||
myst-parser = "^3.0.1" | ||
mdit-py-plugins = "^0.4.1" | ||
|
||
[tool.poetry.scripts] | ||
scraibe = "scraibe.cli:cli" | ||
|
||
[tool.poetry.extras] | ||
app = ["scraibe-webui"] | ||
|
||
[tool.ruff.lint.extend-per-file-ignores] | ||
"__init__.py" = ["E402","F403",'F401'] | ||
"scraibe/misc.py" = ["E722"] |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "0.0.0" |
Oops, something went wrong.