beeware / briefcase

Tools to support converting a Python project into a standalone native application.
https://briefcase.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
2.48k stars 353 forks source link

Docker version parsing fails on OpenSUSE Tumbleweed #1773

Closed rmartin16 closed 1 month ago

rmartin16 commented 2 months ago

Describe the bug

On OpenSUSE Tumbleweed, the docker version is returned as Docker version 26.1.0-ce, build c8af8ebe4a89. The expected format does not include -ce.

❯ briefcase run --target ubuntu -vv

>>> Running Command:
>>>     docker --version
>>> Working Directory:
>>>     /home/user/github/beeware/briefcase/tmp/helloworld
>>> Environment Overrides:
>>>     DOCKER_CLI_HINTS=false
>>> Command Output:
>>>     Docker version 26.1.0-ce, build c8af8ebe4a89
>>> Return code: 0

*************************************************************************
** WARNING: Unable to determine the version of Docker                  **
*************************************************************************

Steps to reproduce

Run briefcase build --target ubuntu on OpenSUSE.

Expected behavior

Docker version parsing supports this variation of the version.

The specific issue is packaging.version.Version failing to parse 26.1.1-ce.

>>> from packaging.version import InvalidVersion, Version
>>> Version("26.1.1-ce")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.pyenv/versions/briefcase-3.11/lib/python3.11/site-packages/packaging/version.py", line 200, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '26.1.1-ce

Screenshots

No response

Environment

Logs

briefcase.2024_05_04-11_47_44.build.log

Additional context

No response