eth-cscs / stackinator

Home Page:https://eth-cscs.github.io/stackinator/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python version and jsonschema

RMeli opened this issue · comments

jsonschema has been added as a dependency in #31. When I try to use the latest version of stool on hohgant I get the following error:

Traceback (most recent call last):
  File "/users/rmeli/git/sstool/bin/sstool", line 12, in <module>
    from sstool.main import main
  File "/users/rmeli/git/sstool/sstool/main.py", line 15, in <module>
    import sstool.schema
  File "/users/rmeli/git/sstool/sstool/schema.py", line 2, in <module>
    import jsonschema
  File "/users/rmeli/git/sstool/external/jsonschema/__init__.py", line 13, in <module>
    from jsonschema._format import FormatChecker
  File "/users/rmeli/git/sstool/external/jsonschema/_format.py", line 1
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined

stool runs with
https://github.com/eth-cscs/sstool/blob/7c49c8411bf23e06810d4926025a4bb9f7dd898f/bin/sstool#L1

which on hohgant corresponds to Python 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] on linux. However, annotations seem to have been released in version 3.7.0b1.


Steps to reproduce on hohgant:

$ /usr/bin/python3
Python 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import anotations
  File "<stdin>", line 1
SyntaxError: future feature anotations is not defined
>>>

I think the issue might be related to the fact that the bootstrap.sh script uses PYTHON=${PYTHON:-python3}, while sstool always uses /usr/bin/python3.

@RMeli, to be precise, were you using a different version of python than /usr/bin/python3?
I have leaned on using the system default, because the tool has to be able to bootstrap itself on the default image, but we should support a user-provided Python.

Yes, my base conda environment was active, so there was a mismatch between the python version used by bootstrap.sh and the one used by sstool. I understand the use of the system default, but I think we should be consistent.