Skip to content

Package update and use of legacy code (websockets) for versions of Python below 3.10.#63

Merged
theshadow76 merged 2 commits intoChipaDevTeam:mainfrom
SantiiRepair:main
Mar 20, 2026
Merged

Package update and use of legacy code (websockets) for versions of Python below 3.10.#63
theshadow76 merged 2 commits intoChipaDevTeam:mainfrom
SantiiRepair:main

Conversation

@SantiiRepair
Copy link
Copy Markdown
Contributor

@SantiiRepair SantiiRepair commented Mar 20, 2026

According to the docs of websockets version 12.0, this support versions of Python equal to or greater than 3.8 and its legacy code maintains the use of the old keyword (extra_headers) until the current version 16.0.

Summary by CodeRabbit

  • Documentation

    • Removed outdated WebSocket error troubleshooting from README and Termux setup docs.
  • Chores

    • Bumped package version to 2.0.1.
    • Raised minimum websockets requirement to >=12.0 to improve compatibility.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ee6a6ef8-81cf-4cd6-88b3-cdd08f25a484

📥 Commits

Reviewing files that changed from the base of the PR and between d0501c8 and 7dbb2c5.

📒 Files selected for processing (1)
  • docs/termux-setup.html
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/termux-setup.html

📝 Walkthrough

Walkthrough

This pull request removes an outdated WebSocket troubleshooting note, bumps the package version to 2.0.1, migrates runtime and type usages to websockets.legacy.client, and raises the minimum websockets dependency from 11.0.0 to 12.0.

Changes

Cohort / File(s) Summary
Documentation Cleanup
README.md, docs/termux-setup.html
Removed the "Websockets version error" / "WebSocket Connection Error" troubleshooting sections and related guidance about installing websockets==11.0.
Package Version Update
pocketoptionapi_async/__init__.py
Bumped __version__ from 2.0.02.0.1.
WebSocket Legacy Migration
pocketoptionapi_async/connection_keep_alive.py, pocketoptionapi_async/websocket_client.py, tools/client_test.py
Switched imports/type annotations and connection calls to use websockets.legacy.client (WebSocketClientProtocol and connect(...)) instead of top-level websockets entry points.
Dependency Version Constraints
pyproject.toml, requirements.txt
Raised websockets minimum version from >=11.0.0>=12.0.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • theshadow76

Poem

🐰 Hopping through the changelog glade I see,
Legacy websockets set the connections free,
Version bumped, docs trimmed to shine,
Dependencies aligned in a tidy line,
A little rabbit cheers — code updated, glee! 🥕🫧

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 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 websockets package and switching to legacy client API for Python <3.10 compatibility.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

Tip

You can get early access to new features in CodeRabbit.

Enable the early_access setting to enable early access features such as new models, tools, and more.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the project's websockets library dependency to version 12.0 while proactively maintaining backward compatibility for Python environments that might not fully support the latest websockets API. By explicitly leveraging the websockets.legacy.client module, the changes prevent connection errors related to the extra_headers argument, ensuring stable WebSocket communication across a broader range of Python versions. The update also cleans up outdated documentation.

Highlights

  • Dependency Update: Updated the websockets dependency to version 12.0 across pyproject.toml and requirements.txt.
  • Python Version Compatibility: Implemented explicit usage of websockets.legacy.client for WebSocket connections to ensure compatibility with Python versions below 3.10, addressing potential extra_headers keyword argument errors.
  • Documentation Cleanup: Removed outdated troubleshooting instructions and traceback examples related to websockets version errors from README.md and docs/termux-setup.html.
  • Package Version Bump: Incremented the package version from 2.0.0 to 2.0.1 in pocketoptionapi_async/__init__.py.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully updates the websockets dependency to version 12.0 or higher and correctly implements the use of websockets.legacy.client for compatibility with Python versions below 3.10, as described. The removal of outdated traceback information from README.md and docs/termux-setup.html is a good cleanup, ensuring the documentation remains current and relevant.

Copy link
Copy Markdown

@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

🧹 Nitpick comments (1)
docs/termux-setup.html (1)

87-95: Consider adding a section header for the troubleshooting card.

After removing the WebSocket troubleshooting content, this card now contains "Permission Denied Errors" and "Memory Issues" but lacks an <h3> header like the other cards. Consider adding a header such as "Common Issues and Solutions" or "Troubleshooting" for consistency with the document structure.

📝 Suggested fix
 <div class="card">      
+     <h3>Common Issues and Solutions</h3>
       <h4>Permission Denied Errors</h4>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/termux-setup.html` around lines 87 - 95, The card containing the h4
entries "Permission Denied Errors" and "Memory Issues" lacks a top-level card
header; update the <div class="card"> block by adding an <h3> (e.g.,
"Troubleshooting" or "Common Issues and Solutions") immediately before the
existing <h4> elements so the card matches other sections' structure and heading
hierarchy; ensure the new <h3> text follows the document's tone and heading
levels used elsewhere.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pocketoptionapi_async/connection_keep_alive.py`:
- Around line 13-14: The imports at the top of connection_keep_alive.py are
absolute and will break when imported as part of the pocketoptionapi_async
package; change the two import statements to use package-relative imports (i.e.,
import ConnectionInfo and ConnectionStatus from .models and REGIONS from
.constants) so they match the rest of the package's style and resolve correctly
at runtime; update the import lines that currently reference models and
constants to use a leading dot.

---

Nitpick comments:
In `@docs/termux-setup.html`:
- Around line 87-95: The card containing the h4 entries "Permission Denied
Errors" and "Memory Issues" lacks a top-level card header; update the <div
class="card"> block by adding an <h3> (e.g., "Troubleshooting" or "Common Issues
and Solutions") immediately before the existing <h4> elements so the card
matches other sections' structure and heading hierarchy; ensure the new <h3>
text follows the document's tone and heading levels used elsewhere.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: af1d2f6a-4629-45d2-b3e3-e206f9625d95

📥 Commits

Reviewing files that changed from the base of the PR and between ffee654 and d0501c8.

📒 Files selected for processing (8)
  • README.md
  • docs/termux-setup.html
  • pocketoptionapi_async/__init__.py
  • pocketoptionapi_async/connection_keep_alive.py
  • pocketoptionapi_async/websocket_client.py
  • pyproject.toml
  • requirements.txt
  • tools/client_test.py
💤 Files with no reviewable changes (1)
  • README.md

Comment on lines 13 to 14
from models import ConnectionInfo, ConnectionStatus
from constants import REGIONS
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if other files in the package use relative imports consistently
rg -n "^from (models|constants) import" pocketoptionapi_async/

Repository: ChipaDevTeam/PocketOptionAPI

Length of output: 253


🏁 Script executed:

# List the structure of pocketoptionapi_async to see what modules exist
ls -la pocketoptionapi_async/ | head -20

Repository: ChipaDevTeam/PocketOptionAPI

Length of output: 908


🏁 Script executed:

# Check if models.py and constants.py exist in the directory
fd "^(models|constants)\.py$" pocketoptionapi_async/

Repository: ChipaDevTeam/PocketOptionAPI

Length of output: 138


🏁 Script executed:

# Check how other files in pocketoptionapi_async import from these modules
rg -n "from.*models import|from.*constants import" pocketoptionapi_async/ -A 1

Repository: ChipaDevTeam/PocketOptionAPI

Length of output: 1234


Relative imports missing leading dot.

The imports from models import ... and from constants import ... will fail when this module is imported as part of the pocketoptionapi_async package. All other files in the package use relative imports with a leading dot. They should be:

🐛 Proposed fix
-from models import ConnectionInfo, ConnectionStatus
-from constants import REGIONS
+from .models import ConnectionInfo, ConnectionStatus
+from .constants import REGIONS
📝 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
from models import ConnectionInfo, ConnectionStatus
from constants import REGIONS
from .models import ConnectionInfo, ConnectionStatus
from .constants import REGIONS
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pocketoptionapi_async/connection_keep_alive.py` around lines 13 - 14, The
imports at the top of connection_keep_alive.py are absolute and will break when
imported as part of the pocketoptionapi_async package; change the two import
statements to use package-relative imports (i.e., import ConnectionInfo and
ConnectionStatus from .models and REGIONS from .constants) so they match the
rest of the package's style and resolve correctly at runtime; update the import
lines that currently reference models and constants to use a leading dot.

@SantiiRepair
Copy link
Copy Markdown
Contributor Author

Actionable comments posted: 1

🧹 Nitpick comments (1)

docs/termux-setup.html (1)> 87-95: Consider adding a section header for the troubleshooting card.

After removing the WebSocket troubleshooting content, this card now contains "Permission Denied Errors" and "Memory Issues" but lacks an <h3> header like the other cards. Consider adding a header such as "Common Issues and Solutions" or "Troubleshooting" for consistency with the document structure.

📝 Suggested fix

 <div class="card">      
+     <h3>Common Issues and Solutions</h3>
       <h4>Permission Denied Errors</h4>

🤖 Prompt for AI Agents

Verify each finding against the current code and only fix it if needed.

In `@docs/termux-setup.html` around lines 87 - 95, The card containing the h4
entries "Permission Denied Errors" and "Memory Issues" lacks a top-level card
header; update the <div class="card"> block by adding an <h3> (e.g.,
"Troubleshooting" or "Common Issues and Solutions") immediately before the
existing <h4> elements so the card matches other sections' structure and heading
hierarchy; ensure the new <h3> text follows the document's tone and heading
levels used elsewhere.

🤖 Prompt for all review comments with AI agents

Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pocketoptionapi_async/connection_keep_alive.py`:
- Around line 13-14: The imports at the top of connection_keep_alive.py are
absolute and will break when imported as part of the pocketoptionapi_async
package; change the two import statements to use package-relative imports (i.e.,
import ConnectionInfo and ConnectionStatus from .models and REGIONS from
.constants) so they match the rest of the package's style and resolve correctly
at runtime; update the import lines that currently reference models and
constants to use a leading dot.

---

Nitpick comments:
In `@docs/termux-setup.html`:
- Around line 87-95: The card containing the h4 entries "Permission Denied
Errors" and "Memory Issues" lacks a top-level card header; update the <div
class="card"> block by adding an <h3> (e.g., "Troubleshooting" or "Common Issues
and Solutions") immediately before the existing <h4> elements so the card
matches other sections' structure and heading hierarchy; ensure the new <h3>
text follows the document's tone and heading levels used elsewhere.

ℹ️ Review info

Oh I'm sorry about that

@theshadow76 theshadow76 merged commit b78c30b into ChipaDevTeam:main Mar 20, 2026
2 checks passed
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.

2 participants