Page MenuHomeSoftware Heritage

document minimum required Python version
Closed, MigratedEdits Locked

Description

I tried to run swh in a pristine Debian 9 box that comes with Python 3.5.3.

It got installed fine via pip, but it cannot run since the CLI startup uses Python f-strings that were introduced in Python 3.6:
https://forge.softwareheritage.org/source/swh-core/browse/master/swh/core/sentry.py$15

Is this a known (and desired) limitation?

Event Timeline

zvr created this object in space S1 Public.
zack added a subscriber: zack.

Yeah, we really depend on recent-ish Python (and not only for f-strings, a lot of typing-related stuff also comes to mind).
3.5 is no longer supported (and I have my doubts about 3.6 too; we generally follow Debian stable, which is on Python 3.7 now).

For sure we could do a better job at documenting this though, so I'm turning this into a documentation issue to update (at least) our development setup guide.

zack renamed this task from Is Python 3.6 the minimum version supported? to document minimum required Python version.Dec 28 2020, 3:54 PM
zack triaged this task as High priority.
zack added a project: Easy hack.

Please, not only document but add to the code something like
python_requires='>=3.7'
to setup.py so that the Pypi packages are not installable in older versions.

Many thanks!

In T2917#55617, @zvr wrote:

Please, not only document but add to the code something like
python_requires='>=3.7'
to setup.py so that the Pypi packages are not installable in older versions.

this is already the case for the two leaf modules of our dependency graph, see:

and at least pypi seems to parse it properly, e.g.: https://pypi.org/project/swh.core/