Skip to content

Commit d7a1c82

Browse files
author
TNFR AI Agent
committed
fix(ci): use mpmath.mp.dps and de-self-match bandit lint check [skip release]
- canonical.py, number_theory.py, optimized_primality.py, zeta.py: set precision via mp.mp.dps (mpmath 1.3 rejects module-level mp.dps), fixing the conftest import error in the test jobs. - lint-workflows.yml + pre-commit check-bandit-format: exclude lint-workflows.yml from the 'bandit -f sarif' grep so the check no longer matches its own documentation.
1 parent 804bd52 commit d7a1c82

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎.github/workflows/lint-workflows.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Check for invalid bandit -f sarif usage
3232
run: |
3333
# Search for bandit commands with -f sarif which is not supported
34-
if grep -r "bandit.*-f sarif" .github/workflows/ scripts/ 2>/dev/null; then
34+
if grep -r "bandit.*-f sarif" .github/workflows/ scripts/ --exclude=lint-workflows.yml 2>/dev/null; then
3535
echo "ERROR: Found 'bandit -f sarif' usage. Bandit does not support SARIF format."
3636
echo "Supported formats: csv, custom, html, json, screen, txt, xml, yaml"
3737
echo "Use 'bandit -f json' and convert to SARIF with tools/bandit_to_sarif.py"

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
stages: [pre-commit]
2626
- id: check-bandit-format
2727
name: Check for invalid bandit -f sarif usage
28-
entry: bash -c 'if grep -r "bandit.*-f sarif" .github/workflows/ scripts/ 2>/dev/null; then echo "ERROR - bandit does not support SARIF format. Use -f json instead."; exit 1; fi'
28+
entry: bash -c 'if grep -r "bandit.*-f sarif" .github/workflows/ scripts/ --exclude=lint-workflows.yml 2>/dev/null; then echo "ERROR - bandit does not support SARIF format. Use -f json instead."; exit 1; fi'
2929
language: system
3030
pass_filenames: false
3131
files: ^(\.github/workflows/|scripts/|tools/).*\.(yml|yaml|sh|py)$

‎src/tnfr/constants/canonical.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
import mpmath as mp
5252

5353
# set high precision for canonical derivations
54-
mp.dps = 35
54+
mp.mp.dps = 35
5555

5656
# ============================================================================
5757
# FUNDAMENTAL TNFR CONSTANTS (Canonical - Never Change)

‎src/tnfr/mathematics/number_theory.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
try:
5656
import mpmath as mp
5757

58-
mp.dps = 35
58+
mp.mp.dps = 35
5959
PHI = float(mp.phi)
6060
GAMMA = float(mp.euler)
6161
PI = float(mp.pi)

‎src/tnfr/mathematics/optimized_primality.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
try:
5656
import mpmath as mp
5757

58-
mp.dps = 50 # High precision for theoretical constants
58+
mp.mp.dps = 50 # High precision for theoretical constants
5959
HAS_MPMATH = True
6060
except ImportError:
6161
HAS_MPMATH = False

‎src/tnfr/mathematics/zeta.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
# Default precision
4949
if HAS_MPMATH:
50-
mp.dps = 25
50+
mp.mp.dps = 25
5151

5252

5353
def _ensure_complex(s: Any) -> Any:

0 commit comments

Comments
 (0)