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

Parsing of version failed #9

Closed
Sarcasm opened this issue Mar 23, 2017 · 4 comments
Closed

Parsing of version failed #9

Sarcasm opened this issue Mar 23, 2017 · 4 comments

Comments

@Sarcasm
Copy link

Sarcasm commented Mar 23, 2017

Hello,
It looks like you are using version-to-list to parse the packages' version but the version formats supported by Emacs are different from those of PEP 440.

For example, I have a package which seems to have a pre-release version (https://www.python.org/dev/peps/pep-0440/#pre-releases) incompatible with version to list.

I can see the following error in my *Messages* buffer:

error in process sentinel: version-to-list: Invalid version syntax: ‘0.30.0a0’

And the pippel-list-packages seems to have broken, it won't complete but the minibuffer is now inaccessible due to the "Pip processing..." message still being updated indefinitely.

I don't know if you should temper with version-regexp-alist or not.

And some positive feedback,
Great idea of packages! 👍

@brotzeit
Copy link
Collaborator

Thanks for the feedback. I must admit, I have replaced string= with version< without looking into the version formats. It seemed to work so I didn't give it any further thoughts #5. Are there any alternatives to version< or do I have to write a function, that compares the python version strings ?

@brotzeit brotzeit added the bug label Mar 24, 2017
@Sarcasm
Copy link
Author

Sarcasm commented Mar 24, 2017

I haven't given much thoughts but I think you could try to let-bind version-regexp-alist with the pip format of pep 440.

TBH, I don't know why/where it is used in pippel but I think parsing versions is a hard problem.
So, if you don't absolutely need it, don't do it, if you need it, try to give a best effort implementation, and when people complains you can add a new test case.
One nice thing about a version comparison function, is that it is easy to unit test. 👍

If you make a script that fetch a bunch of version from the python package archive and make sure the parsing works for all of them, then it's a good first step, the occasional bug can be fixed when it happens.

@brotzeit
Copy link
Collaborator

Thanks for the advice. I do appreciate that. For now I will exclude version strings with letters from comparison by version<, so it should at least work for installed versions, that are older than the latest version.

But I will try if I can write a working python version string parser. This is a good opportunity to write my first unit test.

@arifer612 arifer612 added the stale label Dec 5, 2021
@arifer612
Copy link
Owner

Closed since this issue seems to be handled in (764c8e)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants