Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/vishalai92/vai into prod-1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalai92 committed Aug 1, 2024
2 parents a8af2e4 + d89dc09 commit 4165502
Show file tree
Hide file tree
Showing 329 changed files with 29,389 additions and 15,190 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Close stale issues"

on:
schedule:
- cron: "30 1 * * *"

permissions:
contents: write
issues: write
pull-requests: write

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 60
days-before-close: 7
stale-issue-label: 'stale'
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
close-issue-message: 'This issue has been automatically closed due to inactivity. Thank you for your contributions.'
stale-pr-label: 'stale'
stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
close-pr-message: 'This PR has been automatically closed due to inactivity. Thank you for your contributions.'
exempt-all-pr-milestones: true
enable-statistics: true
118 changes: 76 additions & 42 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,89 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
branches: [main, vocode-core-0.1.0, vocodehq-public]

env:
poetry-version: "1.8.3"

jobs:
build:
lint:
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
poetry-version:
- "1.4.2"
- "3.10"
- "3.11"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install ffmpeg
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: Install poetry ${{ matrix.poetry-version }}
run: |
python -m ensurepip
python -m pip install --upgrade pip
python -m pip install poetry==${{ matrix.poetry-version }}
- name: View poetry --help
run: poetry --help

- name: Install dependencies
shell: bash
run: python -m poetry install -E all

- name: Lint with mypy
run: |
python -m poetry run mypy -p vocode
python -m poetry run mypy -p quickstarts
python -m poetry run mypy -p playground
- name: Test with pytest
run: |
python -m poetry run python -m pytest -v tests
- uses: actions/checkout@v2

- name: Install ffmpeg
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: ${{ env.poetry-version }}

- name: Install dependencies
run: poetry install -E all

- name: Run mypy
run: |
poetry run mypy -p vocode
poetry run mypy -p quickstarts
poetry run mypy -p playground
- name: Run black
if: success() || failure()
run: poetry run black --check .

- name: Run isort
shell: bash
if: success() || failure()
run: poetry run isort --check .

pytest:
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install ffmpeg
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: ${{ env.poetry-version }}

- name: Install dependencies
run: poetry install -E all

- name: Test with pytest
run: |
poetry run pytest -v tests
52 changes: 40 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
default_language_version:
python: python3.10

repos:
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
hooks:
- id: mypy
args: [--ignore-missing-imports, ./]
language: system
pass_filenames: false
stages: [pre-push]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-ast
- id: trailing-whitespace
- id: check-toml
- id: end-of-file-fixer
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: mixed-line-ending
args:
- --fix=lf

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.13.0
hooks:
- id: pretty-format-yaml
args:
- --autofix
- --preserve-quotes
- --indent=2

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args:
- --settings-path=./pyproject.toml

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black
args:
- --config=./pyproject.toml
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"ms-python.black-formatter",
"ms-python.isort",
"ms-python.python",
"ms-python.vscode-pylance"
]
}
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
}
},
"black-formatter.args": ["--config", "./pyproject.toml"],
"isort.args": ["--settings-path", "./pyproject.toml"],
"rewrap.autoWrap.enabled": true,
"rewrap.wrappingColumn": 100,
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"isort.check": true,
"python.testing.pytestArgs": ["tests"]
}
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ transcribe:
synthesize:
poetry run python playground/streaming/synthesizer/synthesize.py

turn_based_conversation:
poetry run python quickstarts/turn_based_conversation.py

streaming_conversation:
poetry run python quickstarts/streaming_conversation.py

PYTHON_FILES=.
lint: PYTHON_FILES=vocode/ quickstarts/ playground/
lint_diff typecheck_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d main | grep -E '\.py$$')
Expand All @@ -19,7 +25,6 @@ lint lint_diff:
typecheck:
poetry run mypy -p vocode
poetry run mypy -p quickstarts
poetry run mypy -p apps
poetry run mypy -p playground

typecheck_diff:
Expand Down
Loading

0 comments on commit 4165502

Please sign in to comment.