Skip to content

Commit 03d8025

Browse files
committed
🎉 First commit!
0 parents  commit 03d8025

36 files changed

+12052
-0
lines changed

.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Tango API Configuration
2+
# Copy this file to .env and fill in your actual values
3+
4+
# API Key for Tango API
5+
TANGO_API_KEY=your_api_key_here
6+
7+
# Base URL for Tango API (optional, defaults to production)
8+
# TANGO_BASE_URL=https://tango.makegov.com
9+
10+
# Integration Testing Configuration
11+
12+
# Set to 'true' to use live API instead of cassettes (requires TANGO_API_KEY)
13+
TANGO_USE_LIVE_API=false
14+
15+
# Set to 'true' to refresh all cassettes (re-record from live API)
16+
TANGO_REFRESH_CASSETTES=false
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Integration Tests
2+
3+
on:
4+
schedule:
5+
# Run weekly on Sunday at midnight UTC
6+
- cron: '0 0 * * 0'
7+
workflow_dispatch:
8+
inputs:
9+
use_live_api:
10+
description: 'Use live API instead of cached responses'
11+
required: false
12+
default: 'false'
13+
type: choice
14+
options:
15+
- 'true'
16+
- 'false'
17+
18+
jobs:
19+
integration-tests-cached:
20+
name: Integration Tests (Cached)
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v4
28+
with:
29+
version: "latest"
30+
31+
- name: Set up Python
32+
run: uv python install 3.12
33+
34+
- name: Install dependencies
35+
run: uv sync --all-extras
36+
37+
- name: Run integration tests with cached responses
38+
run: uv run pytest tests/integration/ -m integration -v
39+
env:
40+
TANGO_USE_LIVE_API: false
41+
42+
- name: Upload test results
43+
if: always()
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: integration-test-results-cached
47+
path: |
48+
.coverage
49+
coverage.xml
50+
retention-days: 30
51+
52+
integration-tests-live:
53+
name: Integration Tests (Live API)
54+
runs-on: ubuntu-latest
55+
# Only run live tests on scheduled runs or when explicitly requested
56+
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.use_live_api == 'true')
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Install uv
62+
uses: astral-sh/setup-uv@v4
63+
with:
64+
version: "latest"
65+
66+
- name: Set up Python
67+
run: uv python install 3.12
68+
69+
- name: Install dependencies
70+
run: uv sync --all-extras
71+
72+
- name: Run integration tests with live API
73+
run: uv run pytest tests/integration/ -m integration -v
74+
env:
75+
TANGO_USE_LIVE_API: true
76+
TANGO_API_KEY: ${{ secrets.TANGO_API_KEY }}
77+
78+
- name: Upload test results
79+
if: always()
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: integration-test-results-live
83+
path: |
84+
.coverage
85+
coverage.xml
86+
retention-days: 30
87+
88+
- name: Notify on failure
89+
if: failure()
90+
run: |
91+
echo "::warning::Integration tests with live API failed. This may indicate API changes or issues."

.github/workflows/lint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v4
18+
with:
19+
version: "latest"
20+
21+
- name: Set up Python
22+
run: uv python install 3.12
23+
24+
- name: Install dependencies
25+
run: uv sync --all-extras
26+
27+
- name: Check formatting with ruff
28+
run: uv run ruff format --check tango/
29+
30+
- name: Lint with ruff
31+
run: uv run ruff check tango/

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@v4
16+
with:
17+
version: 'latest'
18+
19+
- name: Set up Python
20+
run: uv python install 3.11
21+
22+
- name: Build package
23+
run: uv build
24+
25+
- name: Publish to PyPI
26+
env:
27+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
28+
run: uv publish

.github/workflows/test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
python-version: ["3.12", "3.13"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v4
23+
with:
24+
version: "latest"
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
run: uv python install ${{ matrix.python-version }}
28+
29+
- name: Install dependencies
30+
run: uv sync --all-extras
31+
32+
- name: Type check with mypy
33+
run: uv run mypy tango/
34+
continue-on-error: true
35+
36+
- name: Test with pytest
37+
run: uv run pytest
38+
39+
- name: Upload coverage to Codecov
40+
uses: codecov/codecov-action@v3
41+
with:
42+
file: ./coverage.xml
43+
flags: unittests
44+
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}

.gitignore

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
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+
# Integration test cassettes
53+
tests/cassettes/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
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+
.python-version
87+
88+
# pipenv
89+
Pipfile.lock
90+
91+
# PEP 582
92+
__pypackages__/
93+
94+
# Celery stuff
95+
celerybeat-schedule
96+
celerybeat.pid
97+
98+
# SageMath parsed files
99+
*.sage.py
100+
101+
# Environments
102+
.env
103+
.venv
104+
env/
105+
venv/
106+
ENV/
107+
env.bak/
108+
venv.bak/
109+
110+
# Test cassettes (VCR recordings)
111+
tests/cassettes/
112+
113+
# UV lock file (optional - comment out if you want to commit it)
114+
# uv.lock
115+
116+
# Spyder project settings
117+
.spyderproject
118+
.spyproject
119+
120+
# Rope project settings
121+
.ropeproject
122+
123+
# mkdocs documentation
124+
/site
125+
126+
# mypy
127+
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Ruff
132+
.ruff_cache/
133+
134+
# Pyre type checker
135+
.pyre/
136+
137+
# IDE
138+
.vscode/
139+
.idea/
140+
.claude/
141+
*.swp
142+
*.swo
143+
*~
144+
.kiro
145+
146+
# OS
147+
.DS_Store
148+
Thumbs.db

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2025-11-XX

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 MakeGov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)