Skip to content

Remove the version checks around add_note() - #93

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

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

Conversation

@pyedaa-claude

@pyedaa-claude pyedaa-claude Bot commented Aug 17, 2026

Copy link
Copy Markdown

Bug Fixes

  • All 18 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.
  • A commented-out block carrying the same guard was updated with the others, so it doesn't reintroduce the pattern when someone uncomments it.

Unit Tests

  • Not run: pyEDAA.IPXACT does not import on dev - pyEDAA/IPXACT/__init__.py:165 uses _IPXACT_10_INDEX and
    eight more _IPXACT_*_INDEX names that are never defined, so every testcase fails collection with a NameError
    before and after this change (7 collection errors on both). The modules compile, and the change is mechanical.
    Reported separately - it means the package is currently unusable.

Related Issues and Pull-Requests

  • Same cleanup in pyTooling (#277), pyEDAA.ProjectModel 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. 18 guards removed, together with the now unused 'from sys import version_info' in four
modules; a commented-out block carrying the same guard was updated with it.

Every note is now attached unconditionally, which also removes 18 '# pragma: no cover' markers -
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 10.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.40%. Comparing base (a9d4510) to head (61bdf5a).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
pyEDAA/IPXACT/__init__.py 0.00% 11 Missing ⚠️
pyEDAA/IPXACT/Catalog.py 25.00% 3 Missing ⚠️
pyEDAA/IPXACT/Component.py 33.33% 2 Missing ⚠️
pyEDAA/IPXACT/Design.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #93      +/-   ##
==========================================
- Coverage   56.78%   55.40%   -1.39%     
==========================================
  Files           5        5              
  Lines         847      861      +14     
  Branches      161      161              
==========================================
- Hits          481      477       -4     
- Misses        326      344      +18     
  Partials       40       40              
Flag Coverage Δ
unittests 55.40% <10.00%> (-1.39%) ⬇️

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.

This branch had an error being deployed

1 failed deployment
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.

2 participants