Skip to content

fix/update_python_dependency_version#413

Merged
aarmoa merged 4 commits intomasterfrom
fix/update_python_dependency_version
Apr 30, 2026
Merged

fix/update_python_dependency_version#413
aarmoa merged 4 commits intomasterfrom
fix/update_python_dependency_version

Conversation

@aarmoa
Copy link
Copy Markdown
Collaborator

@aarmoa aarmoa commented Apr 30, 2026

  • Update Python version limitation to ">=3.10,<3.15" to support Python v1.14

Summary by CodeRabbit

  • Chores
    • Release bumped to 1.14.1 and supported Python upper bound extended to include 3.13 and 3.14 (minimum remains 3.10).
  • Bug Fixes
    • Cookie expiration checks made timezone-aware using UTC to prevent incorrect expiry handling.
  • Tests
    • Broadcaster test updated to instantiate without external client/composer while still validating OFAC-blocked address behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4f78318d-2ac5-41d5-8c56-c6729782df4a

📥 Commits

Reviewing files that changed from the base of the PR and between 70af961 and 12a31a9.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • tests/core/test_broadcaster.py
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/core/test_broadcaster.py

📝 Walkthrough

Walkthrough

Bumps package version to 1.14.1, relaxes Python upper bound to <3.15, makes cookie expiration checks timezone-aware in pyinjective/core/network.py, adds a changelog entry, and simplifies a broadcaster test to instantiate with client=None.

Changes

Cohort / File(s) Summary
Packaging & Metadata
pyproject.toml, CHANGELOG.md
Version bumped 1.14.01.14.1; Python constraint widened from ">=3.10,<3.13" to ">=3.10,<3.15"; new changelog entry for 1.14.1.
Cookie expiration logic
pyinjective/core/network.py
ExpiringCookieAssistant._is_cookie_expired now ensures parsed expiration times are UTC-aware (sets tzinfo when missing) and compares against datetime.now(timezone.utc) rather than naive utcnow().
Tests
tests/core/test_broadcaster.py
test_broadcast_address_in_ofac_list simplified to instantiate MsgBroadcasterWithPk(client=None) (removed mocked Composer/AsyncClient usage) and still asserts exception for banned address.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibbled at timestamps by night,
I gave each date a UTC light,
A tiny version hop, a changelog cheer,
Tests trimmed down — the path is clear,
Hooray, I hopped the code just right! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating the Python dependency version from <3.13 to <3.15 in pyproject.toml, which is the primary alteration across the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/update_python_dependency_version

Review rate limit: 4/5 reviews remaining, refill in 12 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Apr 30, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedcertifi@​2025.11.12 ⏵ 2026.4.2210010010010070
Updatedckzg@​2.1.5 ⏵ 2.1.710010090100100
Updatedbitarray@​3.8.0 ⏵ 3.8.194 +1100100100100
Updatedcharset-normalizer@​3.4.4 ⏵ 3.4.799100100100100
Updatedattrs@​25.4.0 ⏵ 26.1.0100 +1100100100100
Updatedcchecksum@​0.3.5 ⏵ 0.4.3100 +1100100100100

View full report

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pyproject.toml (1)

73-73: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update Black target-version to match extended Python support.

The target-version for Black still only includes ["py310", "py311", "py312"], but line 24 extends Python support to <3.15. Black should be configured to target Python 3.13 and 3.14 as well to ensure correct formatting for syntax features available in those versions.

🛠️ Proposed fix to align Black configuration
-target-version = ["py310", "py311", "py312"]
+target-version = ["py310", "py311", "py312", "py313", "py314"]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` at line 73, Update the Black configuration's target-version
array to include Python 3.13 and 3.14 so it matches the extended support;
specifically modify the target-version setting (currently
["py310","py311","py312"]) to include "py313" and "py314" (e.g.
["py310","py311","py312","py313","py314"]) so Black will format for those newer
syntax features.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pyproject.toml`:
- Line 24: Update the Python version constraint in pyproject.toml from the
restrictive "python = \">=3.10,<3.15\"" to a range that includes 3.6–3.14 (for
example "python = \">=3.6,<3.15\"") so packages like hdwallets (3.6–3.9) remain
compatible, and then update the Black configuration under [tool.black] to add
target-version entries for py313 and py314 (in the target-version list) so
formatting targets Python 3.13 and 3.14 as requested.

---

Outside diff comments:
In `@pyproject.toml`:
- Line 73: Update the Black configuration's target-version array to include
Python 3.13 and 3.14 so it matches the extended support; specifically modify the
target-version setting (currently ["py310","py311","py312"]) to include "py313"
and "py314" (e.g. ["py310","py311","py312","py313","py314"]) so Black will
format for those newer syntax features.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 86e303f3-71b4-41a2-a9f8-698f621fcc46

📥 Commits

Reviewing files that changed from the base of the PR and between 6c0a588 and fe637cc.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • pyproject.toml

Comment thread pyproject.toml

[tool.poetry.dependencies]
python = ">=3.10,<3.13"
python = ">=3.10,<3.15"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

What is the latest stable Python 3.x release as of April 2026?

💡 Result:

As of April 30, 2026, the latest stable Python 3.x release is Python 3.14.4 (released April 7, 2026).

Citations:


🏁 Script executed:

#!/bin/bash
# Description: Check PyPI metadata for key dependencies to verify Python 3.14 support

echo "Checking Python version classifiers for key dependencies..."

for pkg in aiohttp bech32 bip32 ecdsa eip712 eth-pydantic-types grpcio grpcio-tools hdwallets mnemonic protobuf requests safe-pysha3 websockets web3; do
  echo "=== $pkg ==="
  curl -s "https://pypi.org/pypi/$pkg/json" | jq -r '.info.classifiers[] | select(startswith("Programming Language :: Python :: 3"))'
  echo ""
done

Repository: InjectiveLabs/sdk-python

Length of output: 3430


Fix Python version constraint: several dependencies are incompatible with Python 3.10+ requirements.

While Python 3.14.4 is stable (released April 7, 2026), this constraint introduces runtime compatibility issues:

  • hdwallets declares support only for Python 3.6–3.9, making it incompatible with the stated minimum of Python 3.10.
  • ecdsa, mnemonic, and safe-pysha3 do not explicitly declare Python 3.14 support (max declared: 3.13, 3.11, 3.13 respectively).
  • grpcio-tools and several others lack specific version classifiers.

Additionally, update the Black target-version on line 73 to include py313 and py314 to align with the expanded Python support.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` at line 24, Update the Python version constraint in
pyproject.toml from the restrictive "python = \">=3.10,<3.15\"" to a range that
includes 3.6–3.14 (for example "python = \">=3.6,<3.15\"") so packages like
hdwallets (3.6–3.9) remain compatible, and then update the Black configuration
under [tool.black] to add target-version entries for py313 and py314 (in the
target-version list) so formatting targets Python 3.13 and 3.14 as requested.

aarmoa added 2 commits April 29, 2026 22:40
Avoid creating AsyncClient in the OFAC broadcaster unit test so it no longer depends on an implicit event loop, which fails on Python 3.14. Also replace utcnow() in network cookie expiration checks with timezone-aware UTC comparisons to remove deprecation warnings and ensure correct expiry handling.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/core/test_broadcaster.py (1)

10-11: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove stale imports to keep pre-commit passing.

AsyncClient and Composer are unused now and are already reported by CI (ruff) as lint violations.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/core/test_broadcaster.py` around lines 10 - 11, Remove the now-unused
imports AsyncClient and Composer from the top of the test file; locate the
import statement that reads "from pyinjective.async_client_v2 import
AsyncClient" and "from pyinjective.composer_v2 import Composer" and delete those
two imports so the test no longer references AsyncClient or Composer and the
linter/ruff violations are resolved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Line 7: Fix the typo and version wording in the changelog line: replace
"Pythong" with "Python" and change "v1.14" to "3.14" so the line reads that the
Python version limitation was updated to ">=3.10,<3.15" to support Python 3.14;
update the text containing the original phrase "- Update Python version
limitation to ">=3.10,<3.15" to support Pythong v1.14" accordingly.

In `@tests/core/test_broadcaster.py`:
- Around line 36-42: The test currently uses pytest.raises(Exception) when
constructing MsgBroadcasterWithPk(network=network,
account_config=account_config, client=None, fee_calculator=Mock()), which is too
broad; change the assertion to expect the OFAC-specific failure by using
pytest.raises with the specific OFAC-related exception type (e.g., OFACError or
OfacCheckFailed) or, if no dedicated exception class exists, use
pytest.raises(Exception, match="OFAC") (or a precise OFAC error substring) to
ensure the constructor call to MsgBroadcasterWithPk fails for OFAC reasons
rather than an unrelated None client error.

---

Outside diff comments:
In `@tests/core/test_broadcaster.py`:
- Around line 10-11: Remove the now-unused imports AsyncClient and Composer from
the top of the test file; locate the import statement that reads "from
pyinjective.async_client_v2 import AsyncClient" and "from
pyinjective.composer_v2 import Composer" and delete those two imports so the
test no longer references AsyncClient or Composer and the linter/ruff violations
are resolved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dd9ef884-44f5-4cfd-8a73-d8de67d811bd

📥 Commits

Reviewing files that changed from the base of the PR and between fe637cc and 70af961.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • pyinjective/core/network.py
  • pyproject.toml
  • tests/core/test_broadcaster.py
✅ Files skipped from review due to trivial changes (1)
  • pyproject.toml

Comment thread CHANGELOG.md Outdated

## [1.14.1] - 2026-04-29
### Changed
- Update Python version limitation to ">=3.10,<3.15" to support Pythong v1.14
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix typo and version format in changelog entry.

Line 7 contains two issues:

  1. "Pythong" should be "Python"
  2. "v1.14" should be "3.14" (referring to Python 3.14, not v1.14)
📝 Proposed fix
-- Update Python version limitation to ">=3.10,<3.15" to support Pythong v1.14
+- Update Python version limitation to ">=3.10,<3.15" to support Python 3.14
📝 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.

Suggested change
- Update Python version limitation to ">=3.10,<3.15" to support Pythong v1.14
- Update Python version limitation to ">=3.10,<3.15" to support Python 3.14
🧰 Tools
🪛 LanguageTool

[grammar] ~7-~7: Ensure spelling is correct
Context: ...limitation to ">=3.10,<3.15" to support Pythong v1.14 ## [1.14.0] - 2026-04-27 ### Cha...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~7-~7: Ensure spelling is correct
Context: ... ">=3.10,<3.15" to support Pythong v1.14 ## [1.14.0] - 2026-04-27 ### Changed - Upda...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 7, Fix the typo and version wording in the changelog
line: replace "Pythong" with "Python" and change "v1.14" to "3.14" so the line
reads that the Python version limitation was updated to ">=3.10,<3.15" to
support Python 3.14; update the text containing the original phrase "- Update
Python version limitation to ">=3.10,<3.15" to support Pythong v1.14"
accordingly.

Comment on lines 36 to 42
with pytest.raises(Exception):
_ = MsgBroadcasterWithPk(
network=network,
account_config=account_config,
client=client,
composer=composer,
client=None,
fee_calculator=Mock(),
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Tighten the expected failure to OFAC-specific behavior.

At Line 36, pytest.raises(Exception) is too broad. With client=None on Line 40, unrelated constructor errors can satisfy the assertion and make the test pass for the wrong reason. Please assert a specific exception type (or at least match an OFAC-related error message).

Suggested test hardening
-        with pytest.raises(Exception):
+        with pytest.raises(Exception, match="OFAC|blocked|sanction"):
             _ = MsgBroadcasterWithPk(
                 network=network,
                 account_config=account_config,
                 client=None,
                 fee_calculator=Mock(),
             )
📝 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.

Suggested change
with pytest.raises(Exception):
_ = MsgBroadcasterWithPk(
network=network,
account_config=account_config,
client=client,
composer=composer,
client=None,
fee_calculator=Mock(),
)
with pytest.raises(Exception, match="OFAC|blocked|sanction"):
_ = MsgBroadcasterWithPk(
network=network,
account_config=account_config,
client=None,
fee_calculator=Mock(),
)
🧰 Tools
🪛 Ruff (0.15.12)

[warning] 36-36: Do not assert blind exception: Exception

(B017)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/core/test_broadcaster.py` around lines 36 - 42, The test currently uses
pytest.raises(Exception) when constructing MsgBroadcasterWithPk(network=network,
account_config=account_config, client=None, fee_calculator=Mock()), which is too
broad; change the assertion to expect the OFAC-specific failure by using
pytest.raises with the specific OFAC-related exception type (e.g., OFACError or
OfacCheckFailed) or, if no dedicated exception class exists, use
pytest.raises(Exception, match="OFAC") (or a precise OFAC error substring) to
ensure the constructor call to MsgBroadcasterWithPk fails for OFAC reasons
rather than an unrelated None client error.

@aarmoa aarmoa merged commit 8e54863 into master Apr 30, 2026
14 checks passed
@aarmoa aarmoa deleted the fix/update_python_dependency_version branch April 30, 2026 02:02
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