refactor: move Python implementation to legacy/, make Go primary
Deploy to K8s / deploy (push) Successful in 20s
Deploy to K8s / deploy (push) Successful in 20s
Go (go/) becomes the primary implementation. The original Python version moves to legacy/ and is kept runnable; new features are still built in both (see the Dual implementation rule in CLAUDE.md). - git mv app.py, scripts/, templates/, tests/, pyproject.toml, uv.lock and build/ into legacy/ - Makefile: Python targets point at legacy/, venv in legacy/.venv, CREDENTIALS_PATH exported for the root .secret/ file - CI and make image build the Python image with legacy/ as context; the Makefile is no longer copied into the image - legacy/.dockerignore moved to the context root so it takes effect - CLAUDE.md, docs/README.md, Go comments, fixture README, capture script and VS Code launch config updated to the new layout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
// Verify expected values against live Python:
|
||||
//
|
||||
// PYTHONPATH=scripts:. python3 -c "from match_payments import _build_name_variants; print(_build_name_variants('František Vrbík (Štrúdl)'))"
|
||||
// PYTHONPATH=legacy/scripts:legacy python3 -c "from match_payments import _build_name_variants; print(_build_name_variants('František Vrbík (Štrúdl)'))"
|
||||
|
||||
func TestBuildNameVariantsParity(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Verify expected values against live Python:
|
||||
//
|
||||
// PYTHONPATH=scripts:. python3 -c "from attendance import calculate_fee; print(calculate_fee(2, '2026-01'))"
|
||||
// PYTHONPATH=legacy/scripts:legacy python3 -c "from attendance import calculate_fee; print(calculate_fee(2, '2026-01'))"
|
||||
|
||||
func TestCalculateFeeParity(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Verify expected values against live Python:
|
||||
//
|
||||
// PYTHONPATH=scripts:. python3 -c "from attendance import calculate_junior_fee; print(calculate_junior_fee(1, '2026-01'))"
|
||||
// PYTHONPATH=legacy/scripts:legacy python3 -c "from attendance import calculate_junior_fee; print(calculate_junior_fee(1, '2026-01'))"
|
||||
|
||||
func TestCalculateJuniorFeeParity(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Verify expected values against live Python:
|
||||
//
|
||||
// PYTHONPATH=scripts:. python3 -c "from match_payments import format_date; print(format_date(46027))"
|
||||
// PYTHONPATH=legacy/scripts:legacy python3 -c "from match_payments import format_date; print(format_date(46027))"
|
||||
|
||||
func TestFormatDateParity(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Verify expected values against live Python:
|
||||
//
|
||||
// PYTHONPATH=scripts:. python3 -c "
|
||||
// PYTHONPATH=legacy/scripts:legacy python3 -c "
|
||||
// from sync_fio_to_sheets import generate_sync_id
|
||||
// print(generate_sync_id({'date':'2026-01-15','amount':750.0,'currency':'CZK','sender':'Test','vs':'123','message':'x','bank_id':'1'}))"
|
||||
//
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Verify expected values against live Python:
|
||||
//
|
||||
// PYTHONPATH=scripts:. python3 -c "
|
||||
// PYTHONPATH=legacy/scripts:legacy python3 -c "
|
||||
// from match_payments import infer_transaction_details
|
||||
// print(infer_transaction_details({'sender':'Henrietta Ottová','message':'leden 2026','user_id':'','date':'2026-01-15'}, ['Henrietta Ottová']))"
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Verify expected values against live Python:
|
||||
//
|
||||
// PYTHONPATH=scripts:. python3 -c "from match_payments import match_members; print(match_members('henrietta ottova leden', ['Henrietta Ottová','Jan Novák']))"
|
||||
// PYTHONPATH=legacy/scripts:legacy python3 -c "from match_payments import match_members; print(match_members('henrietta ottova leden', ['Henrietta Ottová','Jan Novák']))"
|
||||
|
||||
func TestMatchMembersParity(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Verify expected values against live Python:
|
||||
//
|
||||
// PYTHONPATH=scripts:. python3 -c "from czech_utils import normalize; print(normalize('štefan čakrtový'))"
|
||||
// PYTHONPATH=legacy/scripts:legacy python3 -c "from czech_utils import normalize; print(normalize('štefan čakrtový'))"
|
||||
|
||||
func TestNormalizeParity(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Verify expected values against live Python:
|
||||
//
|
||||
// PYTHONPATH=scripts:. python3 -c "from infer_payments import parse_czk_amount; print(parse_czk_amount('1.500,00'))"
|
||||
// PYTHONPATH=legacy/scripts:legacy python3 -c "from infer_payments import parse_czk_amount; print(parse_czk_amount('1.500,00'))"
|
||||
//
|
||||
// Note: Go's ParseCZK returns an error for unparseable input; Python returns 0.0.
|
||||
// Callers should discard the error to match Python semantics: v, _ := money.ParseCZK(s)
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
// Verify expected values against live Python:
|
||||
//
|
||||
// PYTHONPATH=scripts:. python3 -c "from czech_utils import parse_month_references; print(parse_month_references('prosinec-leden', 2026))"
|
||||
// PYTHONPATH=legacy/scripts:legacy python3 -c "from czech_utils import parse_month_references; print(parse_month_references('prosinec-leden', 2026))"
|
||||
|
||||
func TestParseMonthReferencesParity(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
//
|
||||
// Verify expected values against live Python:
|
||||
//
|
||||
// PYTHONPATH=scripts:. python3 -c "
|
||||
// PYTHONPATH=legacy/scripts:legacy python3 -c "
|
||||
// from match_payments import reconcile
|
||||
// # ... build members/months/txs/exceptions...
|
||||
// import json; print(json.dumps(reconcile(...)))"
|
||||
|
||||
Reference in New Issue
Block a user