Skip to content
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

Remove usage of get_distribution function #262

Open
wants to merge 1 commit into
base: omega
Choose a base branch
from

Conversation

SpEcHiDe
Copy link

@SpEcHiDe SpEcHiDe commented Jun 15, 2024

This pull request proposes removing the usage of get_distribution function, since the Official Pyrogram is kind of abandoned, and there are countably infinite number of Pyrogram forks, which could be changed by just changing the requirements.txt file without changing any other places in this source code.

Summary by Sourcery

This pull request removes the usage of the get_distribution function for determining the Pyrogram version in status_utils.py. This change allows for easier switching between different Pyrogram forks by only modifying the requirements.txt file.

  • Enhancements:
    • Removed the usage of get_distribution function to determine the Pyrogram version, simplifying the version retrieval process.

Signed-off-by: Shrimadhav U K <[email protected]>
Copy link

sourcery-ai bot commented Jun 15, 2024

Reviewer's Guide by Sourcery

This pull request removes the usage of the get_distribution function from the bot/helper/ext_utils/status_utils.py file. The change is motivated by the fact that the official Pyrogram is no longer actively maintained, and there are many forks available. By removing the dependency on get_distribution, the code becomes more flexible and can easily switch between different Pyrogram forks by simply updating the requirements.txt file.

File-Level Changes

Files Changes
bot/helper/ext_utils/status_utils.py Removed the usage of get_distribution function and replaced it with a direct assignment to pyrogramversionstr.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @SpEcHiDe - 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

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines -83 to -84
try:
vpy = get_distribution("pyrofork").version
Copy link

Choose a reason for hiding this comment

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

question: Removed fallback for 'pyrofork' version.

The previous implementation had a fallback to get the version of 'pyrofork' if 'pyrogram' was not found. Removing this fallback might cause issues if 'pyrogram' is not available. Consider re-adding this fallback or ensuring 'pyrogramversionstr' covers both cases.

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.

None yet

1 participant