Skip to content

Remove the version checks around add_note() - #138

Open
eda-s-claude-bot[bot] wants to merge 1 commit into
devfrom
claude/drop-python310-guards
Open

Remove the version checks around add_note()#138
eda-s-claude-bot[bot] wants to merge 1 commit into
devfrom
claude/drop-python310-guards

Conversation

@eda-s-claude-bot

Copy link
Copy Markdown

Bug Fixes

  • All 4 Exception.add_note() call was wrapped in if version_info >= (3, 11):, so the note was attached only on
    Python 3.11 and newer. This package requires Python 3.11 or newer
    (setup.py: pythonVersions=("3.11", "3.12", "3.13", "3.14")), so the condition is always true and the guard is a
    leftover from supporting 3.10.

    ex = TypeError(f"Parameter 'name' is not of type 'str'.")
    ex.add_note(f"Got type '{getFullyQualifiedName(name)}'.")
    raise ex
  • The # pragma: no cover markers go with them: those lines were never covered because the false branch cannot be
    reached, and marking reachable code as uncoverable hides it from the coverage report.

Changes

  • from sys import version_info is dropped where nothing else used it.

Unit Tests

  • Unchanged: 108 passed. The one failure, DependencyScan.py::VHDL::test_VHDLLibrary (UnboundLocalError), fails
    the same way on dev.

Related Issues and Pull-Requests

  • Same cleanup in pyTooling (#277), pyEDAA.IPXACT and
    pyEDAA.Reports, following a review comment in
    pyTooling#274: "pyTooling is Python 3.11+, so no version check
    is required."

…supported Python

'Exception.add_note()' was added in Python 3.11, and this package requires 3.11 or newer
(setup.py: pythonVersions=("3.11", "3.12", "3.13", "3.14")), so 'if version_info >= (3, 11):' is
always true. Four guards removed, together with the now unused 'from sys import version_info'.

The '# pragma: no cover' markers go with them - those lines were never covered, because the false
branch cannot be reached.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 1.76%. Comparing base (ce27dc4) to head (8a6964f).

Files with missing lines Patch % Lines
pyEDAA/ProjectModel/__init__.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #138       +/-   ##
==========================================
- Coverage   69.74%   1.76%   -67.98%     
==========================================
  Files           3       1        -2     
  Lines        1160    1018      -142     
  Branches      199     176       -23     
==========================================
- Hits          809      18      -791     
- Misses        266    1000      +734     
+ Partials       85       0       -85     
Flag Coverage Δ
unittests 1.76% <0.00%> (-67.98%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant