Skip to content

FIX: expose Edb deprecations statically for grpc and dotnet backends#1980

Merged
svandenb-dev merged 10 commits intomainfrom
statric-deprecation-aware
Apr 2, 2026
Merged

FIX: expose Edb deprecations statically for grpc and dotnet backends#1980
svandenb-dev merged 10 commits intomainfrom
statric-deprecation-aware

Conversation

@svandenb-dev
Copy link
Copy Markdown
Collaborator

@svandenb-dev svandenb-dev commented Apr 1, 2026

This PR makes deprecated PyEDB APIs visible to static analysis tools and IDEs across the package, while preserving the existing runtime deprecation warnings.
The original issue was first observed with top-level backend selection:

from pyedb import Edb

edb = Edb(edbpath="my_project.aedb", grpc=True)
edb.save_edb()

In this case, deprecation warnings were active at runtime, but PyCharm did not show methods like save_edb() as deprecated.
Root cause
PyEDB already had runtime deprecation decorators:

  • deprecated
  • deprecated_property
  • deprecated_class
    However, those decorators only emitted warnings at runtime and did not provide a standard static deprecation path for IDEs/type checkers.
    There was also a typing aspect:
  • the top-level Edb overload path needed to resolve clearly to the concrete backend classes so IDEs could inspect the right API surface for grpc=True and grpc=False.

What changed

  1. Package-wide deprecation metadata via shared decorators
    Updated the shared deprecation helpers in:
  • src/pyedb/misc/decorators.py
  • src/pyedb/misc/decorators.pyi
    so that deprecated symbols expose static deprecation metadata in addition to runtime warnings.
    This allows existing deprecated APIs across the package to benefit from a centralized solution rather than patching each file independently.
  1. Top-level Edb stub resolution
    Updated:
  • src/pyedb/init.pyi
  • src/pyedb/generic/design_types.pyi
    so the overloads resolve directly to the concrete backend classes:
  • gRPC backend
  • dotnet backend
    This improves IDE inference for top-level usage:
from pyedb import Edb

and makes backend-specific deprecated members discoverable.
3. Backend-specific deprecated APIs
Added static deprecation coverage for deprecated Edb APIs in:

  • src/pyedb/grpc/edb.py
  • src/pyedb/dotnet/edb.py
    Added and extended integration coverage in:
  • tests/integration/test_edb_deprecation_metadata.py

closes #1981

@svandenb-dev svandenb-dev self-assigned this Apr 1, 2026
@github-actions github-actions bot added maintenance Package and maintenance related dependencies Related with project dependencies testing Anything related to testing labels Apr 1, 2026
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 1, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 11 duplication

Metric Results
Duplication 11

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 94.79167% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.93%. Comparing base (5cbae21) to head (5303933).
⚠️ Report is 61 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1980       +/-   ##
===========================================
- Coverage   70.20%   48.93%   -21.28%     
===========================================
  Files         261      263        +2     
  Lines       42416    43069      +653     
===========================================
- Hits        29779    21074     -8705     
- Misses      12637    21995     +9358     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@svandenb-dev svandenb-dev enabled auto-merge (squash) April 2, 2026 09:59
@svandenb-dev svandenb-dev merged commit f0a3e23 into main Apr 2, 2026
46 of 48 checks passed
@svandenb-dev svandenb-dev deleted the statric-deprecation-aware branch April 2, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Related with project dependencies maintenance Package and maintenance related testing Anything related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expose Edb deprecations statically for grpc and dotnet backends

4 participants