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

Fix requirement being used before installing #53

Merged
merged 2 commits into from
Aug 31, 2024
Merged

Conversation

n0n1m
Copy link
Member

@n0n1m n0n1m commented Aug 31, 2024

Fixes #51

Summary by Sourcery

Fix the requirement of using the package version before installation by introducing a function to derive the version dynamically from the source code.

Bug Fixes:

  • Fix the issue of using the package version before it is installed by deriving the version dynamically from the source code.

Copy link
Contributor

sourcery-ai bot commented Aug 31, 2024

Reviewer's Guide by Sourcery

This pull request fixes an issue where a requirement was being used before installation. The main change involves modifying the setup.py file to dynamically derive the version number instead of importing it from the package.

File-Level Changes

Change Details Files
Implement dynamic version derivation in setup.py
  • Remove import of version from ufpy
  • Add import of re module
  • Implement derive_version() function
  • Use derive_version() to set version
setup.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:
    • 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
Contributor

@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 @n0n1m - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The version derivation logic seems overly complex for this use case. Consider simplifying it unless there's a specific need for handling pre-release versions and git integration.
  • Please provide proper attribution and ensure compliance with the license for the code borrowed from discord.py. Avoid using terms like 'stolen' in comments.
  • It would be helpful to explain the rationale behind this change in the PR description. Why was this complex version derivation necessary?
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 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.

setup.py Outdated Show resolved Hide resolved
setup.py Show resolved Hide resolved
@bleudev
Copy link
Member

bleudev commented Aug 31, 2024

@n0n1m Thank you for your work!

@bleudev bleudev merged commit 27fb280 into honey-team:main Aug 31, 2024
2 checks passed
@Alexandr153
Copy link

pls try my method. I'm not saying that it will definitely help, but there have been a lot of changes with requests in recent versions

Снимок экрана 2024-08-31 в 22 32 45

@n0n1m
Copy link
Member Author

n0n1m commented Aug 31, 2024

pls try my method. I'm not saying that it will definitely help, but there have been a lot of changes with requests in recent versions

Снимок экрана 2024-08-31 в 22 32 45

it is using the most recent version of requests

@n0n1m
Copy link
Member Author

n0n1m commented Aug 31, 2024

the problem is it is used before being installed

@n0n1m
Copy link
Member Author

n0n1m commented Aug 31, 2024

just try pip install git+https://github.com/honey-team/ufpy.git

@n0n1m
Copy link
Member Author

n0n1m commented Aug 31, 2024

it should fix an issue

@n0n1m
Copy link
Member Author

n0n1m commented Aug 31, 2024

also @bleudev, did you publish this commit to pypi?

@bleudev
Copy link
Member

bleudev commented Aug 31, 2024

also @bleudev, did you publish this commit to pypi?

No, i will publish new version when i will done new README.

@bleudev
Copy link
Member

bleudev commented Aug 31, 2024

just try pip install git+https://github.com/honey-team/ufpy.git

@Alexandr153 Can you try this? If the problem will be solved, we can close your PR.

@n0n1m
Copy link
Member Author

n0n1m commented Aug 31, 2024

just try pip install git+https://github.com/honey-team/ufpy.git

@Alexandr153 Can you try this? If the problem will be solved, we can close your PR.

You already closed it. Also you closed issue by merging this PR

@n0n1m
Copy link
Member Author

n0n1m commented Aug 31, 2024

I have tested PyPI version and this version in brand new venv. PyPI one threw this error and this installed fine

@n0n1m
Copy link
Member Author

n0n1m commented Aug 31, 2024

In fact, PyPI version doesn't install even with requests installed

@n0n1m
Copy link
Member Author

n0n1m commented Aug 31, 2024

That's why I think you should change version number to 0.2.1 (or smth) and publish it

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.

Unable to install module ufpy
3 participants