Skip to content

Commit 4f7f2ff

Browse files
iMicknlhdmeyerEmma-ms
committed
Initial commit
Co-authored-by: Mick Vleeshouwer <[email protected]> Co-authored-by: Hugo Meyer <[email protected]> Co-authored-by: Emma Chen <[email protected]>
0 parents  commit 4f7f2ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+8080
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "Python 3.12",
5+
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
6+
// Features to add to the dev container. More info: https://containers.dev/features.
7+
"features": {
8+
"ghcr.io/devcontainers/features/azure-cli:1": {},
9+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
10+
"ghcr.io/devcontainers/features/github-cli:1": {},
11+
"ghcr.io/azure/azure-dev/azd:0": {},
12+
"ghcr.io/va-h/devcontainers-features/uv:1": {},
13+
"ghcr.io/stuartleeks/dev-container-features/dev-tunnels:0": {}
14+
},
15+
// Configure tool-specific properties.
16+
"customizations": {
17+
"vscode": {
18+
"extensions": [
19+
"charliermarsh.ruff",
20+
"GitHub.copilot-chat",
21+
"ms-python.python",
22+
"ms-python.debugpy",
23+
"ms-azuretools.vscode-docker"
24+
],
25+
"settings": {
26+
"[python]": {
27+
"editor.formatOnSave": true,
28+
"editor.defaultFormatter": "charliermarsh.ruff",
29+
"editor.codeActionsOnSave": {
30+
"source.fixAll": "explicit",
31+
"source.organizeImports": "explicit"
32+
}
33+
}
34+
}
35+
}
36+
},
37+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
38+
"forwardPorts": [
39+
5000
40+
],
41+
// Use 'postCreateCommand' to run commands after the container is created.
42+
"postCreateCommand": "cd server/python && uv sync && uv run pre-commit install"
43+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
44+
// "remoteUser": "root"
45+
}

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* @iMicknl
2+
* @hdmeyer
3+
* @Emma-ms

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for more information:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
# https://containers.dev/guide/dependabot
6+
7+
version: 2
8+
updates:
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: weekly
13+
14+
- package-ecosystem: "devcontainers"
15+
directory: "/"
16+
schedule:
17+
interval: weekly
18+
19+
- package-ecosystem: "uv"
20+
directory: "/server/python/"
21+
schedule:
22+
interval: weekly
23+
24+
- package-ecosystem: "docker"
25+
directory: "/server/python/"
26+
schedule:
27+
interval: weekly

.github/workflows/lint.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: lint
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
name: "Python ${{ matrix.python-version }}"
11+
runs-on: ubuntu-latest
12+
13+
defaults:
14+
run:
15+
working-directory: ./server/python
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
python-version: ["3.12", "3.13"]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v6
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "${{ matrix.python-version }}"
32+
33+
- name: Install the project
34+
run: uv sync --all-extras --dev
35+
36+
- name: Run pre-commit
37+
run: uv run pre-commit run --show-diff-on-failure --color=always --all-files
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Package and publish AudioHook server (on push to main)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
env:
13+
REGISTRY: ghcr.io
14+
IMAGE_NAME: ${{ github.repository }}-server
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Log in to GitHub Container Registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Extract metadata (tags, labels) for Docker
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39+
tags: |
40+
type=sha,format=short
41+
latest
42+
43+
- name: Build and push Docker image
44+
uses: docker/build-push-action@v6
45+
with:
46+
context: ./server/python
47+
push: true
48+
tags: ${{ steps.meta.outputs.tags }}
49+
labels: ${{ steps.meta.outputs.labels }}
50+
cache-from: type=gha
51+
cache-to: type=gha,mode=max

.github/workflows/test.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
env:
9+
CI: true
10+
# Storage (dummy values)
11+
AZURE_STORAGE_CONNECTION_STRING: ""
12+
AZURE_STORAGE_ACCOUNT_URL: ""
13+
# Event Hub (dummy values)
14+
AZURE_EVENT_HUB_FULLY_QUALIFIED_NAMESPACE: ""
15+
AZURE_EVENT_HUB_CONNECTION_STRING: ""
16+
# Speech provider selection
17+
SPEECH_PROVIDER: "azure-ai-speech"
18+
AZURE_SPEECH_KEY: "dummy-key"
19+
AZURE_SPEECH_RESOURCE_ID: "dummy-resource-id"
20+
# Azure OpenAI (dummy values)
21+
AZURE_OPENAI_ENDPOINT: "https://dummy.openai.azure.com/"
22+
AZURE_OPENAI_MODEL_DEPLOYMENT: "dummy-model"
23+
AZURE_OPENAI_API_KEY: "dummy"
24+
jobs:
25+
pytest:
26+
name: "Python ${{ matrix.python-version }}"
27+
runs-on: ubuntu-latest
28+
29+
defaults:
30+
run:
31+
working-directory: ./server/python
32+
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
python-version: ["3.12", "3.13"]
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@v6
43+
44+
- name: Set up Python ${{ matrix.python-version }}
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: "${{ matrix.python-version }}"
48+
49+
- name: Install the project
50+
run: uv sync --all-extras --dev
51+
52+
- name: Run tests
53+
run: uv run pytest tests

.gitignore

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110+
.pdm.toml
111+
.pdm-python
112+
.pdm-build/
113+
114+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115+
__pypackages__/
116+
117+
# Celery stuff
118+
celerybeat-schedule
119+
celerybeat.pid
120+
121+
# SageMath parsed files
122+
*.sage.py
123+
124+
# Environments
125+
.env
126+
.venv
127+
env/
128+
venv/
129+
ENV/
130+
env.bak/
131+
venv.bak/
132+
133+
# Spyder project settings
134+
.spyderproject
135+
.spyproject
136+
137+
# Rope project settings
138+
.ropeproject
139+
140+
# mkdocs documentation
141+
/site
142+
143+
# mypy
144+
.mypy_cache/
145+
.dmypy.json
146+
dmypy.json
147+
148+
# Pyre type checker
149+
.pyre/
150+
151+
# pytype static type analyzer
152+
.pytype/
153+
154+
# Cython debug symbols
155+
cython_debug/
156+
157+
# PyCharm
158+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160+
# and can be added to the global gitignore or merged into this file. For a more nuclear
161+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162+
#.idea/
163+
164+
# DevTunnels
165+
DevTunnels
166+
.azure

0 commit comments

Comments
 (0)