Skip to content

[CHORE] sync dev with master#414

Merged
aarmoa merged 6 commits into
devfrom
fix/sync_dev_with_master
May 18, 2026
Merged

[CHORE] sync dev with master#414
aarmoa merged 6 commits into
devfrom
fix/sync_dev_with_master

Conversation

@aarmoa
Copy link
Copy Markdown
Collaborator

@aarmoa aarmoa commented May 18, 2026

Sync dev branch with latest changes from master

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced cookie expiration validation logic to use consistent timestamp comparison, improving the reliability of cookie authentication checks across different runtime environments.
  • Chores

    • Version bumped to 1.14.1.
    • Expanded Python runtime support to include Python 3.13 and 3.14 (now supports >=3.10,<3.15).

Review Change Stack

aarmoa added 6 commits April 27, 2026 15:22
release/v1_19_changes_to_master_for_v1_14_release
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.
…cy_version

fix/update_python_dependency_version
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

📝 Walkthrough

Walkthrough

Release v1.14.1 bumps the package version, expands Python runtime support to versions 3.13 and 3.14, fixes timezone-aware datetime comparison in cookie expiration logic, and simplifies the broadcaster test by removing unused mocks.

Changes

Release 1.14.1 updates

Layer / File(s) Summary
Release v1.14.1 version and Python compatibility
pyproject.toml, CHANGELOG.md
Package version incremented to 1.14.1 and Python version constraint expanded from >=3.10,<3.13 to >=3.10,<3.15 to support Python 3.13 and 3.14. Release notes document the Python version update.
Cookie expiration timezone-aware datetime comparison
pyinjective/core/network.py
ExpiringCookieAssistant._is_cookie_expired() ensures parsed expiration timestamps include UTC timezone information and compares using timezone-aware datetime.now(timezone.utc) instead of naive utcnow().
Broadcaster test simplification
tests/core/test_broadcaster.py
Removed unused AsyncClient and Composer imports and updated test_broadcast_address_in_ofac_list to pass client=None, eliminating unnecessary mock setup while preserving exception validation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A little hop, a version bump—from 1.14.0 to .1,
Python 3.13 joins the dance beneath the sun.
Timezones now aware, datetimes align so true,
Tests simplified, and cleaner too! Hooray for v1.14.1's debut! 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Title check ❓ Inconclusive The title '[CHORE] sync dev with master' is overly generic and does not clearly convey the specific changes made in the PR, which include Python version updates, timezone-aware datetime fixes, and test refactoring. Use a more descriptive title that reflects the main technical changes, such as 'Update Python version support to 3.14/3.15 and fix timezone-aware datetime handling' or 'Fix Python 3.14+ compatibility and timezone-aware cookie expiration checks'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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/sync_dev_with_master

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

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

🧹 Nitpick comments (1)
pyproject.toml (1)

24-24: ⚡ Quick win

Align Black target-version with the Python range that includes 3.13 and 3.14.

The declared Python support python = ">=3.10,<3.15" includes versions 3.13 and 3.14, but tool.black.target-version only specifies ["py310", "py311", "py312"]. Add py313 and py314 to keep Black's formatting behavior consistent with the declared runtime support.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` at line 24, The Black configuration's target versions in
tool.black.target-version must match the declared Python support range; update
the tool.black.target-version entry (the list under the tool.black section) to
include "py313" and "py314" in addition to the existing "py310","py311","py312"
so Black's formatting targets align with python = ">=3.10,<3.15".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 7: Replace the misleading phrase "Python v1.14" in CHANGELOG.md with the
correct wording "Python 3.14" (or "Python 3.13/3.14" if both are intended);
locate the line containing the text "Update Python version limitation to
">=3.10,<3.15" to support Python v1.14" and update only the human-readable
version reference to "Python 3.14" (or the dual "Python 3.13/3.14") while
leaving the version constraint string ">=3.10,<3.15" unchanged.

In `@tests/core/test_broadcaster.py`:
- Around line 34-39: The test currently allows unrelated constructor failures
because it uses pytest.raises(Exception) and passes client=None; update the test
for MsgBroadcasterWithPk to supply a valid mock client (replace client=None with
a Mock client) and narrow the assertion to the OFAC-specific failure by using
pytest.raises with either the OFAC-specific exception class (e.g., OFACError or
OFACDeniedError) or pytest.raises(Exception, match="OFAC") so the failure is
asserted against an OFAC-related error message rather than any constructor
error.

---

Nitpick comments:
In `@pyproject.toml`:
- Line 24: The Black configuration's target versions in
tool.black.target-version must match the declared Python support range; update
the tool.black.target-version entry (the list under the tool.black section) to
include "py313" and "py314" in addition to the existing "py310","py311","py312"
so Black's formatting targets align with python = ">=3.10,<3.15".
🪄 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: 1e36b02d-7edf-484c-a22a-b920a7806426

📥 Commits

Reviewing files that changed from the base of the PR and between 10da834 and 8e54863.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • CHANGELOG.md
  • pyinjective/core/network.py
  • pyproject.toml
  • tests/core/test_broadcaster.py

Comment thread CHANGELOG.md

## [1.14.1] - 2026-04-29
### Changed
- Update Python version limitation to ">=3.10,<3.15" to support Python 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 incorrect Python version wording in the changelog.

Line 7 says “Python v1.14”, which is misleading. Please change it to “Python 3.14” (or “Python 3.13/3.14” if both are intended).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` at line 7, Replace the misleading phrase "Python v1.14" in
CHANGELOG.md with the correct wording "Python 3.14" (or "Python 3.13/3.14" if
both are intended); locate the line containing the text "Update Python version
limitation to ">=3.10,<3.15" to support Python v1.14" and update only the
human-readable version reference to "Python 3.14" (or the dual "Python
3.13/3.14") while leaving the version constraint string ">=3.10,<3.15"
unchanged.

Comment on lines 34 to 39
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

Narrow the exception assertion to the OFAC-specific failure path.

Using pytest.raises(Exception) with client=None can let this test pass due to unrelated constructor failures (e.g., None client usage) instead of OFAC enforcement. Please assert a specific exception type or at least an OFAC-related message match.

Suggested test tightening
-        with pytest.raises(Exception):
+        with pytest.raises(Exception, match="OFAC|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|sanction"):
_ = MsgBroadcasterWithPk(
network=network,
account_config=account_config,
client=None,
fee_calculator=Mock(),
🧰 Tools
🪛 Ruff (0.15.12)

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

(B017)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/core/test_broadcaster.py` around lines 34 - 39, The test currently
allows unrelated constructor failures because it uses pytest.raises(Exception)
and passes client=None; update the test for MsgBroadcasterWithPk to supply a
valid mock client (replace client=None with a Mock client) and narrow the
assertion to the OFAC-specific failure by using pytest.raises with either the
OFAC-specific exception class (e.g., OFACError or OFACDeniedError) or
pytest.raises(Exception, match="OFAC") so the failure is asserted against an
OFAC-related error message rather than any constructor error.

@socket-security
Copy link
Copy Markdown

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
Updatedblack@​25.12.0 ⏵ 26.3.186100 +16100100100
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

@aarmoa aarmoa merged commit c3d1dd1 into dev May 18, 2026
27 checks passed
@aarmoa aarmoa deleted the fix/sync_dev_with_master branch May 18, 2026 15:37
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