Skip to content

Address DIDCommV2 Service Endpoint definitions (#104) and update dependencies to support Pydantic 2.x (#114).#113

Draft
hpretila wants to merge 6 commits intosicpa-dlab:mainfrom
hpretila:main
Draft

Address DIDCommV2 Service Endpoint definitions (#104) and update dependencies to support Pydantic 2.x (#114).#113
hpretila wants to merge 6 commits intosicpa-dlab:mainfrom
hpretila:main

Conversation

@hpretila
Copy link

@hpretila hpretila commented Feb 15, 2026

This pull request updates the project's pydid dependency to achieve two things;

Other dependencies such as attrs, pycryptodomex and Authlib were updated [non-exhaustive] as well developer dependencies such as pytest and pytest-asyncio.

Summary of Changes

  • Dependency Updates:

    • Modified pyproject.toml to raise the minimum Python version from 3.7 to 3.10, since 3.9 is at EOL and pytest no longer supports 3.9 and lower.
    • Updated version constraints for key dependencies, including pydid (to >=0.5.2), pydantic (to >=2.7.0), attrs, Authlib, and others to allow for newer versions.
  • Code Adjustments for DIDCommV2: [TBD, still working on these!]

    • Update(d) the extension methods for lookups to check both object-style DIDCommV2Service service definitions and flat-style DIDCommV1Service service definitions.
    • Update(d) testing to use DIDCommV2Service models.
  • Code Adjustments for Pydantic 2.0:

    • Refactored tests to align with changes in attrs and Pydantic v2, particularly around stricter model validation and data conversion to support it.
    • Made minor adjustments in didcomm/pack_encrypted.py, didcomm/core/utils.py, and didcomm/protocols/routing/forward.py generated by Black and flake8 automated formatting.
    • Updated tests across the suite to match the new behavior and APIs of the upgraded libraries, including new subclasses in pydid and the .to_dict() to .model_dump() migration in Pydantic v2.
  • Workflow changes:

    • Due to pytest deprecating support to 3.9 and lower, workflows have also been updated to use 3.10 and higher, and omitting 3.7, 3.8 and 3.9. This may break preexisting tests on main.

Key Files Modified

  • pyproject.toml
  • message.py
  • didcomm/pack_encrypted.py
  • didcomm/core/defaults.py
  • didcomm/core/utils.py
  • didcomm/protocols/routing/forward.py
  • Various test files under tests/unit/ and tests/test_vectors/ to align with the changes.

Breaking Changes

  • Python Version: The minimum required Python version is now 3.10. This will be a breaking change for users on Python 3.7, 3.8, or 3.9, as well as preexisting Github actions running 3.7, 3.8 and 3.9.
  • Dependency Versions: The upgrade to newer major versions of pydid and pydantic may introduce changes per pydid and pydantic. While the code and tests have been adapted and no major API changes have been made, downstream consumers should verify compatibility with their own use cases, especially regarding the stricter validation of VerificationMethod types introduced in newer versions of pydid.

Testing

All existing tests have been updated and confirmed to pass with the new dependency set using poetry run pytest.

@hpretila hpretila changed the title Update dependency range and bump pydid to 0.5.x. Support Pydantic V2, update dependency ranges and bump pydid to 0.5.x. Feb 15, 2026
@hpretila hpretila changed the title Support Pydantic V2, update dependency ranges and bump pydid to 0.5.x. Support pydantic versions 2.x.x and update dependency ranges and bump pydid to 0.5.x. Feb 15, 2026
@hpretila hpretila changed the title Support pydantic versions 2.x.x and update dependency ranges and bump pydid to 0.5.x. Address #144: Support pydantic versions 2.x.x, bump pydid to 0.5.x and update dependencies. Feb 15, 2026
@hpretila hpretila changed the title Address #144: Support pydantic versions 2.x.x, bump pydid to 0.5.x and update dependencies. Fix #144: Support pydantic versions 2.x.x, bump pydid to 0.5.x and update dependencies. Feb 15, 2026
@hpretila hpretila changed the title Fix #144: Support pydantic versions 2.x.x, bump pydid to 0.5.x and update dependencies. Fix #114: Support pydantic versions 2.x.x, bump pydid to 0.5.x and update dependencies. Feb 15, 2026
@hpretila hpretila marked this pull request as draft February 15, 2026 14:44
@hpretila hpretila changed the title Fix #114: Support pydantic versions 2.x.x, bump pydid to 0.5.x and update dependencies. Address DIDCommV2 Service Endpoint definitions (#104) and update dependencies to support Pydantic 2.x (#114). Feb 15, 2026
@hpretila
Copy link
Author

Pulled back to draft state and updated the scope so it's not just a version bump.

Looking to address #104 to support the spec when it comes to DIDCommV2 DIDCommMessaging service definitions. Cognisant that other peers may still use the did-communication convention for discovery such as in Acapy; openwallet-foundation/acapy#2864 (comment).

Unsure if each type is exclusive to DIDCommV2 and DIDCommV1 respectively.

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