From 7dd2db0fad7254442e66231605bef64f8dd11e0b Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 08:37:56 +0000 Subject: [PATCH 01/68] added pyproject.toml based on poetry --- .github/workflows/pypi.yml | 1 - pyproject.toml | 69 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 pyproject.toml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 0e73d9a..56d06bf 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -46,7 +46,6 @@ jobs: 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 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5222491 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,69 @@ +[tool.poetry] +name = "scraibe" +version = "0.0.0.0" +description = "Transcription tool for audio files based on Whisper and Pyannote" +authors = ["Schmieder, Jacob "] +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.8" +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) }} +{%- else -%} + {{serialize_pep440(bump_version(base, index=1), dev=timestamp)}} +{%- endif -%} +""" + +[build-system] +requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +build-backend = "poetry_dynamic_versioning.backend" + +[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"] From 3930c4d09e381ca79ca2a75769a03b2369285019 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 08:50:15 +0000 Subject: [PATCH 02/68] removed ruff.toml and includ it to pyproject.toml --- .ruff.toml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .ruff.toml diff --git a/.ruff.toml b/.ruff.toml deleted file mode 100644 index f6be0be..0000000 --- a/.ruff.toml +++ /dev/null @@ -1,2 +0,0 @@ -[lint.extend-per-file-ignores] -"__init__.py" = ["E402","F403"] From fc0c32f1096ed5efb2ab74ae36d1584ac0589e1a Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 08:51:44 +0000 Subject: [PATCH 03/68] removed files in favor of pyproject.toml --- MANIFEST.in | 6 ----- setup.cfg | 32 ------------------------- setup.py | 69 ----------------------------------------------------- 3 files changed, 107 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index e2cb9a8..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -recursive-include scraibe *.py -recursive-include scraibe *.yaml -recursive-exclude test/* -global-include requirements.txt -global-exclude *.pyc -global-exclude __pycache__ diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7ecab8c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,32 +0,0 @@ -[metadata] -name = scraibe -version = attr: scraibe.__version__ -author = Jacob Schmieder -author_email = Jacob.Schmieder@dbfz.de -description = My package description -long_description = file: README.md, file: LICENSE -long_description_content_type = text/markdown; charset=UTF-8; variant=GFM -platforms = Linux -keywords = transcription speech recognition whisper pyannote audio speech-to-text speech-to-text transcription speech-to-text recognition voice-to-speech -license = GPL-3.0 -classifiers = - Development Status :: 3 - Alpha - Environment :: GPU :: NVIDIA CUDA :: 11.2 - License :: OSI Approved :: Open Software License 3.0 (OSL-3.0) - Topic :: Scientific/Engineering :: Artificial Intelligence - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - -[options] -zip_safe = False -include_package_data = True -packages = find: -python_requires = >=3.7 -install_requires = - requests - importlib-metadata; python_version<"3.8" - -[options.entry_points] -console_scripts = - executable-name = scraibe.cli:cli \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 3dfc95e..0000000 --- a/setup.py +++ /dev/null @@ -1,69 +0,0 @@ -import os -from setuptools import setup, find_packages - -module_name = "scraibe" -github_url = "https://github.com/JSchmie/ScAIbe" - -file_dir = os.path.dirname(os.path.realpath(__file__)) -absdir = lambda p: os.path.join(file_dir, p) - -############### versioning ############### -verfile = os.path.abspath(os.path.join(module_name, "version.py")) -version = {"__file__": verfile} - -with open(verfile, "r") as fp: - exec(fp.read(), version) - - -############### setup ############### - -build_version = "SCRAIBE_BUILD" in os.environ - -version["ISRELEASED"] = True if "ISRELEASED" in os.environ else False - -############### load requirements ############### - -with open(os.path.join(os.path.dirname(__file__), "requirements.txt")) as f: - requirements = [line.strip() for line in f if line.strip() and not line.startswith('#')] - - -print(f"Launch Version: {version['get_version'](build_version)}") - -if __name__ == "__main__": - - setup( - name = module_name, - version = version["get_version"](build_version), - packages = find_packages(), - python_requires = ">=3.8", - readme = "README.md", - install_requires = requirements, - extras_require = { - "app" : ["scraibe-webui"], - }, - # dependency_links=[ - # 'https://download.pytorch.org/whl/cu113', - # ], - - url = github_url, - - license = 'GPL-3', - author = 'Jacob Schmieder', - author_email = 'Jacob.Schmieder@dbfz.de', - description = 'Transcription tool for audio files based on Whisper and Pyannote', - classifiers = [ - 'Development Status :: 3 - Alpha', - 'Environment :: GPU :: NVIDIA CUDA :: 11.2', - 'License :: OSI Approved :: Open Software License 3.0 (OSL-3.0)', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10'], - keywords = ['transcription', 'speech recognition', 'whisper', 'pyannote', 'audio', 'ScrAIbe', 'scraibe', - 'speech-to-text', 'speech-to-text transcription', 'speech-to-text recognition', - 'voice-to-speech'], - include_package_data=True, - package_data = {'scraibe.app' : ["*.html", "*.svg","*.yml"]}, - entry_points = {'console_scripts': - ['scraibe = scraibe.cli:cli']} - ) From 4d2fd2dc6b584026af495de7cd6fe079999edc21 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 09:00:02 +0000 Subject: [PATCH 04/68] fullfill pep440 --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5222491..be79efb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,10 @@ +[build-system] +requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +build-backend = "poetry_dynamic_versioning.backend" + [tool.poetry] name = "scraibe" -version = "0.0.0.0" +version = "0.0.0" description = "Transcription tool for audio files based on Whisper and Pyannote" authors = ["Schmieder, Jacob "] license = "GPL-3.0-or-later" @@ -48,10 +52,6 @@ format-jinja = """ {%- endif -%} """ -[build-system] -requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] -build-backend = "poetry_dynamic_versioning.backend" - [tool.poetry.group.docs.dependencies] sphinx = "^7.3.7" sphinx-rtd-theme = "^2.0.0" From fc046ae181f9b47a383e62b77efd05b83a13d65e Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 09:00:43 +0000 Subject: [PATCH 05/68] fullfill pep440 --- scraibe/version.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scraibe/version.py b/scraibe/version.py index 9c4faa5..19a84e0 100644 --- a/scraibe/version.py +++ b/scraibe/version.py @@ -3,10 +3,9 @@ import subprocess as sp MAJOR = 0 MINOR = 1 -MICRO = 1 -NANO = 2 +MICRO = 2 ISRELEASED = False -VERSION = '%d.%d.%d.%d' % (MAJOR, MINOR, MICRO, NANO) +VERSION = '%d.%d.%d.%d' % (MAJOR, MINOR, MICRO) # Return the git revision as a string # taken from numpy/numpy From 95436562bb32d97a7572bff652d8d6b1544d5a72 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 09:02:45 +0000 Subject: [PATCH 06/68] try removed jinja --- pyproject.toml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index be79efb..30964b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,13 +44,6 @@ pytest = "^8.1.1" enable = true vcs = "git" strict = true -format-jinja = """ -{%- if distance == 0 -%} - {{ serialize_pep440(base) }} -{%- else -%} - {{serialize_pep440(bump_version(base, index=1), dev=timestamp)}} -{%- endif -%} -""" [tool.poetry.group.docs.dependencies] sphinx = "^7.3.7" From 69c4291ea78b3baa250149c29beb3126606a5d19 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 09:04:56 +0000 Subject: [PATCH 07/68] added other jinja --- pyproject.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 30964b6..7de3bd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,15 @@ pytest = "^8.1.1" enable = true vcs = "git" strict = true +format-jinja = """ + {%- if distance == 0 -%} + {{ serialize_pep440(base, stage, revision) }} + {%- elif revision is not none -%} + {{ serialize_pep440(base, stage, revision + 1, dev=distance, metadata=[commit]) }} + {%- else -%} + {{ serialize_pep440(bump_version(base), stage, revision, dev=distance, metadata=[commit]) }} + {%- endif -%} +""" [tool.poetry.group.docs.dependencies] sphinx = "^7.3.7" From 047ee3a9bda51c96c505d333010db3419eb73c7b Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 10:19:45 +0000 Subject: [PATCH 08/68] test remove jinja --- pyproject.toml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7de3bd8..ea8eac3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,16 +43,7 @@ pytest = "^8.1.1" [tool.poetry-dynamic-versioning] enable = true vcs = "git" -strict = true -format-jinja = """ - {%- if distance == 0 -%} - {{ serialize_pep440(base, stage, revision) }} - {%- elif revision is not none -%} - {{ serialize_pep440(base, stage, revision + 1, dev=distance, metadata=[commit]) }} - {%- else -%} - {{ serialize_pep440(bump_version(base), stage, revision, dev=distance, metadata=[commit]) }} - {%- endif -%} -""" +style= "pep440" [tool.poetry.group.docs.dependencies] sphinx = "^7.3.7" From 2a291c4c0cc530a0ed230956e5f7c607324f21ec Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 11:04:34 +0000 Subject: [PATCH 09/68] test jinja template --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ea8eac3..59689a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,10 @@ pytest = "^8.1.1" [tool.poetry-dynamic-versioning] enable = true vcs = "git" -style= "pep440" +strict = true +format-jinja = """ + TEST_{{- branch -}}_TEST +""" [tool.poetry.group.docs.dependencies] sphinx = "^7.3.7" From 267261691238f6126c5f810bc258c9c7d051e573 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 11:15:23 +0000 Subject: [PATCH 10/68] readded jijnja again --- pyproject.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 59689a6..7de3bd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,13 @@ enable = true vcs = "git" strict = true format-jinja = """ - TEST_{{- branch -}}_TEST + {%- if distance == 0 -%} + {{ serialize_pep440(base, stage, revision) }} + {%- elif revision is not none -%} + {{ serialize_pep440(base, stage, revision + 1, dev=distance, metadata=[commit]) }} + {%- else -%} + {{ serialize_pep440(bump_version(base), stage, revision, dev=distance, metadata=[commit]) }} + {%- endif -%} """ [tool.poetry.group.docs.dependencies] From 184ef401763b6b6ad54943b5f6aee13c5a1a39f5 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 12:00:13 +0000 Subject: [PATCH 11/68] removed version.py since it is not longer relavant --- scraibe/version.py | 68 ---------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 scraibe/version.py diff --git a/scraibe/version.py b/scraibe/version.py deleted file mode 100644 index 19a84e0..0000000 --- a/scraibe/version.py +++ /dev/null @@ -1,68 +0,0 @@ -import os -import subprocess as sp - -MAJOR = 0 -MINOR = 1 -MICRO = 2 -ISRELEASED = False -VERSION = '%d.%d.%d.%d' % (MAJOR, MINOR, MICRO) - -# Return the git revision as a string -# taken from numpy/numpy -def git_version(): - def _minimal_ext_cmd(cmd): - # construct minimal environment - env = {} - for k in ['SYSTEMROOT', 'PATH', 'HOME']: - v = os.environ.get(k) - if v is not None: - env[k] = v - - # LANGUAGE is used on win32 - env['LANGUAGE'] = 'C' - env['LANG'] = 'C' - env['LC_ALL'] = 'C' - - out = sp.Popen(cmd, stdout=sp.PIPE, stderr=sp.PIPE, env=env).communicate()[0] - return out - - try: - out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) - GIT_REVISION = out.strip().decode('ascii') - except OSError: - GIT_REVISION = "Unknown" - - return GIT_REVISION - -def _get_git_version(): - cwd = os.getcwd() - - # go to the main directory - fdir = os.path.dirname(os.path.abspath(__file__)) - maindir = os.path.abspath(os.path.join(fdir, "..")) - # maindir = fdir # os.path.join(fdir, "..") - os.chdir(maindir) - - # get git version - res = git_version() - - # restore the cwd - os.chdir(cwd) - return res - -def get_version(build_version=False): - if ISRELEASED: - return VERSION - - # unreleased version - GIT_REVISION = _get_git_version() - - if build_version: - import datetime as dt - date = dt.date.strftime(dt.datetime.now(), "%Y%m%d%H%M%S") - return VERSION + ".dev" + date - else: - return VERSION + ".dev0+" + GIT_REVISION[:7] - - - From 6fd24ee39429b9f26f841eb867a08b86389f76f9 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 12:35:18 +0000 Subject: [PATCH 12/68] costume jinja --- pyproject.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7de3bd8..60ac606 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,11 +46,9 @@ vcs = "git" strict = true format-jinja = """ {%- if distance == 0 -%} - {{ serialize_pep440(base, stage, revision) }} - {%- elif revision is not none -%} - {{ serialize_pep440(base, stage, revision + 1, dev=distance, metadata=[commit]) }} + {{ serialize_pep440(base) }} {%- else -%} - {{ serialize_pep440(bump_version(base), stage, revision, dev=distance, metadata=[commit]) }} + {{ serialize_pep440(bump_version(base), dev=distance, metadata=[commit]) }} {%- endif -%} """ From 3d0ca8d1e126608fbb8b5f0b25994361b5829646 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 12:51:19 +0000 Subject: [PATCH 13/68] removed version file from init --- scraibe/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scraibe/__init__.py b/scraibe/__init__.py index 233cd4f..42cd343 100644 --- a/scraibe/__init__.py +++ b/scraibe/__init__.py @@ -4,9 +4,7 @@ from .audio import * from .transcript_exporter import * from .diarisation import * -from .version import get_version as _get_version from .misc import * from .cli import * -__version__ = _get_version() From 267baa139ddeaca3af75c2989efaf71eec739604 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 13 May 2024 12:54:22 +0000 Subject: [PATCH 14/68] added __version__ --- scraibe/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scraibe/__init__.py b/scraibe/__init__.py index 42cd343..fbbd81e 100644 --- a/scraibe/__init__.py +++ b/scraibe/__init__.py @@ -8,3 +8,8 @@ from .misc import * from .cli import * + # set __version__ attribute + +import importlib.metadata + +__version__ = importlib.metadata.version(__package__ or __name__) From fa937c2ed1cfcd87488b24a5ac3c6bf75a197234 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 08:14:39 +0000 Subject: [PATCH 15/68] test what happens --- .github/workflows/pypi.yml | 84 ++++++++------------------------------ 1 file changed, 16 insertions(+), 68 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 56d06bf..974e41c 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,83 +1,31 @@ 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 + - pyproject.toml # test branch for testing the workflow + 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 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 - 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 - with: - name: python-package-distributions - path: dist/ - - name: Publish distribution 📦 to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - skip-existing: true +jobs: + Build-and-publish-to-Test-PyPI: + if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }} + uses: JRubics/poetry-publish@v1.16 + with: + plugins: "poetry-dynamic-versioning" + repository_name: "testpypi" + 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 steps: - name: Set up Python From ab67d7d6954eefee444fde02107707562034c8e0 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 08:16:48 +0000 Subject: [PATCH 16/68] test latest version --- .github/workflows/pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 974e41c..9d7832f 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -16,7 +16,7 @@ on: jobs: Build-and-publish-to-Test-PyPI: if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }} - uses: JRubics/poetry-publish@v1.16 + uses: JRubics/poetry-publish@v2.0 with: plugins: "poetry-dynamic-versioning" repository_name: "testpypi" From 4d31eaa002a6409760a783c92008a164f5ce04b5 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 08:21:38 +0000 Subject: [PATCH 17/68] added checkout --- .github/workflows/pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 9d7832f..773c536 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -15,14 +15,14 @@ on: jobs: Build-and-publish-to-Test-PyPI: + ususes: actions/checkout@v4 if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }} uses: JRubics/poetry-publish@v2.0 with: plugins: "poetry-dynamic-versioning" - repository_name: "testpypi" + repository_name: "scraibe" repository_url: "https://test.pypi.org/legacy/" - test-install: name: Test Installation from TestPyPI needs: Build-and-publish-to-Test-PyPI From dd1739b2c28fd9aff28d586813b6f7fd00cc278d Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 08:25:45 +0000 Subject: [PATCH 18/68] moved uses for checkout --- .github/workflows/pypi.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 773c536..9df81aa 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -14,8 +14,9 @@ on: type: boolean jobs: + uses: actions/checkout@v4 + Build-and-publish-to-Test-PyPI: - ususes: actions/checkout@v4 if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }} uses: JRubics/poetry-publish@v2.0 with: From 54372aeb310842d47c437095faf131854a53264a Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 08:31:32 +0000 Subject: [PATCH 19/68] added steps --- .github/workflows/pypi.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 9df81aa..79d5720 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -14,15 +14,19 @@ on: type: boolean jobs: - uses: actions/checkout@v4 - + Build-and-publish-to-Test-PyPI: - if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }} - uses: JRubics/poetry-publish@v2.0 - with: - plugins: "poetry-dynamic-versioning" - repository_name: "scraibe" - repository_url: "https://test.pypi.org/legacy/" + name: Build and Publish to Test PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Poetry 📦 + if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }} + uses: JRubics/poetry-publish@v2.0 + with: + plugins: "poetry-dynamic-versioning" + repository_name: "scraibe" + repository_url: "https://test.pypi.org/legacy/" test-install: name: Test Installation from TestPyPI From 56aa8a64563e2299fac2bdbc40016a677ac054be Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 08:35:28 +0000 Subject: [PATCH 20/68] less is more --- .github/workflows/pypi.yml | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 79d5720..d3bf886 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -42,23 +42,23 @@ jobs: python3 -m pip install setuptools python3 -m pip install --index-url https://test.pypi.org/simple/ scraibe - publish-to-pypi: - name: Conditional Publish to PyPI or Dev Repository - needs: [build, 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 - with: - name: python-package-distributions - path: dist/ - - name: Publish distribution 📦 to PyPI or Dev Repository - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: ${{ github.ref == 'refs/heads/main' && 'env.PyPI_URL' || ' env.PyPI_DEV_URL' }} - password: ${{ secrets.PYPI_API_TOKEN}} \ No newline at end of file + # publish-to-pypi: + # name: Conditional Publish to PyPI or Dev Repository + # needs: [build, 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 + # with: + # name: python-package-distributions + # path: dist/ + # - name: Publish distribution 📦 to PyPI or Dev Repository + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # repository-url: ${{ github.ref == 'refs/heads/main' && 'env.PyPI_URL' || ' env.PyPI_DEV_URL' }} + # password: ${{ secrets.PYPI_API_TOKEN}} \ No newline at end of file From 0222334a6a7ccbbf38f8db8ec494cb53aaaa5684 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 09:03:26 +0000 Subject: [PATCH 21/68] removed checkout --- .github/workflows/pypi.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index d3bf886..eef8797 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -19,7 +19,6 @@ jobs: name: Build and Publish to Test PyPI runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - name: Set up Poetry 📦 if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }} uses: JRubics/poetry-publish@v2.0 From ea420094eb7459a5f0435b63f22d4d873f253905 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 09:46:46 +0000 Subject: [PATCH 22/68] test odler version of poetry publish --- .github/workflows/pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index eef8797..326caf1 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Set up Poetry 📦 if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }} - uses: JRubics/poetry-publish@v2.0 + uses: JRubics/poetry-publish@v1.16 with: plugins: "poetry-dynamic-versioning" repository_name: "scraibe" From 2c473eaf75f483f1c808b94b6c696394c3eaa0b4 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 09:48:08 +0000 Subject: [PATCH 23/68] added checkout --- .github/workflows/pypi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 326caf1..0da6399 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -19,6 +19,7 @@ jobs: name: Build and Publish to Test PyPI runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Set up Poetry 📦 if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }} uses: JRubics/poetry-publish@v1.16 From 3b0785530bf9cae1ab2a2ba885cf4bc90d0a8c4a Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 10:04:36 +0000 Subject: [PATCH 24/68] test if --- .github/workflows/pypi.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 0da6399..8e2c51c 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -16,10 +16,12 @@ on: jobs: Build-and-publish-to-Test-PyPI: - name: Build and Publish to Test PyPI runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - run: | + echo ${{ github.ref }} + echo ${{ inputs.test }} - name: Set up Poetry 📦 if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }} uses: JRubics/poetry-publish@v1.16 From 9b4a0357ed42c47efc2e4079611c8b4733e7509f Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 10:31:59 +0000 Subject: [PATCH 25/68] test upload ro pypi --- .github/workflows/pypi.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 8e2c51c..2ee2987 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -19,11 +19,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: | - echo ${{ github.ref }} - echo ${{ inputs.test }} - name: Set up Poetry 📦 - if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }} + if: ${{ !(startsWith(github.ref, 'refs/tags'))}} uses: JRubics/poetry-publish@v1.16 with: plugins: "poetry-dynamic-versioning" From 8217ac82a7ed6b2c7ed18587359ee8da4c5fff2e Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 10:47:40 +0000 Subject: [PATCH 26/68] added fetch depth --- .github/workflows/pypi.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 2ee2987..7d2f83d 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -19,6 +19,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: '0' - name: Set up Poetry 📦 if: ${{ !(startsWith(github.ref, 'refs/tags'))}} uses: JRubics/poetry-publish@v1.16 From 254c7ca12d8be9bd110d689e4fc11108d00cddd5 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 11:24:51 +0000 Subject: [PATCH 27/68] downgraded pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 60ac606..639a9c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ format-jinja = """ """ [tool.poetry.group.docs.dependencies] -sphinx = "^7.3.7" +sphinx = "^7.1" sphinx-rtd-theme = "^2.0.0" markdown-it-py = {version = "~3.0.0", extras = ["plugins"]} myst-parser = "^3.0.1" From bc3c8c22fb538bf4e9543f8821c037b248f91226 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 11:27:26 +0000 Subject: [PATCH 28/68] updatet python version since nump requires python 3.9 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 639a9c6..b6f7257 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ exclude =[ "test" ] [tool.poetry.dependencies] -python = "^3.8" +python = "^3.9" tqdm = "^4.66.4" numpy = "^1.26.4" openai-whisper = "^20231117" @@ -53,7 +53,7 @@ format-jinja = """ """ [tool.poetry.group.docs.dependencies] -sphinx = "^7.1" +sphinx = "^7.3.7" sphinx-rtd-theme = "^2.0.0" markdown-it-py = {version = "~3.0.0", extras = ["plugins"]} myst-parser = "^3.0.1" From 728ed42223295d222c244e94398c7fb13e63c3fe Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 11:34:38 +0000 Subject: [PATCH 29/68] added testpypi api token --- .github/workflows/pypi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 7d2f83d..06bbb3a 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -25,6 +25,7 @@ jobs: if: ${{ !(startsWith(github.ref, 'refs/tags'))}} uses: JRubics/poetry-publish@v1.16 with: + pypi_token: ${{ secrets.TEST_PYPI_API_TOKEN }} plugins: "poetry-dynamic-versioning" repository_name: "scraibe" repository_url: "https://test.pypi.org/legacy/" From d1e5b023ff9338477d97e0ca1dd307dd89fe69c1 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 14:06:20 +0000 Subject: [PATCH 30/68] test dynamic versioning on specific branch --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index b6f7257..a236a90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,8 @@ 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 -%} From 9f0a176b266d613cc701d7b882da5106e834a010 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 14:07:59 +0000 Subject: [PATCH 31/68] added string tag --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a236a90..730fb2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ strict = true format-jinja = """ {%- if distance == 0 -%} {{ serialize_pep440(base) }} - {%- elif branch == pyproject.toml -%} + {%- elif branch == 'pyproject.toml' -%} {{ serialize_pep440(bump_version(base), dev = distance) }} {%- else -%} {{ serialize_pep440(bump_version(base), dev=distance, metadata=[commit]) }} From 2577f347d1da51c56687ad74984bf53b11d14fd7 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Wed, 15 May 2024 16:23:47 +0000 Subject: [PATCH 32/68] added first test for a nighlty build --- .github/workflows/pypi.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 06bbb3a..9181e65 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -21,8 +21,13 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: '0' + - name: Setup package Name + if: ${{ github.ref_name == 'pyproject.toml'}} + run: | + sed -i 's/name = "scraibe"/name = "scraibe-nightly"/' pyproject.toml + echo "You are running on the develop branch deploying to nightly!" - name: Set up Poetry 📦 - if: ${{ !(startsWith(github.ref, 'refs/tags'))}} + if: ${{ !(startsWith(github.ref, 'refs/tags')) }} uses: JRubics/poetry-publish@v1.16 with: pypi_token: ${{ secrets.TEST_PYPI_API_TOKEN }} From 5918458d473e62445e1e9ef1103812fdfe5646ec Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 07:13:02 +0000 Subject: [PATCH 33/68] try get scraibe version for later test install --- .github/workflows/pypi.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 9181e65..dd49ce9 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -14,18 +14,12 @@ on: type: boolean jobs: - Build-and-publish-to-Test-PyPI: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: '0' - - name: Setup package Name - if: ${{ github.ref_name == 'pyproject.toml'}} - run: | - sed -i 's/name = "scraibe"/name = "scraibe-nightly"/' pyproject.toml - echo "You are running on the develop branch deploying to nightly!" - name: Set up Poetry 📦 if: ${{ !(startsWith(github.ref, 'refs/tags')) }} uses: JRubics/poetry-publish@v1.16 @@ -34,6 +28,17 @@ jobs: plugins: "poetry-dynamic-versioning" repository_name: "scraibe" repository_url: "https://test.pypi.org/legacy/" + - name: Get the version + run: | + echo "SCRAIBE_VERSION=$(python -c 'import scraibe; print(scraibe.__version__)')" >> $GITHUB_ENV + echo "SCRAIBE_VERSION=$SCRAIBE_VERSION" + - name: 'Upload Artifact' + uses: actions/upload-artifact@v4 + with: + name: build + path: ./sdist + retention-days: 5 + test-install: name: Test Installation from TestPyPI From 21052df03a9449600079bb1875b7e816d6d1322e Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 07:29:43 +0000 Subject: [PATCH 34/68] added version from wheel --- .github/workflows/pypi.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index dd49ce9..73e23be 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -28,10 +28,13 @@ jobs: plugins: "poetry-dynamic-versioning" repository_name: "scraibe" repository_url: "https://test.pypi.org/legacy/" - - name: Get the version + - name: Get the version from wheel run: | - echo "SCRAIBE_VERSION=$(python -c 'import scraibe; print(scraibe.__version__)')" >> $GITHUB_ENV - echo "SCRAIBE_VERSION=$SCRAIBE_VERSION" + WHEEL_FILE=$(find dist -name "*.whl" | head -n 1) + VERSION=$(python -c "from pkginfo import Wheel; w = Wheel('$WHEEL_FILE'); print(w.version)") + echo "SCRAIBE_VERSION=$VERSION" >> $GITHUB_ENV + echo "SCRAIBE_VERSION=$VERSION" + - name: 'Upload Artifact' uses: actions/upload-artifact@v4 with: From ab2cbbbd69176fbd9382d98db55562019e6133c7 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 07:37:03 +0000 Subject: [PATCH 35/68] try to activate venv --- .github/workflows/pypi.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 73e23be..4141ecf 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -28,12 +28,21 @@ jobs: plugins: "poetry-dynamic-versioning" repository_name: "scraibe" repository_url: "https://test.pypi.org/legacy/" - - name: Get the version from wheel + + - name: List virtual environments + run: ls -la /github/home/.cache/pypoetry/virtualenvs + + - name: Get the virtual environment path + run: echo "VENV_PATH=$(ls -d /github/home/.cache/pypoetry/virtualenvs/*)" >> $GITHUB_ENV + + - name: Activate the virtual environment and get version run: | - WHEEL_FILE=$(find dist -name "*.whl" | head -n 1) - VERSION=$(python -c "from pkginfo import Wheel; w = Wheel('$WHEEL_FILE'); print(w.version)") + source $VENV_PATH/bin/activate + VERSION=$(python -c "import scraibe; print(scraibe.__version__)") echo "SCRAIBE_VERSION=$VERSION" >> $GITHUB_ENV echo "SCRAIBE_VERSION=$VERSION" + env: + VENV_PATH: ${{ env.VENV_PATH }} - name: 'Upload Artifact' uses: actions/upload-artifact@v4 From 35b5682d968b20b818c4ddd0a6d2b3a270c8c260 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 07:42:44 +0000 Subject: [PATCH 36/68] try to find venv --- .github/workflows/pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 4141ecf..aaa8c26 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -33,7 +33,7 @@ jobs: run: ls -la /github/home/.cache/pypoetry/virtualenvs - name: Get the virtual environment path - run: echo "VENV_PATH=$(ls -d /github/home/.cache/pypoetry/virtualenvs/*)" >> $GITHUB_ENV + run: echo "VENV_PATH=$(ls -d $HOME/.cache/pypoetry/virtualenvs/* | head -n 1)" >> $GITHUB_ENV - name: Activate the virtual environment and get version run: | From 7e800294e9eed072da77f9e3c5380217b710596e Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 08:00:15 +0000 Subject: [PATCH 37/68] check what is there --- .github/workflows/pypi.yml | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index aaa8c26..a85e026 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -28,28 +28,8 @@ jobs: plugins: "poetry-dynamic-versioning" repository_name: "scraibe" repository_url: "https://test.pypi.org/legacy/" - - - name: List virtual environments - run: ls -la /github/home/.cache/pypoetry/virtualenvs - - - name: Get the virtual environment path - run: echo "VENV_PATH=$(ls -d $HOME/.cache/pypoetry/virtualenvs/* | head -n 1)" >> $GITHUB_ENV - - - name: Activate the virtual environment and get version - run: | - source $VENV_PATH/bin/activate - VERSION=$(python -c "import scraibe; print(scraibe.__version__)") - echo "SCRAIBE_VERSION=$VERSION" >> $GITHUB_ENV - echo "SCRAIBE_VERSION=$VERSION" - env: - VENV_PATH: ${{ env.VENV_PATH }} - - - name: 'Upload Artifact' - uses: actions/upload-artifact@v4 - with: - name: build - path: ./sdist - retention-days: 5 + - name: Get list of available folders after checkout + run: ls -l test-install: From 542526b64359913db5942bcb31022059924bbe26 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 08:03:14 +0000 Subject: [PATCH 38/68] list source folder --- .github/workflows/pypi.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index a85e026..2e25907 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -29,7 +29,9 @@ jobs: repository_name: "scraibe" repository_url: "https://test.pypi.org/legacy/" - name: Get list of available folders after checkout - run: ls -l + run: | + cd source + ls -l test-install: From 3fbcc52a5ce8bea97d282220de7500edbdc20c6e Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 09:24:23 +0000 Subject: [PATCH 39/68] added tests --- .github/workflows/pypi.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 2e25907..d4c9032 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -21,18 +21,12 @@ jobs: with: fetch-depth: '0' - name: Set up Poetry 📦 - if: ${{ !(startsWith(github.ref, 'refs/tags')) }} uses: JRubics/poetry-publish@v1.16 with: pypi_token: ${{ secrets.TEST_PYPI_API_TOKEN }} plugins: "poetry-dynamic-versioning" repository_name: "scraibe" repository_url: "https://test.pypi.org/legacy/" - - name: Get list of available folders after checkout - run: | - cd source - ls -l - test-install: name: Test Installation from TestPyPI From 63f56659c159c7195498401806e93a9225732f00 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 09:53:24 +0000 Subject: [PATCH 40/68] debug tagging --- .github/workflows/pypi.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index d4c9032..d33ddb9 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -14,6 +14,19 @@ on: type: boolean jobs: + check-tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Check if tag is present + run: | + if [ -z "$GITHUB_REF" ]; then + echo "No tag found" + exit 1 + fi + echo "Tag found: $GITHUB_REF" Build-and-publish-to-Test-PyPI: runs-on: ubuntu-latest steps: From 760b525b177bbf5235e7cf465da175b052aae796 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 10:19:15 +0000 Subject: [PATCH 41/68] added setuptools to requires --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 730fb2b..593789b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +requires = ["setuptools", "poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] build-backend = "poetry_dynamic_versioning.backend" [tool.poetry] From 61d543440253122bacb7dc9240105870136b6ae3 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 11:19:21 +0000 Subject: [PATCH 42/68] try newer poetry version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 593789b..f11138e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +requires = ["poetry-core>=1.8.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] build-backend = "poetry_dynamic_versioning.backend" [tool.poetry] From 74eaefa47cb7f429bd7522b4039f9aaab3ff6914 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 11:28:00 +0000 Subject: [PATCH 43/68] debut installation --- .github/workflows/pypi.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index d33ddb9..c8298da 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -14,19 +14,6 @@ on: type: boolean jobs: - check-tag: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: '0' - - name: Check if tag is present - run: | - if [ -z "$GITHUB_REF" ]; then - echo "No tag found" - exit 1 - fi - echo "Tag found: $GITHUB_REF" Build-and-publish-to-Test-PyPI: runs-on: ubuntu-latest steps: @@ -52,6 +39,8 @@ jobs: python-version: "3.x" - name: Install package run: | + which python3 + python3 -m pip install -U pip python3 -m pip install setuptools python3 -m pip install --index-url https://test.pypi.org/simple/ scraibe From 7cf078ed60589d8892fda05e817128d42ad46435 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Thu, 16 May 2024 11:49:18 +0000 Subject: [PATCH 44/68] added matrix --- .github/workflows/pypi.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index c8298da..1c55f95 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -32,11 +32,14 @@ jobs: name: Test Installation from TestPyPI needs: Build-and-publish-to-Test-PyPI runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9, 3.10, 3.11, 3.12] steps: - - name: Set up Python + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: "3.x" + python-version: ${{ matrix.python-version }} - name: Install package run: | which python3 @@ -44,6 +47,7 @@ jobs: python3 -m pip install setuptools python3 -m pip install --index-url https://test.pypi.org/simple/ scraibe + # publish-to-pypi: # name: Conditional Publish to PyPI or Dev Repository # needs: [build, test-install] From d9750c17d350346e52cdb1e33b0222bce116b980 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 17 May 2024 10:03:35 +0000 Subject: [PATCH 45/68] try to update wheel --- .github/workflows/pypi.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 1c55f95..9ee3bc8 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -42,9 +42,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install package run: | - which python3 - python3 -m pip install -U pip - python3 -m pip install setuptools + python3 -m pip install -U pip setuptools wheel python3 -m pip install --index-url https://test.pypi.org/simple/ scraibe From 131d7fdb23b8c22c4e5dc4ab223f1a5ae6fa7221 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 17 May 2024 11:25:50 +0000 Subject: [PATCH 46/68] update setup-python --- .github/workflows/pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 9ee3bc8..11aa476 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -34,10 +34,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9, 3.10, 3.11, 3.12] + python-version: [3.9, 3.11, 3.12] steps: - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install package From b92c6d8e391f8e44549d95ab7aeefc300a6b129f Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 17 May 2024 12:07:14 +0000 Subject: [PATCH 47/68] removed extra install --- .github/workflows/pypi.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 11aa476..0f1ae85 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -42,8 +42,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install package run: | - python3 -m pip install -U pip setuptools wheel - python3 -m pip install --index-url https://test.pypi.org/simple/ scraibe + python3 -m pip install -U --index-url https://test.pypi.org/simple/ scraibe # publish-to-pypi: From 85fa9deb96558700a66ebb3a81021f5e520e6cc4 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 17 May 2024 12:13:25 +0000 Subject: [PATCH 48/68] force latest version --- .github/workflows/pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 0f1ae85..c810ea4 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -42,7 +42,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install package run: | - python3 -m pip install -U --index-url https://test.pypi.org/simple/ scraibe + python3 -m pip install -U --index-url https://test.pypi.org/simple/ scraibe>=0.1.3 # publish-to-pypi: From 3fdb9ecf81282b9d06ad4eaa62e1af3ad2977170 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 17 May 2024 12:50:46 +0000 Subject: [PATCH 49/68] changed __version__ --- scraibe/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scraibe/__init__.py b/scraibe/__init__.py index fbbd81e..9f93efc 100644 --- a/scraibe/__init__.py +++ b/scraibe/__init__.py @@ -10,6 +10,4 @@ from .cli import * # set __version__ attribute -import importlib.metadata - -__version__ = importlib.metadata.version(__package__ or __name__) +__version__ = "0.0.0" From 3e9ca434d717bd3a4bb7a5592aa9bd3ce0491ec4 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 17 May 2024 13:05:25 +0000 Subject: [PATCH 50/68] added _version.py file --- pyproject.toml | 1 + scraibe/_version.py | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 scraibe/_version.py diff --git a/pyproject.toml b/pyproject.toml index f11138e..8a62014 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,3 +69,4 @@ app = ["scraibe-webui"] [tool.ruff.lint.extend-per-file-ignores] "__init__.py" = ["E402","F403"] +"scraibe/misc.py" = ["E722"] diff --git a/scraibe/_version.py b/scraibe/_version.py new file mode 100644 index 0000000..3ab50aa --- /dev/null +++ b/scraibe/_version.py @@ -0,0 +1,3 @@ + # set __version__ attribute + +__version__ = "0.0.0" \ No newline at end of file From f5be9c87bba5c263d7e71832c0298744748992dc Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 17 May 2024 13:31:17 +0000 Subject: [PATCH 51/68] added specific file for version --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 8a62014..d53542d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,8 @@ format-jinja = """ {{ serialize_pep440(bump_version(base), dev=distance, metadata=[commit]) }} {%- endif -%} """ +[tool.poetry-dynamic-versioning.substitution] +files = ["scraibe/_version.py"] [tool.poetry.group.docs.dependencies] sphinx = "^7.3.7" From 10f74c2e1da58a3595354fabd9476bee082ce11f Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 17 May 2024 13:49:15 +0000 Subject: [PATCH 52/68] removed line --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d53542d..8a62014 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,8 +53,6 @@ format-jinja = """ {{ serialize_pep440(bump_version(base), dev=distance, metadata=[commit]) }} {%- endif -%} """ -[tool.poetry-dynamic-versioning.substitution] -files = ["scraibe/_version.py"] [tool.poetry.group.docs.dependencies] sphinx = "^7.3.7" From 88d826db8436d9db3337e20aa31e8fdd03b4af6d Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 17 May 2024 13:57:10 +0000 Subject: [PATCH 53/68] install req from file --- .github/workflows/pypi.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index c810ea4..aa9edaf 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -42,7 +42,9 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install package run: | - python3 -m pip install -U --index-url https://test.pypi.org/simple/ scraibe>=0.1.3 + pip install -U setuptools + pip install -r requirements.txt + python3 -m pip install --no-deps --index-url https://test.pypi.org/simple/ scraibe>=0.1.3 # publish-to-pypi: From d43a7863c3fd0adbca72cfda7791967f5962c63a Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 17 May 2024 14:00:45 +0000 Subject: [PATCH 54/68] added checkout for test section --- .github/workflows/pypi.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index aa9edaf..25d1e2d 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -36,6 +36,7 @@ jobs: matrix: python-version: [3.9, 3.11, 3.12] steps: + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -44,7 +45,7 @@ jobs: run: | pip install -U setuptools pip install -r requirements.txt - python3 -m pip install --no-deps --index-url https://test.pypi.org/simple/ scraibe>=0.1.3 + python3 -m pip install --no-deps --pre --index-url https://test.pypi.org/simple/ scraibe>=0.1.3 # publish-to-pypi: From 54ef452051c6f2ebe6eb509127582fe35fcca09c Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 07:48:49 +0000 Subject: [PATCH 55/68] updated version --- .github/workflows/pypi.yml | 2 +- .github/workflows/pytest.yaml | 7 +------ scraibe/__init__.py | 7 +++---- scraibe/_version.py | 2 -- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 25d1e2d..f9a7ba1 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -46,7 +46,7 @@ jobs: 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 -m -c "import scraibe; print(scraibe.__version__)" # publish-to-pypi: # name: Conditional Publish to PyPI or Dev Repository diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 973571f..a1b0234 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -1,8 +1,6 @@ name: Run Tests on: - #push: - pull_request: branches: ['main', 'develop'] workflow_dispatch: @@ -30,10 +28,7 @@ jobs: sudo apt-get install libsndfile1-dev sudo apt-get install ffmpeg pip install pytest - - - - + - name: Run pytest env: HF_TOKEN : ${{ secrets.HF_TOKEN }} diff --git a/scraibe/__init__.py b/scraibe/__init__.py index 9f93efc..4338879 100644 --- a/scraibe/__init__.py +++ b/scraibe/__init__.py @@ -7,7 +7,6 @@ from .diarisation import * from .misc import * from .cli import * - - # set __version__ attribute - -__version__ = "0.0.0" + +from ._version import __version__ + diff --git a/scraibe/_version.py b/scraibe/_version.py index 3ab50aa..3aa0d7b 100644 --- a/scraibe/_version.py +++ b/scraibe/_version.py @@ -1,3 +1 @@ - # set __version__ attribute - __version__ = "0.0.0" \ No newline at end of file From 16b517fa8ff784fd60a6c30902331bc110427d2f Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 07:54:16 +0000 Subject: [PATCH 56/68] added semantic versioning --- .github/semver.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/semver.yml diff --git a/.github/semver.yml b/.github/semver.yml new file mode 100644 index 0000000..a351a3d --- /dev/null +++ b/.github/semver.yml @@ -0,0 +1,22 @@ +# .github/workflows/release.yml +name: Release + +on: + pull_request: + types: [closed] + +jobs: + build: + runs-on: ubuntu-latest + + if: github.event.pull_request.merged + + steps: + - name: Tag + uses: K-Phoen/semver-release-action@master + with: + release_branch: pyproject.toml + release_strategy: none + + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} From d4b328775e21fc6e34cd0b3a7886f71de16a3522 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 07:58:36 +0000 Subject: [PATCH 57/68] test semantic versioning --- .github/semver.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/semver.yml b/.github/semver.yml index a351a3d..5d7d05c 100644 --- a/.github/semver.yml +++ b/.github/semver.yml @@ -1,9 +1,8 @@ -# .github/workflows/release.yml -name: Release +name: Semantic Versioning -on: - pull_request: - types: [closed] +on: push + # pull_request: + # types: [closed] jobs: build: @@ -17,6 +16,5 @@ jobs: with: release_branch: pyproject.toml release_strategy: none - env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} From 952594929bb57e41f811534396d2786072f5a074 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 07:59:40 +0000 Subject: [PATCH 58/68] moved to workflow folder --- .github/{ => workflows}/semver.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/semver.yml (100%) diff --git a/.github/semver.yml b/.github/workflows/semver.yml similarity index 100% rename from .github/semver.yml rename to .github/workflows/semver.yml From f522d76605ec8f7d4a83fc4fb35b7e362343d3f5 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 08:00:20 +0000 Subject: [PATCH 59/68] test ci --- .github/workflows/semver.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/semver.yml b/.github/workflows/semver.yml index 5d7d05c..0c357a2 100644 --- a/.github/workflows/semver.yml +++ b/.github/workflows/semver.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest - if: github.event.pull_request.merged + # if: github.event.pull_request.merged steps: - name: Tag From 759732f9538af88d3bda0d082e1f18f62791d1e9 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 08:02:24 +0000 Subject: [PATCH 60/68] removed checks --- .github/workflows/semver.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/semver.yml b/.github/workflows/semver.yml index 0c357a2..bddcdf0 100644 --- a/.github/workflows/semver.yml +++ b/.github/workflows/semver.yml @@ -6,15 +6,12 @@ on: push jobs: build: - runs-on: ubuntu-latest - - # if: github.event.pull_request.merged - + runs-on: ubuntu-latest steps: - name: Tag uses: K-Phoen/semver-release-action@master with: - release_branch: pyproject.toml + release_branch: test_semver release_strategy: none env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} From 932fc5dfb69d60d13040cf1422ee07a52911a0df Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 08:42:13 +0000 Subject: [PATCH 61/68] make my own version bumper --- .github/workflows/semver.yml | 53 ++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/.github/workflows/semver.yml b/.github/workflows/semver.yml index bddcdf0..fbe4acb 100644 --- a/.github/workflows/semver.yml +++ b/.github/workflows/semver.yml @@ -1,17 +1,46 @@ -name: Semantic Versioning +name: Semantic Versioning for Tags -on: push - # pull_request: - # types: [closed] +on: + push: + branches: + - test_semserver jobs: - build: - runs-on: ubuntu-latest + bump-version: + runs-on: ubuntu-latest steps: - - name: Tag - uses: K-Phoen/semver-release-action@master + - name: Checkout Repository + uses: actions/checkout@v4 with: - release_branch: test_semver - release_strategy: none - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + 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 From e2d1deefdb970465a40d1fd3f68c5d4444d4b5dd Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 08:43:04 +0000 Subject: [PATCH 62/68] select branch --- .github/workflows/semver.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/semver.yml b/.github/workflows/semver.yml index fbe4acb..1c93b78 100644 --- a/.github/workflows/semver.yml +++ b/.github/workflows/semver.yml @@ -3,7 +3,7 @@ name: Semantic Versioning for Tags on: push: branches: - - test_semserver + - test_semver jobs: bump-version: From cd0b66c0b85029b1a8fa1d3b98ba860ea4385dd6 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 08:56:28 +0000 Subject: [PATCH 63/68] now just runs on merge to main --- .github/workflows/semver.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/semver.yml b/.github/workflows/semver.yml index 1c93b78..c6d5fb1 100644 --- a/.github/workflows/semver.yml +++ b/.github/workflows/semver.yml @@ -1,12 +1,14 @@ name: Semantic Versioning for Tags on: - push: + pull_request: + types: [closed] branches: - - test_semver + - 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 From ef1f176852b26739c2aaf215e0ad6f113c63f7f1 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 09:18:15 +0000 Subject: [PATCH 64/68] added realese to pypi --- .github/workflows/pypi.yml | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index f9a7ba1..4e5d905 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -3,7 +3,7 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI on: push: branches: - - pyproject.toml # test branch for testing the workflow + - develop branch to create pre-release tags: - v* # Push tags to trigger the workflow workflow_dispatch: @@ -46,25 +46,19 @@ jobs: 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 -m -c "import scraibe; print(scraibe.__version__)" + python3 -c "import scraibe; print(scraibe.__version__)" - # publish-to-pypi: - # name: Conditional Publish to PyPI or Dev Repository - # needs: [build, 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 - # with: - # name: python-package-distributions - # path: dist/ - # - name: Publish distribution 📦 to PyPI or Dev Repository - # uses: pypa/gh-action-pypi-publish@release/v1 - # with: - # repository-url: ${{ github.ref == 'refs/heads/main' && 'env.PyPI_URL' || ' env.PyPI_DEV_URL' }} - # password: ${{ secrets.PYPI_API_TOKEN}} \ No newline at end of file + publish-to-pypi: + name: Publish to PyPI + needs: test-install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Set up Poetry 📦 + uses: JRubics/poetry-publish@v1.16 + with: + pypi_token: ${{ secrets.PYPI_API_TOKEN }} + plugins: "poetry-dynamic-versioning" + repository_name: "scraibe" \ No newline at end of file From de3eaba50a4b01e8fa3b29955187713484d471a5 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 09:37:43 +0000 Subject: [PATCH 65/68] added develop branch properly. Added checkout rules to enshure the right thing is published --- .github/workflows/pypi.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 4e5d905..451aba8 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -3,7 +3,7 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI on: push: branches: - - develop branch to create pre-release + - develop tags: - v* # Push tags to trigger the workflow workflow_dispatch: @@ -53,9 +53,18 @@ jobs: needs: test-install runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - 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: + fetch-depth: '0' + branch: 'develop' - name: Set up Poetry 📦 uses: JRubics/poetry-publish@v1.16 with: From 828cec39f497c7e0707c7ea7848704c017d2e8b0 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 11:07:25 +0000 Subject: [PATCH 66/68] make Ruff happy --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8a62014..b850f63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,5 +68,5 @@ scraibe = "scraibe.cli:cli" app = ["scraibe-webui"] [tool.ruff.lint.extend-per-file-ignores] -"__init__.py" = ["E402","F403"] +"__init__.py" = ["E402","F403",'F401'] "scraibe/misc.py" = ["E722"] From 1789d0d23900cde533d825930af9dd6cca7bef9d Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 11:10:59 +0000 Subject: [PATCH 67/68] make ruff even more happy --- .github/workflows/ruff.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index c8a0958..271e0b4 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -3,6 +3,7 @@ on: [ push, pull_request ] jobs: ruff: runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push') }} steps: - uses: actions/checkout@v4 - uses: chartboost/ruff-action@v1 \ No newline at end of file From ea216a26254069eb77724d2e193167e19cae9d81 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 21 May 2024 11:21:54 +0000 Subject: [PATCH 68/68] ake dunamai happy --- .github/workflows/pytest.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index a1b0234..aac8afe 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -12,6 +12,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Setup Python uses: actions/setup-python@v3