Skip to content

Fix static analysis findings in CI workflows and tests - #8

Merged
msdundar merged 1 commit into
mainfrom
fix/static-analysis-findings
Nov 13, 2026
Merged

msdundar merged 1 commit into
mainfrom
fix/static-analysis-findings

Conversation

@msdundar

Copy link
Copy Markdown
Contributor

Summary

Fixes static analysis findings in the CI workflows, the SDK and the tests.

CI supply chain

  • build (publish) and poetry (test) now install from hash-locked files in .github/requirements/, using --only-binary :all: --require-hashes. No unpinned versions, and no setup scripts run from source distributions.
  • poetry install runs with POETRY_INSTALLER_ONLY_BINARY=":all:". Every package in poetry.lock has Linux wheels for Python 3.11–3.14, so this doesn't break the matrix.
  • To upgrade a pin, edit the .in file and regenerate its .txt:
    uv pip compile --generate-hashes --universal --python-version 3.11 --only-binary :all: .github/requirements/<name>.in -o .github/requirements/<name>.txt

Code and tests

  • knf.decode_key: catches ValueError only, since binascii.Error is a subclass of it.
  • Split the composite base64url character assertion into three separate asserts.
  • Replaced the assertion that compared an expression with itself (share_text fresh-key test).
  • Each pytest.raises block now holds only the call expected to raise. Arguments are built before the block.

Testing

  • Ran the CI install steps in fresh environments on Python 3.11 and 3.14: pinned Poetry, then poetry install --with dev with only-binary set. All 124 tests pass on both.
  • Checked that the pinned hashes match the manylinux wheels on 3.11 and 3.14.
  • python -m build with the pinned build builds both the sdist and the wheel.

🤖 Generated with Claude Code

- Install build and poetry in CI from hash-pinned requirements, wheels only
- Make poetry install use wheels only (POETRY_INSTALLER_ONLY_BINARY)
- Drop redundant binascii.Error catch (subclass of ValueError)
- Split composite assertion and duplicate-expression assertion in tests
- Keep a single possibly-raising call inside pytest.raises blocks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

🟢 Coverage 0.00% diff coverage · -0.01% coverage variation

Metric Results
Coverage variation ✅ -0.01% coverage variation (-1.00%)
Diff coverage ✅ 0.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (e56d61e) 444 422 95.05%
Head commit (6e8e788) 443 (-1) 421 (-1) 95.03% (-0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#8) 1 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sonarqubecloud

Copy link
Copy Markdown

@msdundar
msdundar merged commit af8e703 into main Nov 13, 2026
9 of 10 checks passed
@msdundar
msdundar deleted the fix/static-analysis-findings branch November 13, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant