honey-team / ufpy

Ufpy (Useful Python) - package for Python with some useful features
https://honey-team.github.io/ufpy-website
MIT License
3 stars 3 forks source link

gh-51: Fix module installation error with ```requests``` #52

Closed Alexandr153 closed 2 weeks ago

Alexandr153 commented 2 weeks ago

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:

Снимок экрана 2024-08-31 в 17 42 06

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:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This 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

Change Details Files
Update 'get()' function calls to use 'requests.get()'
  • Replace 'r = get(url, timeout=10)' with 'r = requests.get(url, timeout=10)'
  • Replace 'r = get(url)' with 'r = requests.get(url)'
ufpy/github/download.py

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
n0n1m commented 2 weeks ago

That's totally not the issue.

n0n1m commented 2 weeks ago

The issue is the library code running without requests installed

n0n1m commented 2 weeks ago

That's how discord.py addresses this issue: https://github.com/Rapptz/discord.py/blob/master/setup.py

n0n1m commented 2 weeks ago

I'll make pull request with my fix in a sec

n0n1m commented 2 weeks ago

@bleudev I recomend closing this request

bleudev commented 2 weeks ago

@Alexandr153 It's really fixes an issue? I used this import because of i don't need to use all methods from requests. Only get(). Can you explain me this method of solving this problem?

bleudev commented 2 weeks ago

I merged #53. Can this solve this problem?

bleudev commented 2 weeks ago

@bleudev I recomend closing this request

Too