brainvisa / casa-distro

Unified development environment for BrainVISA projects.
2 stars 1 forks source link

bbi image updates break the existing environments #353

Closed denisri closed 11 months ago

denisri commented 1 year ago

Describe the bug BBI image updates have updated the images (casa-dev-5.3-23.sif for instance last night), but the configured environments still refer to casa-dev-5.3-22, which has been deleted. I thought environments were updated, and I also thought that an environment referring to "casa-dev-5.3" would be enough to find the latest image, but both are wrong or broken.

Environment:

nsouedet commented 11 months ago

Due to the use of formatted string in commit 4a28615, like : f'.*-[0-9]+\\.{ext}$' Compatibility of casa_distro with python < 3.6 is broken. As a consequence, it forbids to run casa_distro on Ubuntu 16.04 (at least). Is this what we want ?

sapetnioc commented 11 months ago

If I understand well, it will break code that allow user to manage container images. On the one hand I would like this code to be compatible with any system. On the other hand, we are now used to write code for Python >= 3.9 and we are not testing on 16.04 anymore, no ? Therefore, I would choose to try to be compatible if it is just small changes but to stop as soon as it become a little bit complex.

denisri commented 11 months ago

Sorry I was not aware I as using code incompatible with python 3.6. But, actually, I'm still not really aware; could you please describe the error ? f-strings did exist in 3.6, so it must be something else ?

nsouedet commented 11 months ago

Hello Denis, f-strings were introduced in python 3.6 https://peps.python.org/pep-0498 and Ubuntu 16.04 uses a python 3.5.2 that do not support f-strings :). As a result, following code is not supported :

import re
image='toto.png'
ext='png'
re.match(f'.*-[0-9]+\.{ext}$', image)

It results in the following error :

re.match(f'.*-[0-9]+\.{ext}$', image)
                             ^
SyntaxError: invalid syntax

... but, I know, it's time to use a recent version of Ubuntu :)

denisri commented 11 months ago

Oh it was 3.5, I understand now. We can certainly avoid using f-strings here. I'll do some fixes.