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

Fix requirement being used before installing #53

Closed n0n1m closed 2 months ago

n0n1m commented 2 months ago

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:

sourcery-ai[bot] commented 2 months ago

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](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.
bleudev commented 2 months ago

@n0n1m Thank you for your work!

Alexandr153 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

the problem is it is used before being installed

n0n1m commented 2 months ago

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

n0n1m commented 2 months ago

it should fix an issue

n0n1m commented 2 months ago

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

bleudev commented 2 months ago

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

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

bleudev commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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

n0n1m commented 2 months ago

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

n0n1m commented 2 months ago

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