Skip to content

Commit

Permalink
Add support for Python3.12 (#174)
Browse files Browse the repository at this point in the history
* Add support for Python3.12

Signed-off-by: tdruez <[email protected]>

* Fix tests

Signed-off-by: Tushar Goel <[email protected]>

* Update initbitset

Signed-off-by: Tushar Goel <[email protected]>

* Fix tests

Signed-off-by: Tushar Goel <[email protected]>

* Prepare for release v0.12.0

Signed-off-by: Tushar Goel <[email protected]>

---------

Signed-off-by: tdruez <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Co-authored-by: Tushar Goel <[email protected]>
  • Loading branch information
tdruez and TG1999 authored Mar 28, 2024
1 parent 609a81a commit b4fa534
Show file tree
Hide file tree
Showing 27 changed files with 3,021 additions and 394 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

v0.12.0
-----------

- Add support for Python3.12


v0.11.0
-----------

Expand Down
14 changes: 7 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,54 +11,54 @@ jobs:
parameters:
job_name: ubuntu20_cpython
image_name: ubuntu-20.04
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu22_cpython
image_name: ubuntu-22.04
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos11_cpython
image_name: macOS-11
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos12_cpython
image_name: macOS-12
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos13_cpython
image_name: macos-13
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython
image_name: windows-2019
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv\Scripts\pytest -n 2 -vvs --reruns 2

- template: etc/ci/azure-win.yml
parameters:
job_name: win2022_cpython
image_name: windows-2022
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv\Scripts\pytest -n 2 -vvs --reruns 2
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ commoncode==30.2.0
dparse2==0.7.0
idna==3.3
importlib-metadata==4.12.0
intbitset==3.0.2
intbitset==3.1.0
packageurl-python==0.10.0
packaging==21.3
packvers==21.5
Expand Down
2 changes: 1 addition & 1 deletion src/python_inspector/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def convert(self, value, param, ctx):
if value in known_opts:
self.fail(
"Illegal file name conflicting with an option name: "
f"{ os.fsdecode(value)}. "
f"{os.fsdecode(value)}. "
'Use the special "-" file name to print results on screen/stdout.',
param,
ctx,
Expand Down
2 changes: 1 addition & 1 deletion src/python_inspector/resolve_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

TRACE = False

__version__ = "0.11.0"
__version__ = "0.12.0"

DEFAULT_PYTHON_VERSION = "38"
PYPI_SIMPLE_URL = "https://pypi.org/simple"
Expand Down
8 changes: 5 additions & 3 deletions src/python_inspector/utils_pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,17 @@
TRACE_ULTRA_DEEP = False

# Supported environments
PYTHON_VERSIONS = "36", "37", "38", "39", "310", "311", "27"
PYTHON_VERSIONS = "27", "36", "37", "38", "39", "310", "311", "312"

PYTHON_DOT_VERSIONS_BY_VER = {
"27": "2.7",
"36": "3.6",
"37": "3.7",
"38": "3.8",
"39": "3.9",
"310": "3.10",
"27": "2.7",
"311": "3.11",
"312": "3.12",
}

valid_python_versions = list(PYTHON_DOT_VERSIONS_BY_VER.keys())
Expand All @@ -126,13 +127,14 @@ def get_python_dot_version(version):


ABIS_BY_PYTHON_VERSION = {
"27": ["cp27", "cp27m"],
"36": ["cp36", "cp36m", "abi3"],
"37": ["cp37", "cp37m", "abi3"],
"38": ["cp38", "cp38m", "abi3"],
"39": ["cp39", "cp39m", "abi3"],
"310": ["cp310", "cp310m", "abi3"],
"311": ["cp311", "cp311m", "abi3"],
"27": ["cp27", "cp27m"],
"312": ["cp312", "cp312m", "abi3"],
}

PLATFORMS_BY_OS = {
Expand Down
238 changes: 120 additions & 118 deletions tests/data/azure-devops.req-310-expected.json

Large diffs are not rendered by default.

2,595 changes: 2,595 additions & 0 deletions tests/data/azure-devops.req-312-expected.json

Large diffs are not rendered by default.

238 changes: 120 additions & 118 deletions tests/data/azure-devops.req-38-expected.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/data/default-url-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"headers": {
"tool_name": "python-inspector",
"tool_homepageurl": "https://github.com/nexB/python-inspector",
"tool_version": "0.11.0",
"tool_version": "0.12.0",
"options": [
"--json <file>",
"--operating-system linux",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"headers": {
"tool_name": "python-inspector",
"tool_homepageurl": "https://github.com/nexB/python-inspector",
"tool_version": "0.11.0",
"tool_version": "0.12.0",
"options": [
"--json-pdt <file>",
"--operating-system linux",
Expand Down
92 changes: 46 additions & 46 deletions tests/data/example-requirements-ignore-errors-expected.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/data/frozen-requirements.txt-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"headers": {
"tool_name": "python-inspector",
"tool_homepageurl": "https://github.com/nexB/python-inspector",
"tool_version": "0.11.0",
"tool_version": "0.12.0",
"options": [
"--json-pdt <file>",
"--operating-system linux",
Expand Down
2 changes: 1 addition & 1 deletion tests/data/insecure-setup/setup.py-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"headers": {
"tool_name": "python-inspector",
"tool_homepageurl": "https://github.com/nexB/python-inspector",
"tool_version": "0.11.0",
"tool_version": "0.12.0",
"options": [
"--analyze-setup-py-insecurely",
"--json <file>",
Expand Down
2 changes: 1 addition & 1 deletion tests/data/pdt-requirements.txt-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"headers": {
"tool_name": "python-inspector",
"tool_homepageurl": "https://github.com/nexB/python-inspector",
"tool_version": "0.11.0",
"tool_version": "0.12.0",
"options": [
"--json-pdt <file>",
"--operating-system linux",
Expand Down
40 changes: 20 additions & 20 deletions tests/data/pinned-pdt-requirements.txt-expected.json

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions tests/data/pinned-requirements.txt-expected.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/data/prefer-source-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"headers": {
"tool_name": "python-inspector",
"tool_homepageurl": "https://github.com/nexB/python-inspector",
"tool_version": "0.11.0",
"tool_version": "0.12.0",
"options": [
"--json <file>",
"--operating-system linux",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"headers": {
"tool_name": "python-inspector",
"tool_homepageurl": "https://github.com/nexB/python-inspector",
"tool_version": "0.11.0",
"tool_version": "0.12.0",
"options": [
"--analyze-setup-py-insecurely",
"--json <file>",
Expand Down
2 changes: 1 addition & 1 deletion tests/data/setup/simple-setup.py-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"headers": {
"tool_name": "python-inspector",
"tool_homepageurl": "https://github.com/nexB/python-inspector",
"tool_version": "0.11.0",
"tool_version": "0.12.0",
"options": [
"--json <file>",
"--operating-system linux",
Expand Down
2 changes: 1 addition & 1 deletion tests/data/setup/spdx-setup.py-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"headers": {
"tool_name": "python-inspector",
"tool_homepageurl": "https://github.com/nexB/python-inspector",
"tool_version": "0.11.0",
"tool_version": "0.12.0",
"options": [
"--analyze-setup-py-insecurely",
"--json-pdt <file>",
Expand Down
Loading

0 comments on commit b4fa534

Please sign in to comment.