Skip to content

Commit 3ca7c85

Browse files
committed
first commit
0 parents  commit 3ca7c85

Some content is hidden

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

48 files changed

+9699
-0
lines changed

.github/workflows/tests.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.8", "3.9", "3.10"]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Cache pip packages
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-
31+
32+
- name: Install system dependencies
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y ffmpeg
36+
37+
- name: Install Python dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -r requirements.txt
41+
pip install pytest pytest-cov pytest-xdist
42+
43+
- name: Run unit tests
44+
run: |
45+
pytest tests/unit -v --cov=pipeline --cov=utils --cov-report=xml --cov-report=term-missing
46+
47+
- name: Run integration tests
48+
run: |
49+
pytest tests/integration -v -m "not slow"
50+
51+
- name: Upload coverage reports
52+
uses: codecov/codecov-action@v3
53+
with:
54+
file: ./coverage.xml
55+
flags: unittests
56+
name: codecov-umbrella
57+
58+
lint:
59+
runs-on: ubuntu-latest
60+
61+
steps:
62+
- uses: actions/checkout@v3
63+
64+
- name: Set up Python
65+
uses: actions/setup-python@v4
66+
with:
67+
python-version: "3.9"
68+
69+
- name: Install linting tools
70+
run: |
71+
python -m pip install --upgrade pip
72+
pip install flake8 black isort mypy
73+
74+
- name: Run flake8
75+
run: |
76+
flake8 pipeline utils --max-line-length=100 --extend-ignore=E203,W503
77+
78+
- name: Check black formatting
79+
run: |
80+
black --check pipeline utils tests
81+
82+
- name: Check import sorting
83+
run: |
84+
isort --check-only pipeline utils tests
85+
86+
- name: Run mypy type checking
87+
run: |
88+
mypy pipeline utils --ignore-missing-imports
89+
90+
docs:
91+
runs-on: ubuntu-latest
92+
93+
steps:
94+
- uses: actions/checkout@v3
95+
96+
- name: Set up Python
97+
uses: actions/setup-python@v4
98+
with:
99+
python-version: "3.9"
100+
101+
- name: Install documentation tools
102+
run: |
103+
python -m pip install --upgrade pip
104+
pip install sphinx sphinx-rtd-theme
105+
106+
- name: Build documentation
107+
run: |
108+
cd docs || mkdir docs
109+
echo "Documentation build would go here"
110+
111+
security:
112+
runs-on: ubuntu-latest
113+
114+
steps:
115+
- uses: actions/checkout@v3
116+
117+
- name: Run Trivy vulnerability scanner
118+
uses: aquasecurity/trivy-action@master
119+
with:
120+
scan-type: 'fs'
121+
scan-ref: '.'
122+
format: 'sarif'
123+
output: 'trivy-results.sarif'
124+
125+
- name: Upload Trivy scan results
126+
uses: github/codeql-action/upload-sarif@v2
127+
with:
128+
sarif_file: 'trivy-results.sarif'

.gitignore

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
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+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.nox/
42+
.coverage
43+
.coverage.*
44+
.cache
45+
nosetests.xml
46+
coverage.xml
47+
*.cover
48+
*.py,cover
49+
.hypothesis/
50+
.pytest_cache/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
db.sqlite3
60+
db.sqlite3-journal
61+
62+
# Flask stuff:
63+
instance/
64+
.webassets-cache
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
target/
74+
75+
# Jupyter Notebook
76+
.ipynb_checkpoints
77+
78+
# IPython
79+
profile_default/
80+
ipython_config.py
81+
82+
# pyenv
83+
.python-version
84+
85+
# pipenv
86+
Pipfile.lock
87+
88+
# PEP 582
89+
__pypackages__/
90+
91+
# Celery stuff
92+
celerybeat-schedule
93+
celerybeat.pid
94+
95+
# SageMath parsed files
96+
*.sage.py
97+
98+
# Environments
99+
.env
100+
.venv
101+
env/
102+
venv/
103+
ENV/
104+
env.bak/
105+
venv.bak/
106+
107+
# Spyder project settings
108+
.spyderproject
109+
.spyproject
110+
111+
# Rope project settings
112+
.ropeproject
113+
114+
# mkdocs documentation
115+
/site
116+
117+
# mypy
118+
.mypy_cache/
119+
.dmypy.json
120+
dmypy.json
121+
122+
# Pyre type checker
123+
.pyre/
124+
125+
# Project specific
126+
data/intermediate/
127+
data/temp/
128+
data/output/
129+
logs/
130+
*.pkl
131+
*.h5
132+
*.hdf5
133+
*.mp4
134+
*.wav
135+
*.avi
136+
*.mov
137+
*.pth
138+
*.pt
139+
140+
# IDE
141+
.vscode/
142+
.idea/
143+
*.swp
144+
*.swo
145+
*~
146+
147+
# OS
148+
.DS_Store
149+
Thumbs.db
150+
151+
# Temporary files
152+
tmp/
153+
temp/
154+
*.tmp
155+
*.bak
156+
157+
# Model weights (too large for git)
158+
models/
159+
weights/
160+
161+
162+
# Personal notes
163+
notes.txt
164+
TODO.txt
165+
166+
# Credentials
167+
*.key
168+
*.pem
169+
config/secrets.yaml
170+
171+
movie/
172+
1/
173+
exp/
174+
.claude/

Makefile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Makefile for Character-Aware Audiovisual Subtitle Pipeline
2+
3+
.PHONY: help install test test-unit test-integration lint format clean docs run
4+
5+
help:
6+
@echo "Available commands:"
7+
@echo " make install Install dependencies"
8+
@echo " make test Run all tests"
9+
@echo " make test-unit Run unit tests only"
10+
@echo " make test-integration Run integration tests only"
11+
@echo " make lint Run linting checks"
12+
@echo " make format Format code"
13+
@echo " make clean Clean temporary files"
14+
@echo " make docs Build documentation"
15+
@echo " make run Run pipeline with default settings"
16+
17+
install:
18+
pip install -r requirements.txt
19+
pip install -e .
20+
21+
test:
22+
pytest tests/ -v --cov=pipeline --cov=utils --cov-report=term-missing
23+
24+
test-unit:
25+
pytest tests/unit -v --cov=pipeline --cov=utils --cov-report=term-missing
26+
27+
test-integration:
28+
pytest tests/integration -v -m "not slow"
29+
30+
test-slow:
31+
pytest tests/ -v -m "slow"
32+
33+
lint:
34+
flake8 pipeline utils tests --max-line-length=100 --extend-ignore=E203,W503
35+
mypy pipeline utils --ignore-missing-imports
36+
black --check pipeline utils tests
37+
isort --check-only pipeline utils tests
38+
39+
format:
40+
black pipeline utils tests
41+
isort pipeline utils tests
42+
43+
clean:
44+
find . -type f -name "*.pyc" -delete
45+
find . -type d -name "__pycache__" -delete
46+
find . -type d -name "*.egg-info" -exec rm -rf {} +
47+
rm -rf .coverage
48+
rm -rf htmlcov
49+
rm -rf .pytest_cache
50+
rm -rf .mypy_cache
51+
rm -rf data/intermediate/*
52+
rm -rf data/temp/*
53+
54+
docs:
55+
@echo "Documentation generation not implemented yet"
56+
57+
run:
58+
python run_pipeline.py
59+
60+
run-episode:
61+
@echo "Usage: make run-episode EPISODE=Seinfeld_03x01"
62+
python run_pipeline.py --episodes $(EPISODE)
63+
64+
run-sequential:
65+
python run_pipeline.py --sequential
66+
67+
run-cleanup:
68+
python run_pipeline.py --cleanup
69+
70+
# Development helpers
71+
dev-setup:
72+
pip install -r requirements.txt
73+
pip install pytest pytest-cov pytest-xdist
74+
pip install flake8 black isort mypy
75+
pip install pre-commit
76+
pre-commit install
77+
78+
# Docker support (optional)
79+
docker-build:
80+
docker build -t ca-subtitle-pipeline .
81+
82+
docker-run:
83+
docker run -v $(PWD)/data:/app/data ca-subtitle-pipeline

0 commit comments

Comments
 (0)