From f5ef26432bc50b70c159d081421d8fd8c7f706f8 Mon Sep 17 00:00:00 2001 From: Till Hanke Date: Mon, 1 Jul 2024 15:20:17 +0200 Subject: [PATCH 01/25] add num-speakers as cmdline option to scraibe --- scraibe/cli.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scraibe/cli.py b/scraibe/cli.py index ee40c8b..c85e985 100644 --- a/scraibe/cli.py +++ b/scraibe/cli.py @@ -79,6 +79,8 @@ def cli(): choices=sorted( LANGUAGES.keys()) + sorted([k.title() for k in TO_LANGUAGE_CODE.keys()]), help="Language spoken in the audio. Specify None to perform language detection.") + parser.add_argument("--num-speakers", type=int, default=2, + help="Number of speakers in the audio.") args = parser.parse_args() @@ -117,8 +119,13 @@ def cli(): else: task = "transcribe" - out = model.autotranscribe(audio, task=task, language=arg_dict.pop( - "language"), verbose=arg_dict.pop("verbose_output")) + out = model.autotranscribe( + audio, + task=task, + language=arg_dict.pop("language"), + verbose=arg_dict.pop("verbose_output"), + num_speakers=arg_dict.pop("num_speakers") + ) basename = audio.split("/")[-1].split(".")[0] print(f'Saving {basename}.{out_format} to {out_folder}') out.save(os.path.join( From 0ce75f0e1d95de0055b76ae056dd250d36754bf3 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 30 Aug 2024 08:34:09 +0000 Subject: [PATCH 02/25] updated conditon to be triggert on. Adjusted if conditions of jobs --- .github/workflows/pypi.yml | 47 +++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index a76369e..88c4521 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,24 +1,35 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI on: - pull_request: - types: [closed] + pull_request_target: branches: - develop - - main + types: + - closed + push: + tags: + - 'v*.*.*' + workflow_dispatch: inputs: - job: - description: "Select job to run" - required: true - type: choice - options: - - Build-and-publish-to-Test-PyPI - - test-install - - publish-to-pypi + test: + description: "Run tests" + default: true + type: boolean + publish_to_pypi: + description: "Publish to PyPI" + default: false + type: boolean jobs: Build-and-publish-to-Test-PyPI: + if: | + (github.event_name == 'workflow_dispatch' && + github.event.inputs.test == 'true') || + (github.event_name == 'pull_request_target' && + github.event.pull_request.merged && + contains(github.event.pull_request.labels.*.name, 'release')) || + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -32,7 +43,7 @@ jobs: repository_name: "scraibe" repository_url: "https://test.pypi.org/legacy/" - test-install: + Test-PyPi-install: name: Test Installation from TestPyPI needs: Build-and-publish-to-Test-PyPI runs-on: ubuntu-latest @@ -54,8 +65,18 @@ jobs: publish-to-pypi: name: Publish to PyPI - needs: test-install + needs: Test-PyPi-install runs-on: ubuntu-latest + if: | + always() && + (( needs.Build-and-publish-to-Test-PyPI.result != 'failure' && + needs.Test-PyPi-install.result != 'failure' ) && + ((github.event_name == 'workflow_dispatch' && + github.event.inputs.publish_to_pypi == 'true') || + (github.event_name == 'pull_request_target' && + github.event.pull_request.merged && + contains(github.event.pull_request.labels.*.name, 'release')) || + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')))) steps: - name: Checkout Repository Tags uses: actions/checkout@v4 From a52ac60b5eb947c06c7f5f68cf10872496c6a08e Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 30 Aug 2024 08:34:22 +0000 Subject: [PATCH 03/25] removed old workflow --- .github/workflows/manuel_publish.yml | 29 ---------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/manuel_publish.yml diff --git a/.github/workflows/manuel_publish.yml b/.github/workflows/manuel_publish.yml deleted file mode 100644 index 7e5fecc..0000000 --- a/.github/workflows/manuel_publish.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Manual Publish to PyPI - -on: - workflow_dispatch: - inputs: - branch: - description: 'Branch to check out (main or develop)' - required: true - type: choice - options: - - main - - develop - -jobs: - publish-to-pypi: - name: Publish to PyPI - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: '0' - ref: ${{ github.event.inputs.branch }} - - name: Set up Poetry 📦 - uses: JRubics/poetry-publish@v1.16 - with: - pypi_token: ${{ secrets.PYPI_API_TOKEN }} - plugins: "poetry-dynamic-versioning" - repository_name: "scraibe" From 8396c1ad95dc078e3a5471d896217c8200e1d600 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 30 Aug 2024 08:35:04 +0000 Subject: [PATCH 04/25] removed old workflow --- .github/workflows/semver.yml | 111 ----------------------------------- 1 file changed, 111 deletions(-) delete mode 100644 .github/workflows/semver.yml diff --git a/.github/workflows/semver.yml b/.github/workflows/semver.yml deleted file mode 100644 index 88565c3..0000000 --- a/.github/workflows/semver.yml +++ /dev/null @@ -1,111 +0,0 @@ -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: Check if Source Branch is docs - id: check_docs_branch - run: | - pr_head_ref="${{ github.event.pull_request.head.ref }}" - if [[ "$pr_head_ref" == "docs" ]]; then - echo "is_docs_branch=true" >> $GITHUB_ENV - echo "This is a docs branch merge. Exiting without creating a tag." - exit 0 - else - echo "is_docs_branch=false" >> $GITHUB_ENV - fi - - - name: Bump Version and Tag - if: env.is_docs_branch != 'true' - id: bump_version - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - run: | - # Fetch the latest tags from the remote - git fetch --tags - - # Get the latest tag, or initialize to v0.0.0 if no tags are found - latest_tag=$(git describe --tags `git rev-list --tags --max-count=1` 2>/dev/null || echo "v0.0.0") - - # Extract version from PR title or body - pr_body="${{ github.event.pull_request.body }}" - pr_title="${{ github.event.pull_request.title }}" - version_regex="v([0-9]+)\.([0-9]+)\.([0-9]+)" - - if [[ $pr_body =~ $version_regex ]]; then - major=${BASH_REMATCH[1]} - minor=${BASH_REMATCH[2]} - patch=${BASH_REMATCH[3]} - new_tag="v$major.$minor.$patch" - elif [[ $pr_title =~ $version_regex ]]; then - major=${BASH_REMATCH[1]} - minor=${BASH_REMATCH[2]} - patch=${BASH_REMATCH[3]} - new_tag="v$major.$minor.$patch" - else - # Split the latest tag into parts - IFS='.' read -r -a parts <<< "${latest_tag#v}" - major=${parts[0]} - minor=${parts[1]} - patch=${parts[2]} - patch=$((patch + 1)) - new_tag="v$major.$minor.$patch" - fi - - echo "Bumping version from $latest_tag to $new_tag" - - # Set the new tag as an environment variable - echo "new_tag=$new_tag" >> $GITHUB_ENV - - # 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 - - - name: Extract Release Notes - if: env.is_docs_branch != 'true' - id: extract_notes - run: | - version="${{ env.new_tag }}" - clean_version="${version#v}" - release_notes=$(awk -v version="$clean_version" ' - BEGIN { flag=0 } - # Start flagging when the version section is found - /^## \[.*\]/ { - if (flag) exit # Exit when the next section starts - } - /^## \['"$clean_version"'\]/ { flag=1; next } # Start printing after the header - flag { print } # Print lines while flag is 1 - ' CHANGELOG.md) - echo "RELEASE_NOTES<> $GITHUB_ENV - echo "$release_notes" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - name: Create Release - if: env.is_docs_branch != 'true' - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - with: - tag_name: ${{ env.new_tag }} - release_name: Release ${{ env.new_tag }} - body: ${{ env.RELEASE_NOTES }} - draft: false - prerelease: false From 84dd2d346535caa45a47574649537194d5f30920 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 30 Aug 2024 08:37:29 +0000 Subject: [PATCH 05/25] added release workflow --- .github/workflows/release_on_tag.yaml | 72 +++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/release_on_tag.yaml diff --git a/.github/workflows/release_on_tag.yaml b/.github/workflows/release_on_tag.yaml new file mode 100644 index 0000000..87fe515 --- /dev/null +++ b/.github/workflows/release_on_tag.yaml @@ -0,0 +1,72 @@ +name: release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + build-on-workflow: + runs-on: ubuntu-latest + if: | + github.event_name == 'workflow_run' && + github.event.workflow_run.conclusion == 'success' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Ensure all history is fetched + ref: main + + - name: Get Latest Tag + id: get-latest-tag + if: + run: | + git fetch --tags + latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) + echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT + + - name: Release from Workflow Run + if: | + github.event_name == 'workflow_run' && + github.event.workflow_run.conclusion == 'success' + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + append_body: true + tag_name: ${{ steps.get-latest-tag.outputs.latest_tag }} + + build-on-tag: + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Ensure all history is fetched + ref: main + - name: Release from Tag Push + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + append_body: true + + write_changelog: + runs-on: ubuntu-latest + needs: [build-on-workflow, build-on-tag] + if: | + always() && + (needs.build-on-workflow.result == 'success' || needs.build-on-tag.result == 'success' ) + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Ensure all history is fetched + ref: main + + - name: Write CHANGELOG.md + uses: rhysd/changelog-from-release/action@v3 + with: + file: CHANGELOG.md + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 7e4315ac72f300772b82f2a18fbeb42e93ae17d6 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 30 Aug 2024 08:42:02 +0000 Subject: [PATCH 06/25] add auto labeling for pr --- .github/auto_label_pr.yml | 51 +++++++++++++++++++++++++++++ .github/workflows/autolabel-pr.yaml | 22 +++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/auto_label_pr.yml create mode 100644 .github/workflows/autolabel-pr.yaml diff --git a/.github/auto_label_pr.yml b/.github/auto_label_pr.yml new file mode 100644 index 0000000..fcd2186 --- /dev/null +++ b/.github/auto_label_pr.yml @@ -0,0 +1,51 @@ +# .github/labeler.yml + +# Label for documentation changes +documentation: + - changed-files: + - any-glob-to-any-file: + - 'docs/**' + - 'README.md' + - 'CHANGELOG.md' + + +# Label for Docker changes +docker: + - changed-files: + - any-glob-to-any-file: + - '*docker*' + - 'Docker*' + +# Label for release-related changes +release: + - changed-files: + - any-glob-to-any-file: + - 'src/**' + - 'pyproject.toml' + - 'LICENCE' + +tests: + - changed-files: + - any-glob-to-any-file: + - 'tests/**' + +workflows: + - changed-files: + - any-glob-to-any-file: + - '.github/workflows/*' + - '.github/*' + +github: + - changed-files: + - any-glob-to-any-file: + - '.gitignore' + +feature: + - head-branch: ['^feature', 'feature'] + +patch: + - head-branch: ['^patch', 'patch', '^bug', 'bug'] + +ignore-pr-title-for-release: + - head-branch: ['develop'] + - base-branch: ['main'] \ No newline at end of file diff --git a/.github/workflows/autolabel-pr.yaml b/.github/workflows/autolabel-pr.yaml new file mode 100644 index 0000000..7c1ceb4 --- /dev/null +++ b/.github/workflows/autolabel-pr.yaml @@ -0,0 +1,22 @@ +name: Auto Label PRs + +on: + pull_request: + types: [opened, synchronize, reopened, edited] + +jobs: + label: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + outputs: + all-labels: ${{ steps.label-the-PR.outputs.all-labels }} + steps: + - name: Apply Labels + id: label-the-PR + uses: actions/labeler@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/labeler.yml + sync-labels: true \ No newline at end of file From b38faff915afba917135511a2daab00a45c71601 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 30 Aug 2024 08:42:19 +0000 Subject: [PATCH 07/25] updated path to label file --- .github/workflows/autolabel-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autolabel-pr.yaml b/.github/workflows/autolabel-pr.yaml index 7c1ceb4..8db7106 100644 --- a/.github/workflows/autolabel-pr.yaml +++ b/.github/workflows/autolabel-pr.yaml @@ -18,5 +18,5 @@ jobs: uses: actions/labeler@v5 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - configuration-path: .github/labeler.yml + configuration-path: .github/auto_label_pr.yml sync-labels: true \ No newline at end of file From 4aed5c0ecf60fad1899218cb0e55777e625a8b5e Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 30 Aug 2024 08:42:45 +0000 Subject: [PATCH 08/25] added config file for auto realease --- .github/release.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..7f7e986 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,47 @@ +#Automatically generated release notes from GIthub used by softprops/action-gh-release@v2 in .github/workflows/release.yaml + +changelog: + exclude: + labels: + - ignore-for-release + - ignore-pr-title-for-release + - workflows + - github + - documentation + authors: + - octocat + - github-actions[bot] + + categories: + - title: New Features 🎉 + labels: + - enhancement + - feature + - Semver-Minor + + - title: Bug Fixes 🐛 + labels: + - bug + - fix + - patch + + - title: Dependency Updates 📦 + labels: + - dependency + - dependencies + - dependency-update + + - title: Breaking Changes 🛠 + labels: + - breaking-change + - Semver-Major + + - title: Container and Compose Updates 🐳 + labels: + - docker + - compose + - docker-compose + + - title: Other Changes 🔧 + labels: + - "*" From 3311e89877db5a00704fbc927d2dc4df60c76be2 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 30 Aug 2024 08:43:12 +0000 Subject: [PATCH 09/25] added workflow to autolabel for issues --- .github/auto-label.json5 | 21 +++++++++++++++++++++ .github/workflows/auto-label-issue.yaml | 18 ++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/auto-label.json5 create mode 100644 .github/workflows/auto-label-issue.yaml diff --git a/.github/auto-label.json5 b/.github/auto-label.json5 new file mode 100644 index 0000000..6022b40 --- /dev/null +++ b/.github/auto-label.json5 @@ -0,0 +1,21 @@ +{ + labelsSynonyms: { + bug: ['error', 'need fix', 'not working', 'failure', 'crash', 'problem', 'issue', 'defect', 'glitch', 'fault', 'anomaly'], + enhancement: ['upgrade', 'update', 'improve', 'feature request', 'new feature', 'enhance', 'extension', 'add-on', 'improvement'], + "help wanted": ['help', 'how can i', 'assistance needed', 'support needed', 'question', 'guidance', 'aid', 'need assistance', 'advice', 'instruction'], + documentation: ['docs', 'Readme', 'documentation', 'guide', 'manual', 'instructions', 'how-to', 'reference', 'tutorial', 'specification'], + docker: ['compose', 'Dockerfile', 'container', 'docker-compose', 'image', 'docker setup', 'kubernetes', 'docker swarm', 'containerization'], + performance: ['slow', 'lag', 'performance', 'speed', 'optimization', 'tuning', 'efficiency', 'latency', 'improve performance', 'boost', 'performance issue'], + security: ['vulnerability', 'exploit', 'attack', 'breach', 'security', 'protection', 'patch', 'secure', 'threat', 'risk', 'malware'], + ui: ['user interface', 'ui', 'ux', 'design', 'layout', 'front-end', 'visual', 'interface', 'experience', 'aesthetic', 'theme', 'style'], + test: ['test', 'testing', 'unit test', 'integration test', 'e2e test', 'automated test', 'test case', 'test suite', 'qa', 'quality assurance'], + compatibility: ['compatible', 'incompatible', 'version', 'compatibility', 'interop', 'support', 'versioning', 'cross-platform', 'integration', 'compatibility issue'] + }, + labelsNotAllowed: [ + 'duplicate', + 'good first issue', + 'invalid' + ], + //defaultLabels: ['triage'], + ignoreComments: true +} \ No newline at end of file diff --git a/.github/workflows/auto-label-issue.yaml b/.github/workflows/auto-label-issue.yaml new file mode 100644 index 0000000..1b51c18 --- /dev/null +++ b/.github/workflows/auto-label-issue.yaml @@ -0,0 +1,18 @@ +name: Labeling new issue +on: + issues: + types: ['opened', 'reopened'] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: | + .github/auto-label.json5 + sparse-checkout-cone-mode: false + - uses: Renato66/auto-label@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-file: .github/auto-label.json5 \ No newline at end of file From b5deeac15c89aa30d41a5faa4f19aa25aa51fbc0 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 30 Aug 2024 08:53:56 +0000 Subject: [PATCH 10/25] adjust labeler to work with scraibe --- .github/auto_label_pr.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/auto_label_pr.yml b/.github/auto_label_pr.yml index fcd2186..95f2bd9 100644 --- a/.github/auto_label_pr.yml +++ b/.github/auto_label_pr.yml @@ -7,6 +7,8 @@ documentation: - 'docs/**' - 'README.md' - 'CHANGELOG.md' + - 'CONTRIBUTING.md' + - 'Makefile' # Label for Docker changes @@ -20,14 +22,14 @@ docker: release: - changed-files: - any-glob-to-any-file: - - 'src/**' + - 'scraibe/**' - 'pyproject.toml' - 'LICENCE' tests: - changed-files: - any-glob-to-any-file: - - 'tests/**' + - 'test/**' workflows: - changed-files: @@ -40,6 +42,14 @@ github: - any-glob-to-any-file: - '.gitignore' +dependencies: + - changed-files: + - any-glob-to-any-file: + - 'requirements.txt' + - 'environment.yml' + - 'pyproject.toml' + - head-branch: ['^dependencies', 'dependencies', '^dependency', 'dependency'] + feature: - head-branch: ['^feature', 'feature'] From 9494e719f90001d89e3e0b392aa708a7017df414 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 30 Aug 2024 08:56:38 +0000 Subject: [PATCH 11/25] added pictures to dcoumentation label --- .github/auto_label_pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/auto_label_pr.yml b/.github/auto_label_pr.yml index 95f2bd9..579a44c 100644 --- a/.github/auto_label_pr.yml +++ b/.github/auto_label_pr.yml @@ -9,6 +9,7 @@ documentation: - 'CHANGELOG.md' - 'CONTRIBUTING.md' - 'Makefile' + - 'Pictures' # Label for Docker changes From 1ef3267ff8938d6a965c353c8fe915957a724574 Mon Sep 17 00:00:00 2001 From: Jacob Schmieder Date: Fri, 30 Aug 2024 16:47:01 +0200 Subject: [PATCH 12/25] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 35 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/custom.md | 30 +++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 23 +++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/custom.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..759ceb5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: bug +assignees: '' + +--- + +## Description 🐛 +Please provide a clear and concise description of the bug. What went wrong? + +## Steps to Reproduce 🔍 +Steps to reproduce the behavior: +1. Go to '...' +2. Run command '....' +3. Provide input '....' +4. See error + +## Expected Behavior 🤔 +What did you expect to happen instead? + +## Screenshots or Logs 📸 +If applicable, add screenshots or logs to help explain your problem. This can include terminal output or error messages. + +## Environment 🖥️ +- **OS**: [e.g., Ubuntu 20.04] +- **Python Version**: [e.g., 3.9] +- **PyTorch Version**: [e.g., 2.0] +- **CUDA Version** (if applicable): [e.g., 11.7] +- **ScrAIbe Version**: [e.g., 1.0.0] +- **Installation Type**: [e.g., pip, GitHub, Docker, etc.] + +## Additional Context 📝 +Add any other context about the problem here. For example, information about custom models or configurations, related issues, or anything else that might be helpful. diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md new file mode 100644 index 0000000..35a7065 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -0,0 +1,30 @@ +--- +name: Custom issue template +about: Describe this issue template's purpose here. +title: "[CUSTOM] " +labels: '' +assignees: '' + +--- + +## Description 📝 +Provide a detailed description of the issue or request. Explain the context, the problem, or the question you have. + +## Objective 🎯 +What do you hope to achieve with this issue? Are you looking for guidance, proposing a discussion, or something else? + +## Relevant Information 📂 +Include any relevant details, such as: +- Code snippets +- Links to related documentation or issues +- Configuration files +- Screenshots or diagrams + +## Steps to Reproduce or Reference 🔍 +If applicable, provide steps to reproduce the issue or reference specific parts of the project that are relevant to your issue. + +## Proposed Next Steps 🚀 +What do you propose as the next steps for addressing this issue? Do you need help, or are you suggesting a specific course of action? + +## Additional Context 📝 +Add any other context that might help understand the issue. This could include environmental details, related discussions, or any other relevant information. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..4da0936 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,23 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[FEATURE]" +labels: feature +assignees: '' + +--- + +## Description 📝 +Provide a clear and concise description of the feature or enhancement you are proposing. What problem does it solve, or what capability does it add? + +## Use Case 💡 +Explain the use case(s) for this feature. How would it benefit you or others? Include any relevant examples or scenarios. + +## Proposed Solution 🚀 +Describe your proposed solution in detail. How would the feature work? If you have an idea of how to implement it, include that here. Code snippets or references to other projects can be helpful. + +## Alternatives Considered 🔄 +Have you considered any alternative approaches or solutions? If so, please describe them and explain why they wouldn't be as effective. + +## Additional Context 📝 +Add any other context, screenshots, or mockups that might help clarify your request. This could include links to relevant discussions, related issues, or other resources. From 8ad16dde488356445f05bba7436de0d4b4ac1486 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Fri, 30 Aug 2024 14:51:52 +0000 Subject: [PATCH 13/25] remove sermver --- .github/workflows/check_semver.yaml | 90 ----------------------------- 1 file changed, 90 deletions(-) delete mode 100644 .github/workflows/check_semver.yaml diff --git a/.github/workflows/check_semver.yaml b/.github/workflows/check_semver.yaml deleted file mode 100644 index 71de22c..0000000 --- a/.github/workflows/check_semver.yaml +++ /dev/null @@ -1,90 +0,0 @@ -name: Check and Add Version in Changelog - -on: - pull_request: - branches: - - main - - develop - -jobs: - check-and-add-version: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Check if Source Branch is docs - id: check_docs_branch - run: | - pr_head_ref="${{ github.event.pull_request.head.ref }}" - if [[ "$pr_head_ref" == "docs" ]]; then - echo "This is a docs branch merge. Exiting without creating a tag." - echo "is_docs_branch=true" >> $GITHUB_ENV - exit 0 - else - echo "is_docs_branch=false" >> $GITHUB_ENV - fi - - - name: Extract and Determine Version - if: env.is_docs_branch != 'true' - id: extract_version - run: | - # Fetch the latest tags from the remote - git fetch --tags - - # Get the latest tag, or initialize to v0.0.0 if no tags are found - latest_tag=$(git describe --tags `git rev-list --tags --max-count=1` 2>/dev/null || echo "v0.0.0") - - # Extract version from PR title or body - pr_body="${{ github.event.pull_request.body }}" - pr_title="${{ github.event.pull_request.title }}" - version_regex="v([0-9]+)\.([0-9]+)\.([0-9]+)" - - if [[ $pr_body =~ $version_regex ]]; then - major=${BASH_REMATCH[1]} - minor=${BASH_REMATCH[2]} - patch=${BASH_REMATCH[3]} - new_tag="v$major.$minor.$patch" - elif [[ $pr_title =~ $version_regex ]]; then - major=${BASH_REMATCH[1]} - minor=${BASH_REMATCH[2]} - patch=${BASH_REMATCH[3]} - new_tag="v$major.$minor.$patch" - else - # Split the latest tag into parts - IFS='.' read -r -a parts <<< "${latest_tag#v}" - major=${parts[0]} - minor=${parts[1]} - patch=${parts[2]} - patch=$((patch + 1)) - new_tag="v$major.$minor.$patch" - fi - - clean_version="${new_tag#v}" - echo "version=$clean_version" >> $GITHUB_ENV - echo "Version determined: $clean_version" - - - name: Check if Version Already Exists in Tags - if: env.is_docs_branch != 'true' - run: | - version="${{ env.version }}" - if git tag --list | grep -q "^$version$"; then - echo "Version $version already exists in tags." - exit 1 - else - echo "Version $version does not exist in tags." - fi - - - name: Check Version in CHANGELOG - if: env.is_docs_branch != 'true' - id: check_version - run: | - version="${{ env.version }}" - if ! grep -q "^## \[$version\]" CHANGELOG.md; then - echo "Version $version not found in CHANGELOG.md." - exit 1 - else - echo "Version $version found in CHANGELOG.md." - fi \ No newline at end of file From 3d290b29718aa06804541bddf70e9d765c69483c Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 2 Sep 2024 08:31:43 +0000 Subject: [PATCH 14/25] trigger documentation branch on tag --- .github/workflows/documentation.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 53277f2..37b78ea 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -2,8 +2,8 @@ name: documentation on: push: - branches: - - main + tags: + - 'v*.*.*' workflow_dispatch: permissions: @@ -36,7 +36,6 @@ jobs: make html - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/sphinx_action' }} with: publish_branch: gh-pages github_token: ${{ secrets.TOKEN_GH }} From 0a93fc3aa67039a84aaf3d2d6bae30b27c0ec638 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 2 Sep 2024 08:34:30 +0000 Subject: [PATCH 15/25] add paths to pytest to only trigger on python related changes --- .github/workflows/pytest.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index aac8afe..f204c7d 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -2,7 +2,14 @@ name: Run Tests on: pull_request: - branches: ['main', 'develop'] + branches: + - main + - develop + paths: + - scraibe/** + - pyproject.toml + - requirements.txt + - test/** workflow_dispatch: jobs: From 85027dd5350c92b00036e6d76550c865eddf3c12 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 2 Sep 2024 08:38:38 +0000 Subject: [PATCH 16/25] trigger ruff only on changes in python files --- .github/workflows/ruff.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 1e5c277..df0152c 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -1,9 +1,11 @@ name: Ruff -on: push +on: + push: + paths: + - '**.py' 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 d8a22f15fe950312ddd7add03c4937ee85783d0f Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 2 Sep 2024 12:04:54 +0000 Subject: [PATCH 17/25] fixed Syntax --- .github/auto_label_pr.yml | 1 + .github/workflows/auto-label-issue.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/auto_label_pr.yml b/.github/auto_label_pr.yml index 579a44c..edb43a0 100644 --- a/.github/auto_label_pr.yml +++ b/.github/auto_label_pr.yml @@ -42,6 +42,7 @@ github: - changed-files: - any-glob-to-any-file: - '.gitignore' + - '.github/ISSUE_TEMPLATE/*' dependencies: - changed-files: diff --git a/.github/workflows/auto-label-issue.yaml b/.github/workflows/auto-label-issue.yaml index 1b51c18..71a9282 100644 --- a/.github/workflows/auto-label-issue.yaml +++ b/.github/workflows/auto-label-issue.yaml @@ -1,7 +1,7 @@ name: Labeling new issue on: issues: - types: ['opened', 'reopened'] + types: [opened, reopened] jobs: build: From 189b23e17baec5d6bc0e33fb94d8a82119559117 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 2 Sep 2024 12:32:28 +0000 Subject: [PATCH 18/25] added paths varibale to workflow trigger --- .github/workflows/pypi.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 88c4521..a2641ee 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -6,6 +6,10 @@ on: - develop types: - closed + paths: + - scraibe/** + - pyproject.toml + push: tags: - 'v*.*.*' From cf63ac8e2e33ea8f9d80f6825716b0d0d0cd13b6 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 9 Sep 2024 09:50:43 +0000 Subject: [PATCH 19/25] update dependencies --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8c46bdb..86867a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,11 +31,11 @@ exclude =[ ] [tool.poetry.dependencies] python = "^3.9" -tqdm = "^4.66.4" +tqdm = "^4.66.5" numpy = "^1.26.4" openai-whisper = "^20231117" -whisperx = "^3.1.3" -"pyannote.audio" = "^3.1.1" +whisperx = "^3.1.5" +"pyannote.audio" = "^3.3.1" torch = "^2.3.0" [tool.poetry.group.dev.dependencies] From 533b199f4c884de87e9bb8320dd967c60ffb77c3 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 9 Sep 2024 09:57:45 +0000 Subject: [PATCH 20/25] downgraded to pyannote.audio==3.1.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 86867a0..9309239 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ python = "^3.9" tqdm = "^4.66.5" numpy = "^1.26.4" openai-whisper = "^20231117" -whisperx = "^3.1.5" +whisperx = "^3.1.1" "pyannote.audio" = "^3.3.1" torch = "^2.3.0" From d25fda58020402ee55bdf793efb14103c7336b76 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 9 Sep 2024 10:05:16 +0000 Subject: [PATCH 21/25] downgraded to 3.1.1 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9309239..098b025 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,8 +34,8 @@ python = "^3.9" tqdm = "^4.66.5" numpy = "^1.26.4" openai-whisper = "^20231117" -whisperx = "^3.1.1" -"pyannote.audio" = "^3.3.1" +whisperx = "^3.1.5" +"pyannote.audio" = "^3.1.1" torch = "^2.3.0" [tool.poetry.group.dev.dependencies] From 129f0ce39090ed7b567b4750085fac4adefcb37c Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 9 Sep 2024 10:06:13 +0000 Subject: [PATCH 22/25] updated versions --- requirements.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index f08e2e6..f43514f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,10 @@ -tqdm>=4.65.0 +tqdm>=4.66.5 numpy>=1.26.4 openai-whisper==20231117 -whisperx~=3.1.3 +whisperx~=3.1.5 pyannote.audio~=3.1.1 -pyannote.core~=5.0.0 -pyannote.database~=5.0.1 -pyannote.metrics~=3.2.1 -pyannote.pipeline~=3.0.1 torch>=2.0.0 From 5b56b54da26d03b1bf3578cdbaaee4acfe5e9e67 Mon Sep 17 00:00:00 2001 From: Marko Henning Date: Tue, 10 Sep 2024 09:37:46 +0200 Subject: [PATCH 23/25] Fixed pyannote env var import, now can use `PYANNOTE_CACHE` --- scraibe/misc.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scraibe/misc.py b/scraibe/misc.py index f12335f..7b7cbf4 100644 --- a/scraibe/misc.py +++ b/scraibe/misc.py @@ -1,6 +1,5 @@ import os import yaml -from pyannote.audio.core.model import CACHE_DIR as PYANNOTE_CACHE_DIR from argparse import Action from ast import literal_eval @@ -8,9 +7,7 @@ CACHE_DIR = os.getenv( "AUTOT_CACHE", os.path.expanduser("~/.cache/torch/models"), ) - -if CACHE_DIR != PYANNOTE_CACHE_DIR: - os.environ["PYANNOTE_CACHE"] = os.path.join(CACHE_DIR, "pyannote") +os.environ["PYANNOTE_CACHE"] = os.path.join(CACHE_DIR, "pyannote") WHISPER_DEFAULT_PATH = os.path.join(CACHE_DIR, "whisper") PYANNOTE_DEFAULT_PATH = os.path.join(CACHE_DIR, "pyannote") From 885d0c864ebd33f75416dd3300eca88f79c527c7 Mon Sep 17 00:00:00 2001 From: Marko Henning Date: Tue, 10 Sep 2024 13:50:28 +0200 Subject: [PATCH 24/25] Fixed pyannote_cache, now looks it up before overwrite. --- scraibe/misc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scraibe/misc.py b/scraibe/misc.py index 7b7cbf4..21099fb 100644 --- a/scraibe/misc.py +++ b/scraibe/misc.py @@ -7,7 +7,10 @@ CACHE_DIR = os.getenv( "AUTOT_CACHE", os.path.expanduser("~/.cache/torch/models"), ) -os.environ["PYANNOTE_CACHE"] = os.path.join(CACHE_DIR, "pyannote") +os.getenv( + "PYANNOTE_CACHE", + os.path.join(CACHE_DIR, "pyannote"), +) WHISPER_DEFAULT_PATH = os.path.join(CACHE_DIR, "whisper") PYANNOTE_DEFAULT_PATH = os.path.join(CACHE_DIR, "pyannote") From ae1bae750fad871bb853dbcefcc9a332f3ae1b2d Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Tue, 10 Sep 2024 12:08:26 +0000 Subject: [PATCH 25/25] fixed pypi.yaml to run on push on main --- .github/workflows/pypi.yml | 44 ++++++++++---------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index a2641ee..1c75489 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,18 +1,14 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI on: - pull_request_target: - branches: - - develop - types: - - closed - paths: - - scraibe/** - - pyproject.toml - push: tags: - 'v*.*.*' + branches: + - "develop" + paths: + - "scraibe/**" + - "pyproject.toml" workflow_dispatch: inputs: @@ -27,13 +23,7 @@ on: jobs: Build-and-publish-to-Test-PyPI: - if: | - (github.event_name == 'workflow_dispatch' && - github.event.inputs.test == 'true') || - (github.event_name == 'pull_request_target' && - github.event.pull_request.merged && - contains(github.event.pull_request.labels.*.name, 'release')) || - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) + if: github.event_name != 'workflow_dispatch' || github.event.inputs.test == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -72,28 +62,16 @@ jobs: needs: Test-PyPi-install runs-on: ubuntu-latest if: | - always() && - (( needs.Build-and-publish-to-Test-PyPI.result != 'failure' && - needs.Test-PyPi-install.result != 'failure' ) && - ((github.event_name == 'workflow_dispatch' && - github.event.inputs.publish_to_pypi == 'true') || - (github.event_name == 'pull_request_target' && - github.event.pull_request.merged && - contains(github.event.pull_request.labels.*.name, 'release')) || - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')))) + always() && + (( needs.Build-and-publish-to-Test-PyPI.result != 'failure' && + needs.Test-PyPi-install.result != 'failure' ) || + ((github.event_name == 'workflow_dispatch' && + github.event.inputs.publish_to_pypi == 'true'))) steps: - - name: Checkout Repository Tags - uses: actions/checkout@v4 - if: github.ref == 'refs/heads/main' - 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: