Skip to content

Add letter checking for release version #127

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

Open
braffes opened this issue Jul 2, 2021 · 7 comments
Open

Add letter checking for release version #127

braffes opened this issue Jul 2, 2021 · 7 comments

Comments

@braffes
Copy link
Contributor

braffes commented Jul 2, 2021

Hi again,

It should be interesting, if the comparison between version works with version which contains letter.

For example, currently I have:

2021-07-02 17:04:09,964 DEBUG [root][MainThread] found a release 4.1a
2021-07-02 17:04:09,964 DEBUG [root][MainThread] compare next release 4.1c
2021-07-02 17:04:09,964 DEBUG [root][MainThread] compare release major,minor,etc. : 4 >? 4
2021-07-02 17:04:09,964 DEBUG [root][MainThread] compare release major,minor,etc. : 1c >? 1a
2021-07-02 17:04:09,964 DEBUG [root][MainThread] compare next release 4.2a
2021-07-02 17:04:09,964 DEBUG [root][MainThread] compare release major,minor,etc. : 4 >? 4
2021-07-02 17:04:09,964 DEBUG [root][MainThread] compare release major,minor,etc. : 2a >? 1a
2021-07-02 17:04:09,964 DEBUG [root][MainThread] compare next release 4.2c
2021-07-02 17:04:09,964 DEBUG [root][MainThread] compare release major,minor,etc. : 4 >? 4
2021-07-02 17:04:09,964 DEBUG [root][MainThread] compare release major,minor,etc. : 2c >? 1a
2021-07-02 17:04:10,070 INFO  [root][MainThread] Workflow:DownloadService:CleanSession
2021-07-02 17:04:10,073 INFO  [root][MainThread] Session:RemoteRelease:4.1a
2021-07-02 17:04:10,073 INFO  [root][MainThread] Session:Release:4.1a
2021-07-02 17:04:10,073 INFO  [root][MainThread] Workflow:Start:download
2021-07-02 17:04:10,074 INFO  [root][MainThread] Workflow:wf_download

As we see, when the version contains letters, the verification doesn't work.

Thanks for you attention,

Brice

@osallou
Copy link
Contributor

osallou commented Jul 2, 2021

More complex to do.
Code was quite simple, comparing ints

Letters should be detected, and compared, in different patterns...

@braffes
Copy link
Contributor Author

braffes commented Jul 2, 2021

Maybe the following module can do the jobs:
https://packaging.pypa.io/en/latest/version.html

Without a new module, it should be more complicated ...

@osallou
Copy link
Contributor

osallou commented Jul 2, 2021

could be, will investiguate

now, anyway, will not work in all cases, if versions do not follow some patterns

@braffes
Copy link
Contributor Author

braffes commented Jul 5, 2021

It seems there is an other issue with the current algorithm.

2021-07-05 13:07:28,183 DEBUG [root][MainThread] found a release 2.1.1
2021-07-05 13:07:28,183 DEBUG [root][MainThread] compare next release 2.0.2
2021-07-05 13:07:28,183 DEBUG [root][MainThread] compare release major,minor,etc. : 2 >? 2
2021-07-05 13:07:28,183 DEBUG [root][MainThread] compare release major,minor,etc. : 0 >? 1
2021-07-05 13:07:28,183 DEBUG [root][MainThread] compare release major,minor,etc. : 2 >? 1
2021-07-05 13:07:28,183 DEBUG [root][MainThread] found newer release 2.0.2
2021-07-05 13:07:28,184 INFO  [root][MainThread] Workflow:DownloadService:CleanSession
2021-07-05 13:07:28,185 INFO  [root][MainThread] Session:RemoteRelease:2.0.2
2021-07-05 13:07:28,185 INFO  [root][MainThread] Session:Release:2.0.2

The good algorithm should stop after comparing 0 >?1, but this is not the case.

@osallou
Copy link
Contributor

osallou commented Jul 5, 2021

Hum, need complete recheck of the algo...
Was made quickly for a specific need

@osallou
Copy link
Contributor

osallou commented Jul 6, 2021 via email

@braffes
Copy link
Contributor Author

braffes commented Mar 11, 2025

Since the version 22.0 of packaging, my pull request broke the version check when an underscore is used :
Before 21.3 :

(biomaj) [biomaj-prod@maestro-biomaj-prod config]$ biomaj-cli.py --update --bank uniref30                                                                                              
2025-03-11 12:38:39,872 INFO  [root][MainThread] Log file: /opt/biomaj/log/uniref30/1741693119.8690608/uniref30.log                                                                    
2025-03-11 12:38:39,882 WARNI [root][MainThread] Bank:uniref30:Update
2025-03-11 12:38:39,883 INFO  [root][MainThread] Bank:uniref30:Release:latest
2025-03-11 12:38:39,884 INFO  [root][MainThread] Workflow:Start
2025-03-11 12:38:39,884 INFO  [root][MainThread] Workflow:Start:init
2025-03-11 12:38:39,884 INFO  [root][MainThread] Workflow:wf_init
2025-03-11 12:38:39,885 INFO  [root][MainThread] Workflow:Skip:check
2025-03-11 12:38:39,885 INFO  [root][MainThread] Workflow:Skip:depends
2025-03-11 12:38:39,885 INFO  [root][MainThread] Workflow:Skip:preprocess
2025-03-11 12:38:39,885 INFO  [root][MainThread] Workflow:Start:release
2025-03-11 12:38:39,885 INFO  [root][MainThread] Workflow:wf_release
2025-03-11 12:38:39,885 INFO  [root][MainThread] Workflow:wf_release:previous_session:2023_02                                                                                          
2025-03-11 12:38:39,885 INFO  [root][MainThread] Use remote: False
2025-03-11 12:38:39,885 INFO  [root][MainThread] Workflow:wf_release:DownloadSession:ea2125a8-da44-41d6-ae61-95a4a7ca5572                                                              
2025-03-11 12:38:40,243 INFO  [root][MainThread] Download was redirected to https://wwwuser.gwdguser.de/~compbiol/uniclust/ (4 redirection(s), took 0.10241s)                          
2025-03-11 12:38:40,243 WARNI [biomaj][MainThread] archive_check: unable to process check call for '/local/scratch/tmp/tmpkmp0qfnabiomaj/uniclust'                                     
2025-03-11 12:38:40,245 INFO  [root][MainThread] Workflow:DownloadService:CleanSession
2025-03-11 12:38:40,247 INFO  [root][MainThread] Workflow:wf_release:same_as_previous_session                                                                                          
2025-03-11 12:38:40,247 INFO  [root][MainThread] Workflow:wf_over
2025-03-11 12:38:40,248 INFO  [root][MainThread] Workflow:Skip:download
2025-03-11 12:38:40,248 INFO  [root][MainThread] Workflow:Skip:postprocess
2025-03-11 12:38:40,248 INFO  [root][MainThread] Workflow:Skip:publish
2025-03-11 12:38:40,248 INFO  [root][MainThread] Workflow:Skip:over
2025-03-11 12:38:40,258 INFO  [root][MainThread] Notify:biomaj@pasteur.fr
2025-03-11 12:38:40,259 INFO  [root][MainThread] BANK[uniref30] - STATUS[True] - UPDATE[False] - REMOVE[False] - RELEASE[2023_02]                                                      
Bank update request sent for uniref30

22.0 and after:

[...]
2025-03-11 12:42:21,834 INFO  [root][MainThread] Workflow:wf_release:DownloadSession:e49091ad-3c41-43ab-9184-5189cf0b56df
2025-03-11 12:42:22,447 INFO  [root][MainThread] Download was redirected to https://wwwuser.gwdguser.de/~compbiol/uniclust/ (4 redirection(s), took 0.066538s)
2025-03-11 12:42:22,447 WARNI [biomaj][MainThread] archive_check: unable to process check call for '/local/scratch/tmp/tmp3n1wvnknbiomaj/uniclust'
2025-03-11 12:42:22,448 ERROR [root][MainThread] Workflow:release:Exception:Invalid version: '2023_02'
Traceback (most recent call last):
  File "/opt/biomaj/lib/python3.11/site-packages/biomaj/workflow.py", line 130, in start
    self.session._session['status'][flow['name']] = getattr(self, 'wf_' + flow['name'])()
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/biomaj/lib/python3.11/site-packages/biomaj/workflow.py", line 794, in wf_release
    release = self.__findLastRelease(rels)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/biomaj/lib/python3.11/site-packages/biomaj/workflow.py", line 518, in __findLastRelease
    release_version = parse(release)
                      ^^^^^^^^^^^^^^
  File "/opt/biomaj/lib/python3.11/site-packages/packaging/version.py", line 52, in parse
    return Version(version)
           ^^^^^^^^^^^^^^^^
  File "/opt/biomaj/lib/python3.11/site-packages/packaging/version.py", line 197, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '2023_02'
2025-03-11 12:42:22,451 ERROR [root][MainThread] Error during task release
2025-03-11 12:42:22,451 INFO  [root][MainThread] Workflow:wf_over
2025-03-11 12:42:22,462 INFO  [root][MainThread] Notify:biomaj@pasteur.fr
2025-03-11 12:42:22,462 INFO  [root][MainThread] BANK[uniref30] - STATUS[False] - UPDATE[True] - REMOVE[False] - RELEASE[None]
An error occured:

Bank update request sent for uniref30
Failed to send update request for uniref30

At the moment, I just add a requirement on packaging module : "packaging<22"
I will try to find a better way to handle versioning, but I can't now.

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