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

Incorrect version number #123

Closed
lukasbindreiter opened this issue Nov 17, 2022 · 9 comments
Closed

Incorrect version number #123

lukasbindreiter opened this issue Nov 17, 2022 · 9 comments

Comments

@lukasbindreiter
Copy link

Just encountered a weird issue:

> pip freeze | grep flake8-isort
flake8-isort==5.0.0

but flakeheaven tells me something different:

> flakeheaven plugins

NAME                         | VERSION  | CODES               | RULES
...
flake8-isort                 | 4.2.1    | I00                 | +*
...

I think this is because 4.2.1 is set here as version string: https://github.com/gforcada/flake8-isort/blob/master/flake8_isort.py#L12
Even though there is no such version released on pypi, could you maybe double check?

@gforcada
Copy link
Owner

@lukasbindreiter indeed, thanks for noticing!

(I think) that some time ago flake8 started using the version of the plugin itself (the pypi package version I mean) rather than this internal version, so I stopped updating it. I can try to see if deleting it makes it work.

If you have the time to test that yourself, please be my guest 😄 otherwise ping me in a few days if I haven't said anything, I'm rather busy with life, family and work 😓

@lukasbindreiter
Copy link
Author

Just tested it, and at least with flake8 version 4.0.1 (which I'm currently using, and upgrading to 5 is not possible due to the use of flakeheaven) removing version doesn't work:

AttributeError: type object 'Flake8Isort5' has no attribute 'version'

originating here: https://github.com/PyCQA/flake8/blob/4.0.1/src/flake8/plugins/manager.py#L114

@gforcada
Copy link
Owner

A new release is out flake8-isort==5.0.1 with a fixed version number 😄

@lukasbindreiter
Copy link
Author

Thank you very much 😄

@lukasbindreiter
Copy link
Author

I think you forgot to update the version number again for the following releases (5.0.2 and 5.0.3).

(It's not really that urgent and not blocking me in any ways, just wanted to let you know 😄 )

@lukasbindreiter
Copy link
Author

Theoretically it could be replaced by something like:

from pkg_resources import get_distribution

version = get_distribution("flake8_isort").version

but that has some runtime cost attached, not sure if that is wanted

@gforcada
Copy link
Owner

yeah right, PRs welcome 😉

@gforcada
Copy link
Owner

I think flake8 is slow enough to not be too much to get a package version 😅

@lukasbindreiter
Copy link
Author

yeah right, PRs welcome 😉

#129

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

No branches or pull requests

2 participants