Skip to content

Commit 4f9e03e

Browse files
committed
🎉 First commit!
0 parents  commit 4f9e03e

Some content is hidden

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

47 files changed

+17686
-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: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
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+
# Generated API schema files (from scripts/)
114+
api_schema_full.json
115+
api_schema_extracted.json
116+
117+
# UV lock file (optional - comment out if you want to commit it)
118+
# uv.lock
119+
120+
# Spyder project settings
121+
.spyderproject
122+
.spyproject
123+
124+
# Rope project settings
125+
.ropeproject
126+
127+
# mkdocs documentation
128+
/site
129+
130+
# mypy
131+
.mypy_cache/
132+
.dmypy.json
133+
dmypy.json
134+
135+
# Ruff
136+
.ruff_cache/
137+
138+
# Pyre type checker
139+
.pyre/
140+
141+
# IDE
142+
.vscode/
143+
.idea/
144+
.claude/
145+
*.swp
146+
*.swo
147+
*~
148+
.kiro
149+
150+
# OS
151+
.DS_Store
152+
Thumbs.db

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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.2.0] - 2025-11-16
9+
10+
- Entirely refactored SDK

0 commit comments

Comments
 (0)