Skip to content

Commit

Permalink
feat(package-managers/python)!: Support Python 3.11
Browse files Browse the repository at this point in the history
Add "3.11" to the list of python versions which ORT allows to pass to
the `-p` option of `python-inspector`. This enables the successful
analysis of Python projects which require Python 3.11 via both, `Pip`
and `Poetry`. In particular, it does not seem to require upgrading
the Python installation to version 3.11.

The change is breaking, because also the default Python version is
changed to 3.11. For analyzing Python projects targeting 3.10 the
Python version as of now must be explicitly specified.

Note: The reason why the binary artifact URL of `MarkupSafe` became empty
in the expected result for the test is simply, because there is no
"Built Distribution", but only a "Source Distribution", see [1].
Furthermore, it's still correct to list `MarkupSafe` as dependency,
because it specifies `>= 3.6` as Python version constraint, which
matches version 3.11.

[1] https://pypi.org/project/MarkupSafe/2.0.1/#files

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Sep 29, 2023
1 parent efead2d commit ecac1d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ packages:
description: "Safely add untrusted strings to HTML/XML markup."
homepage_url: "https://palletsprojects.com/p/markupsafe/"
binary_artifact:
url: "https://files.pythonhosted.org/packages/53/e8/601efa63c4058311a8bda7984a2fe554b9da574044967d7aee253661ee46/MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl"
url: ""
hash:
value: "168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646"
algorithm: "SHA-256"
value: ""
algorithm: ""
source_artifact:
url: "https://files.pythonhosted.org/packages/bf/10/ff66fea6d1788c458663a84d88787bae15d45daa16f6b3ef33322a51fc7e/MarkupSafe-2.0.1.tar.gz"
hash:
Expand Down
4 changes: 2 additions & 2 deletions plugins/package-managers/python/src/main/kotlin/Pip.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import org.ossreviewtoolkit.utils.ort.showStackTrace
private const val OPTION_OPERATING_SYSTEM_DEFAULT = "linux"
private val OPERATING_SYSTEMS = listOf(OPTION_OPERATING_SYSTEM_DEFAULT, "macos", "windows")

private const val OPTION_PYTHON_VERSION_DEFAULT = "3.10"
private val PYTHON_VERSIONS = listOf("2.7", "3.6", "3.7", "3.8", "3.9", OPTION_PYTHON_VERSION_DEFAULT)
private const val OPTION_PYTHON_VERSION_DEFAULT = "3.11"
private val PYTHON_VERSIONS = listOf("2.7", "3.6", "3.7", "3.8", "3.9", "3.10", OPTION_PYTHON_VERSION_DEFAULT)

/**
* The [PIP](https://pip.pypa.io/) package manager for Python. Also see
Expand Down

0 comments on commit ecac1d4

Please sign in to comment.