Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
660c182
feat(statcalc): add StatCalc module, fix bugs, update docs, bump to 1…
MarTrepodi Mar 3, 2026
db474a4
feat(async): add async client, refactor architecture, harden security
MarTrepodi Mar 3, 2026
cc18d47
feat(docs): add migration guide and update README with upgrade steps
MarTrepodi Mar 3, 2026
56f7507
chore(version): bump to 2.0.1rc1 and update changelog
MarTrepodi Mar 3, 2026
b4c714f
feat(examples): replace threaded player fetch example with modern asy…
MarTrepodi Mar 7, 2026
420a528
feat(statcalc): introduce dynamic GameDataBuilder for improved data l…
MarTrepodi Mar 7, 2026
099d5d7
refactor(helpers): split monolith into subpackage, add migration CLI
MarTrepodi Mar 7, 2026
8f6369a
feat(helpers): implement aggregated datacron dismantle materials calc…
MarTrepodi Mar 7, 2026
3c1f5cb
refactor(helpers): consolidate stat data imports and cleanup redundan…
MarTrepodi Mar 7, 2026
5e005f5
feat(tests): add integration tests for HMAC and async workflows, enha…
MarTrepodi Mar 7, 2026
1901aa4
refactor(helpers): replace `sentinels` dependency with custom lightwe…
MarTrepodi Mar 7, 2026
7c140ee
feat(docs): add Helpers and Exceptions API reference, update mkdocs.yml
MarTrepodi Mar 7, 2026
91df92e
refactor(helpers): remove `OPTIONAL` and `NotSet` sentinels, improve …
MarTrepodi Mar 7, 2026
3c55746
fix(hmac): serialize empty payload as empty string for comlink v4 com…
MarTrepodi Mar 7, 2026
0af1b84
chore(version): bump version to 2.0.2rc1
MarTrepodi Mar 7, 2026
37cf69a
fix(ci): improve service readiness checks in integration workflow
MarTrepodi Mar 7, 2026
d9c3466
chore(ci): update workflows with new scopes, Python versions, and rea…
MarTrepodi Mar 7, 2026
e606198
chore(ci): update branch filters and remove strict doc build flag
MarTrepodi Mar 7, 2026
d84ff2c
refactor: enhance type annotations and add stricter runtime checks
MarTrepodi Mar 7, 2026
c6b1e2e
refactor(tests): simplify HMAC exception handling and remove unused i…
MarTrepodi Mar 7, 2026
4ebc6c5
chore(ci): upgrade actions and refactor dependency workflows
MarTrepodi Mar 7, 2026
5543116
chore(docs): update CONTRIBUTING.md and enhance project structure doc…
MarTrepodi Mar 7, 2026
1b981e7
bug(ci): update integration workflow with proper comlink healthcheck …
MarTrepodi Mar 7, 2026
44ba2d4
fix: improve game data processing and enhance error handling
MarTrepodi Mar 7, 2026
16c797b
test: add unit tests for GameDataBuilder transformation methods
MarTrepodi Mar 7, 2026
2c3a9f9
refactor(examples): improve config handling and expand stats calculat…
MarTrepodi Mar 7, 2026
9c79284
test: add comprehensive unit tests for helpers with mocked HTTP and p…
MarTrepodi Mar 7, 2026
3d9a696
chore(release): prepare v2.0.3 with fixes, features, and expanded tes…
MarTrepodi Mar 8, 2026
38ff601
test: remove unused imports and minor cleanup in unit tests
MarTrepodi Mar 8, 2026
674cbc5
test: add unit tests for parse_loc_zip and SWGOH string parsing utili…
MarTrepodi Mar 13, 2026
74aef9b
feat: add SWGOH string parsing utility and improve error handling
MarTrepodi Mar 13, 2026
61aa92b
refactor(helpers): simplify GAC helpers and improve type checks
MarTrepodi Mar 14, 2026
e5d290f
chore(release): bump version to 2.0.4rc1 and update changelog with ne…
MarTrepodi Mar 15, 2026
94e8e68
refactor: consistently apply PEP-8 formatting and improve readability
MarTrepodi Mar 16, 2026
c2b7619
chore: update GitHub Actions to use `actions/checkout@v6` in all work…
MarTrepodi Mar 16, 2026
14414ef
chore(release): bump version to 2.0.5rc1 and update test for zipfile …
MarTrepodi Mar 16, 2026
762b8a7
chore: remove redundant Comlink service wait steps from integration w…
MarTrepodi Mar 17, 2026
3733bfb
chore: remove commit-lint workflow, secure secrets, and improve integ…
MarTrepodi Mar 17, 2026
a1390f0
chore: replace container health checks with custom service readiness …
MarTrepodi Mar 17, 2026
abd55e4
chore: update commitlint rules and refactor HMAC tests with condition…
MarTrepodi Mar 17, 2026
0f52b18
chore: remove sentinel objects, update docs, and refactor code to use…
MarTrepodi Mar 17, 2026
6d8dab2
chore: update coverage badge, enhance test cases, and fix type hint f…
MarTrepodi Mar 17, 2026
11ebf6b
chore: add examples page, update README with links to examples, and b…
MarTrepodi Mar 17, 2026
044733b
chore: add Conquest helpers, `calc_current_stamina` function, and inc…
MarTrepodi Mar 19, 2026
dd59dab
Merge branch 'main' into feature/async
MarTrepodi Mar 21, 2026
528d17c
update urllib3 minimum version in uv.lock
MarTrepodi Mar 21, 2026
c8c944c
chore: add pre-commit hooks and update commitlint configuration to al…
MarTrepodi Mar 21, 2026
7f7e1e0
Merge remote-tracking branch 'origin/feature/async' into feature/async
MarTrepodi Mar 21, 2026
fb66ca5
chore(deps): update certifi and charset-normalizer versions in `uv.lock`
MarTrepodi Mar 21, 2026
02a2fed
fix: improve `calc_current_stamina` logic for accurate regeneration a…
MarTrepodi Mar 21, 2026
23e878c
feat: add HTTP status error handling in sync and async requests, upda…
MarTrepodi Mar 21, 2026
440e257
chore: add inline documentation for mod `definitionId` format in `Sta…
MarTrepodi Mar 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 28 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
pull_request:
branches: [main, 2.0-development]
branches: [main, 1.0-maintenance, 2.0-development]
push:
branches: [main]

Expand Down Expand Up @@ -54,13 +54,10 @@ jobs:
python-version: "3.12"

- name: Install dependencies
run: uv pip install --system -e "." mypy
run: uv sync --group typecheck

- name: Run mypy
# NOTE: 38 existing errors (mostly implicit Optional). Set continue-on-error
# to false once type annotations are cleaned up (see pyproject.toml TODO).
continue-on-error: true
run: mypy src/swgoh_comlink/
run: uv run mypy src/swgoh_comlink/

# ── Test ───────────────────────────────────────────────────────────────
test:
Expand All @@ -82,11 +79,11 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: uv pip install --system -e "." pytest pytest-cov
run: uv sync --group test

- name: Run tests with coverage
run: |
python -m pytest tests/ \
uv run python -m pytest tests/ \
--cov=swgoh_comlink \
--cov-report=term-missing \
--cov-report=xml:coverage.xml \
Expand All @@ -99,6 +96,27 @@ jobs:
name: coverage-report
path: coverage.xml

# ── Docs build ────────────────────────────────────────────────────────
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install dependencies
run: uv sync --group docs

- name: Build docs
run: uv run mkdocs build

# ── Build verification ─────────────────────────────────────────────────
build:
name: Build
Expand All @@ -114,13 +132,10 @@ jobs:
with:
python-version: "3.12"

- name: Install hatch
run: uv pip install --system hatch

- name: Build package
run: hatch build
run: uvx hatch build

- name: Verify wheel contents
run: |
pip install dist/*.whl
uv pip install --system dist/*.whl
python -c "from swgoh_comlink import SwgohComlink; print('Import OK')"
13 changes: 9 additions & 4 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Commit Lint

on:
pull_request:
branches: [main, 2.0-development]
branches: [main, 1.0-maintenance]

permissions:
contents: read
Expand All @@ -26,13 +26,18 @@ jobs:
"extends": ["@commitlint/config-conventional"],
"rules": {
"type-enum": [2, "always", [
"feat", "fix", "refactor", "build", "deps",
"feat", "fix", "refactor", "build", "deps", "bug",
"chore", "docs", "test", "style", "ci", "perf"
]],
"scope-enum": [1, "always", [
"core", "helpers", "deps", "release", "ci"
"core", "helpers", "deps", "release", "ci",
"version", "hmac", "docs", "tests", "examples",
"async", "statcalc"
]],
"subject-max-length": [1, "always", 100]
"subject-max-length": [1, "always", 100],
"header-max-length": [0, "always"],
"body-max-line-length": [0, "always"],
"footer-max-line-length": [0, "always"]
}
}
EOF
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Integration Tests

on:
pull_request:
branches: [main, 1.0-maintenance]
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: integration-${{ github.ref }}
cancel-in-progress: true

jobs:
integration:
name: Integration Tests
runs-on: ubuntu-latest
services:
comlink:
image: ghcr.io/swgoh-utils/swgoh-comlink:latest
env:
APP_NAME: comlink-python-integration-tests
ports:
- 3000:3000

comlink-hmac:
image: ghcr.io/swgoh-utils/swgoh-comlink:latest
env:
APP_NAME: comlink-python-hmac-integration-tests
ACCESS_KEY: ${{ secrets.COMLINK_ACCESS_KEY }}
SECRET_KEY: ${{ secrets.COMLINK_SECRET_KEY }}
ports:
- 3001:3000

steps:
- name: Wait for Comlink services
run: |
for port in 3000 3001; do
echo "Waiting for service on port $port..."
for i in $(seq 1 30); do
if curl -sf http://localhost:$port/readyz > /dev/null 2>&1; then
echo "Service on port $port is ready."
break
fi
if [ $i -eq 30 ]; then
echo "Service on port $port failed to become ready."
exit 1
fi
sleep 2
done
done

- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install dependencies
run: uv sync --group test

- name: Run integration tests
env:
RUN_INTEGRATION_TESTS: "1"
HMAC_ACCESS_KEY: ${{ secrets.COMLINK_ACCESS_KEY }}
HMAC_SECRET_KEY: ${{ secrets.COMLINK_SECRET_KEY }}
run: uv run python -m pytest tests/integration/ -v
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,18 @@ jobs:
with:
python-version: "3.12"

- name: Install dependencies
run: uv pip install --system hatch git-changelog

# Update version
- name: Update version
run: hatch version minor
run: uvx hatch version minor

# Update CHANGELOG.md
- name: Update CHANGELOG.md
run: git-changelog -B auto -Tio CHANGELOG.md -c angular -s build,deps,fix,feat,refactor -n semver
run: uvx git-changelog -B auto -Tio CHANGELOG.md -c angular -s build,deps,fix,feat,refactor -n semver

# Commit version bump and changelog, then tag and push
- name: Commit and tag
run: |
VERSION=$(hatch version)
VERSION=$(uvx hatch version)
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add src/swgoh_comlink/version.py CHANGELOG.md
Expand All @@ -61,7 +58,7 @@ jobs:

# Build the package
- name: Build the package
run: hatch build
run: uvx hatch build

# Upload build artifacts for the publish job
- name: Upload build artifacts
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Setup uv
uses: astral-sh/setup-uv@v7

- name: Sync dependencies
run: uv sync --group dev --group docs

- name: Run unit tests
run: uv run pytest -q

- name: Build docs
run: uv run mkdocs build
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ stash/
pip-log.txt
pip-delete-this-directory.txt

# Exhaustive tests and support files (owner-only, not distributed)
tests/exhaustive/
scripts/
data/
gameData.json

# Unit test / coverage reports
htmlcov/
.tox/
Expand All @@ -61,6 +67,9 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
.ruff_cache/
.parity-cache/
parity/.cache-gameData.json
cover/


Expand Down Expand Up @@ -176,3 +185,4 @@ cython_debug/
Pipfile*
pyvenv.cfg
/src/swgoh_comlink/tools.py
/docs/exhaustive-tests.md
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Pre-commit hooks mirroring the CI workflow checks.
# Install: pre-commit install
# Run all: pre-commit run --all-files

repos:
# ── General file hygiene ──────────────────────────────────────────────
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- id: debug-statements

# ── Ruff linter & formatter (mirrors CI lint job) ─────────────────────
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

# ── Mypy type checking (mirrors CI type-check job) ────────────────────
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
- id: mypy
files: ^src/swgoh_comlink/
additional_dependencies: [httpx>=0.28]
args: [--strict, --ignore-missing-imports]

# ── Commitlint (mirrors CI commitlint job) ────────────────────────────
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.21.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@commitlint/config-conventional"]
Loading
Loading