Page MenuHomeSoftware Heritage

swh cli client issue due to missing minimum python3 version runtime
Closed, MigratedEdits Locked

Description

Fix deposit client error:

I've created a metadata file and I've tried to use this command to
upload my submission:

swh deposit upload --username ipol --password "mypassword" \
                   --archive mlheIPOL.tgz \
                   --collection 'ipol' \
                   --metadata metadata_test1.xml

However I get the following error:

  Traceback (most recent call last):
    File "/home/user/ipol/testSHsubmission/python3env/bin/swh",
  line 5, in <module>
      from swh.core.cli import main
    File
  "/home/user/ipol/testSHsubmission/python3env/lib/python3.5/site-
  packages/swh/core/cli/__init__.py", line 14, in <module>
      from ..sentry import init_sentry
    File
  "/home/user/ipol/testSHsubmission/python3env/lib/python3.5/site-
  packages/swh/core/sentry.py", line 14
      return f'{main_package}@{version}'
                                       ^
  SyntaxError: invalid syntax

This could happen to any other public swh subcommands.

tl; dr
f-string are python3.6 onwards. the user's venv is python3.5 thus the syntax error

Related Objects

Mentioned In
rTSBX24c34deffefa: setup: Update the minimum required runtime python3 version
rDDOCd96c6bf287fb: setup: Update the minimum required runtime python3 version
rDMODe5227e28912d: setup: Update the minimum required runtime python3 version
rDVAU94e116f6dece: setup: Update the minimum required runtime python3 version
rDSEA936ee45e4692: setup: Update the minimum required runtime python3 version
rDLDHGaf1ff67f0a9b: setup: Update the minimum required runtime python3 version
rDJNL913049fb0f25: setup: Update the minimum required runtime python3 version
rDDEPb91abac18915: setup: Update the minimum required runtime python3 version
rDWCLI3a493dbf5597: setup: Update the minimum required runtime python3 version
rDSCH1abff221e544: setup: Update the minimum required runtime python3 version
rDLSd2daed02af5b: setup: Update the minimum required runtime python3 version
rDLDGae6c306d953d: setup: Update the minimum required runtime python3 version
rDICP6062a52b353c: setup: Update the minimum required runtime python3 version
rDWAPPS6c89d4d93a01: setup: Update the minimum required runtime python3 version
rDSTObca643acabbd: setup: Update the minimum required runtime python3 version
rDOBJS17f81a701e2b: setup: Update the minimum required runtime python3 version
rDLDSVNaef7462bb8c9: setup: Update the minimum required runtime python3 version
rDLDBASE71f20287e72c: setup: Update the minimum required runtime python3 version
rDCIDX32a85a5c4615: setup: Update the minimum required runtime python3 version
rDTPL7e96091d46fb: setup: Update the minimum required runtime python3 version
rDGRPH297c5f2284ea: setup: Update the minimum required runtime python3 version
Mentioned Here
D3032: developer-setup: Add minimal runtime python3 version requirements
D3031: core: setup: Update the minimum required runtime python3 version

Event Timeline

ardumont triaged this task as Normal priority.Apr 20 2020, 11:15 AM
ardumont created this task.

f-string are python3.6 onwards. the user's venv is python3.5 thus the syntax error

A quick look around our documentation and we do not mention the python3 version we require.
Using f-string in different modules , the first requirement is thus python3.6.

And in production, we are currently running with python3.7. So let's update the documentation (going there).

Let's try to make that check automatic with D3031 first.
Going for the documentation now.

ardumont renamed this task from deposit cli: deposit client issue to swh cli client issue due to missing minimum python3 version runtime.Apr 20 2020, 12:28 PM
ardumont updated the task description. (Show Details)
ardumont claimed this task.

All swh modules updated with the runtime requirements stanza.
Documentation updated as well.

And the original client updated his runtime accordingly to that version and everything is now fine.