Skip to content

Commit

Permalink
Merge pull request #33 from pavelzbornik/dev
Browse files Browse the repository at this point in the history
bulk update of the app
  • Loading branch information
pavelzbornik authored Nov 23, 2024
2 parents 53a78cc + 70ed509 commit 78a36bf
Show file tree
Hide file tree
Showing 61 changed files with 4,911 additions and 3,765 deletions.
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

{
"name": "WhisperX-FastAPI",
"context": "..",
"dockerFile": "../dockerfile",
"runArgs": ["--gpus", "all"],

"forwardPorts": [8000],

"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"github.copilot",
"ms-python.black-formatter",
"ms-python.flake8",
"github.vscode-github-actions",
"george-alisson.html-preview-vscode",
"ms-python.isort",
"prettier.prettier-vscode",
"ms-azuretools.vscode-docker"
],
"settings": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true
}
}
},
"postCreateCommand": "pip install -r requirements/dev.txt && pre-commit install",
"remoteUser": "root"
}
18 changes: 9 additions & 9 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.env
__pycache__
*.pyc
*.pyo
*.pyd
.Python
.venv
.pytest_cache
.git
.env
__pycache__
*.pyc
*.pyo
*.pyd
.Python
.venv
.pytest_cache
.git
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
38 changes: 38 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI
on:
push:
branches:
- dev
pull_request:
branches:
- main
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: true
- name: Build and export to Docker
uses: docker/build-push-action@v6
with:
context: .
load: true
push: false
tags: whisperx-fastapi:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run tests
run: docker run --env MY_ENV_VAR=${{ secrets.HF_TOKEN }} --env WHISPER_MODEL=tiny --env DEFAULT_LANG=en --env DEVICE=cpu --env COMPUTE_TYPE=int8 --entrypoint pytest whisperx-fastapi:latest
18 changes: 18 additions & 0 deletions .github/workflows/gitleaks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright © 2022 Gitleaks LLC - All Rights Reserved.
# You may use this code under the terms of the GITLEAKS-ACTION END-USER LICENSE AGREEMENT.
# You should have received a copy of the GITLEAKS-ACTION END-USER LICENSE AGREEMENT with this file.
# If not, please visit https://gitleaks.io/COMMERCIAL-LICENSE.txt.

name: gitleaks
on: [pull_request, push, workflow_dispatch]
jobs:
scan:
name: gitleaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.env
__pycache__
*.ipynb
*.db
.env
__pycache__
*.ipynb
*.db
*.env
7 changes: 7 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

title = "gitleaks config"
[[rules]]
id = "generic-api-key"
description = "Generic API Key"
regex = '''(?i)(api[_-]?key|secret|token)[\s]*[:=][\s]*['"]?[a-z0-9]{32,45}['"]?'''
tags = ["key", "api", "token"]
4 changes: 4 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"MD013": false,
"MD029": false
}
61 changes: 61 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# .pre-commit-config.yaml
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0 # Use the latest tag from the repository
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: detect-private-key
- id: requirements-txt-fixer
# Add black for Python code formatting
- repo: https://github.com/psf/black
rev: 23.9.1 # Use the latest stable version of Black
hooks:
- id: black
# Add isort for sorting imports in Python
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
# Add pydocstyle for checking docstrings
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0 # Use the latest stable version of pydocstyle
hooks:
- id: pydocstyle
# Lint: YAML
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: ["-d {extends: relaxed, rules: {line-length: disable}}", "-s"]
files: \.(yaml|yml)$
- repo: https://github.com/google/yamlfmt
rev: v0.10.0
hooks:
- id: yamlfmt
# Lint: Shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
args: ["-x"]
# Lint: Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
args: ["--fix", "--config", ".markdownlint.json"]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/gitleaks/gitleaks
rev: v8.19.0
hooks:
- id: gitleaks
args: ["--source", ".", "--config", ".gitleaks.toml"]
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"python.testing.pytestArgs": [
"tests"
],
"python.analysis.extraPaths": ["app"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
Loading

0 comments on commit 78a36bf

Please sign in to comment.