chore: Restructure dependencies and add optional extras#1679
chore: Restructure dependencies and add optional extras#1679manishdait wants to merge 13 commits intohiero-ledger:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1679 +/- ##
=======================================
Coverage 93.25% 93.26%
=======================================
Files 141 141
Lines 9061 9073 +12
=======================================
+ Hits 8450 8462 +12
Misses 611 611 🚀 New features to boost your workflow:
|
AntonioCeppellini
left a comment
There was a problem hiding this comment.
Nice work! :D seems good to me!
I asked for curiosity the import thing :D.
aceppaluni
left a comment
There was a problem hiding this comment.
@manishdait This is great work
|
@manishdait do we need to test the build at the min and max edges, and create a workflow for future updates, or do you think the current tests suffice? |
Let me see what would be optimal and I’ll get back to you. |
exploreriii
left a comment
There was a problem hiding this comment.
Please ensure the python version is forward compatible
f79fa6d to
96a2d85
Compare
|
Hi, this is MergeConflictBot. Please resolve these conflicts locally and push the changes. Quick Fix for CHANGELOG.md ConflictsIf your conflict is only in CHANGELOG.md, you can resolve it easily using the GitHub web editor:
For all other merge conflicts, please read: Thank you for contributing! |
029ce9f to
9b4705d
Compare
exploreriii
left a comment
There was a problem hiding this comment.
Manish i think we need to update the README very clearly, maybe contributing.md, training/setup, possibly even the issue templates ?
0d46b38 to
8ea73a0
Compare
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
0fe9391 to
4499e9e
Compare
|
Hi @manishdait is this ready to review? |
Yes |
WalkthroughThe PR refactors SDK dependencies to follow Python library best practices: replacing strict version pins with compatibility ranges, moving build tools from runtime to build system, introducing optional extras for Ethereum-related features, and enabling Python 3.14+ forward compatibility. Additionally, equality comparison methods are added to PrivateKey and PublicKey classes with comprehensive test coverage. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| name: Dependency Compatibility Check | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - "pyproject.toml" | ||
| pull_request: | ||
| paths: | ||
| - "pyproject.toml" |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider adding workflow_dispatch trigger for manual re-runs.
Other workflows in this repo include workflow_dispatch. Adding it here would allow maintainers to manually trigger dependency checks without requiring a pyproject.toml change — useful for debugging CI failures.
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: "pip" |
There was a problem hiding this comment.
Python 3.14 likely needs allow-prereleases: true here as well.
Same concern as in pr-check-test.yml — Python 3.14 is pre-release until October 2026.
Proposed fix
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
+ allow-prereleases: true
cache: "pip"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| cache: "pip" |
| - name: Install minimum dependencies | ||
| run: | | ||
| uv pip install --resolution=lowest-direct -e ".[dev,lint,eth]" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check how dev, lint, and eth are defined in pyproject.toml
echo "=== [project.optional-dependencies] ==="
rg -A 20 '^\[project\.optional-dependencies\]' pyproject.toml
echo ""
echo "=== [dependency-groups] ==="
rg -A 20 '^\[dependency-groups\]' pyproject.tomlRepository: hiero-ledger/hiero-sdk-python
Length of output: 879
Fix uv pip install to use dependency-groups syntax instead of pip extras.
uv pip install -e ".[dev,lint,eth]" uses pip-style extras syntax (.[]), which only resolves names under [project.optional-dependencies]. However, dev and lint are defined under [dependency-groups] (PEP 735), so they will not be installed. This will cause the proto generation step (missing grpcio-tools) and test steps (missing pytest) to fail.
Use uv sync with --group flags, or move dev and lint to [project.optional-dependencies] to make them installable via the extras syntax.
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12", "3.13"] | ||
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
fd "pr-check-test.yml" .github/workflows/Repository: hiero-ledger/hiero-sdk-python
Length of output: 108
🏁 Script executed:
cat -n .github/workflows/pr-check-test.ymlRepository: hiero-ledger/hiero-sdk-python
Length of output: 6793
🌐 Web query:
actions/setup-python pre-release Python versions allow-prereleases documentation
💡 Result:
In actions/setup-python, pre-release (alpha/beta/rc) CPython builds are controlled by the allow-prereleases input documented under Advanced usage → “Allow pre-releases”. It:
- Defaults to
false. - When set to
true, it falls back to the newest pre-release if no matching GA (stable) release is available for the requested version (e.g., requesting3.14before 3.14 is GA). - For CPython, it only has an effect when you specify an
x.yversion range (like3.14, not3.14.1). [1]
Example from the docs section:
- uses: actions/setup-python@v6
with:
python-version: "3.14"
allow-prereleases: true[1]
Sources: actions/setup-python README (links to “Allow pre-releases”) [2], Advanced usage docs (“Allow pre-releases”) [1].
References:
[1] https://git.homeinfra.org/actions/setup-python/src/tag/v6/docs/advanced-usage.md
[2] https://github.com/actions/setup-python
Add allow-prereleases: true to setup-python for Python 3.14 support.
Python 3.14 is pre-release as of February 2026 (final release October 2026). The actions/setup-python action requires allow-prereleases: true to install pre-release Python versions; without it, the 3.14 matrix entry will fail.
Fix
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
+ allow-prereleases: true
cache: "pip"| - Refactored SDK dependencies to use version ranges, moved build-only deps out of runtime, removed unused core deps and added optional extras. | ||
|
|
There was a problem hiding this comment.
Missing changelog entry for __eq__ additions to PrivateKey and PublicKey.
Per the AI summary, this PR also adds __eq__ methods to PrivateKey and PublicKey classes. These are observable behavioral changes to the public API (equality semantics) and should have their own entry under ### Added.
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Description:
This PR updates the dependency configuration to improve install compatibility and reducing unnecessary dependencies while keeping the public API unchanged.
Changes Made:
eth[eth-keys, rlp]: used by EVM-related examples/testsgrpcio-tools) out of runtime dependenciesRelated issue(s):
Fixes #1674
Fixes #1680
Checklist