-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-51: Fix module installation error with requests
#52
Conversation
Reviewer's Guide by SourceryThis pull request addresses an issue with the module installation error related to the 'requests' library. The main change involves updating the way the 'get()' function is called, ensuring compatibility with the latest version of the 'requests' module. File-Level Changes
Tips
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Alexandr153 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
@@ -62,7 +62,7 @@ def __init__(self, repo: str, base_download_path: str = CWD, branch_name: str = | |||
|
|||
def __enter__(self): | |||
url = f'https://github.com/{self.__repo}/archive/{self.__branch}.zip' | |||
r = get(url, timeout=10) | |||
r = requests.get(url, timeout=10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (performance): Consider adding a timeout to the requests.get call in the download_file method
For consistency with the enter method and to prevent hanging on slow connections, it might be beneficial to add a timeout parameter to this request as well.
r = requests.get(url, timeout=10) | |
r = requests.get(url, timeout=(5, 30)) |
That's totally not the issue. |
The issue is the library code running without requests installed |
That's how discord.py addresses this issue: https://github.com/Rapptz/discord.py/blob/master/setup.py |
I'll make pull request with my fix in a sec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is literally the same thing
@bleudev I recomend closing this request |
@Alexandr153 It's really fixes an issue? I used this import because of i don't need to use all methods from requests. Only |
I merged #53. Can this solve this problem? |
Too |
I think you are working with an old version of the requests module, because the latest version specifies at the very beginning how the get() object should be used:
Proposal:
import requests
requests.get()
Summary by Sourcery
Fix the module installation error by updating the code to use 'requests.get()' explicitly, ensuring compatibility with the latest version of the 'requests' library.
Bug Fixes: