Skip to content

Commit b4fa534

Browse files
tdruezTG1999
andauthored
Add support for Python3.12 (#174)
* 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]>
1 parent 609a81a commit b4fa534

27 files changed

+3021
-394
lines changed

CHANGELOG.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
v0.12.0
5+
-----------
6+
7+
- Add support for Python3.12
8+
9+
410
v0.11.0
511
-----------
612

azure-pipelines.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,54 +11,54 @@ jobs:
1111
parameters:
1212
job_name: ubuntu20_cpython
1313
image_name: ubuntu-20.04
14-
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
14+
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
1515
test_suites:
1616
all: venv/bin/pytest -n 2 -vvs --reruns 2
1717

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

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

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

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

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

5858
- template: etc/ci/azure-win.yml
5959
parameters:
6060
job_name: win2022_cpython
6161
image_name: windows-2022
62-
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
62+
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
6363
test_suites:
6464
all: venv\Scripts\pytest -n 2 -vvs --reruns 2

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ commoncode==30.2.0
88
dparse2==0.7.0
99
idna==3.3
1010
importlib-metadata==4.12.0
11-
intbitset==3.0.2
11+
intbitset==3.1.0
1212
packageurl-python==0.10.0
1313
packaging==21.3
1414
packvers==21.5

src/python_inspector/cli_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def convert(self, value, param, ctx):
2626
if value in known_opts:
2727
self.fail(
2828
"Illegal file name conflicting with an option name: "
29-
f"{ os.fsdecode(value)}. "
29+
f"{os.fsdecode(value)}. "
3030
'Use the special "-" file name to print results on screen/stdout.',
3131
param,
3232
ctx,

src/python_inspector/resolve_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
TRACE = False
2121

22-
__version__ = "0.11.0"
22+
__version__ = "0.12.0"
2323

2424
DEFAULT_PYTHON_VERSION = "38"
2525
PYPI_SIMPLE_URL = "https://pypi.org/simple"

src/python_inspector/utils_pypi.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,17 @@
102102
TRACE_ULTRA_DEEP = False
103103

104104
# Supported environments
105-
PYTHON_VERSIONS = "36", "37", "38", "39", "310", "311", "27"
105+
PYTHON_VERSIONS = "27", "36", "37", "38", "39", "310", "311", "312"
106106

107107
PYTHON_DOT_VERSIONS_BY_VER = {
108+
"27": "2.7",
108109
"36": "3.6",
109110
"37": "3.7",
110111
"38": "3.8",
111112
"39": "3.9",
112113
"310": "3.10",
113-
"27": "2.7",
114114
"311": "3.11",
115+
"312": "3.12",
115116
}
116117

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

127128

128129
ABIS_BY_PYTHON_VERSION = {
130+
"27": ["cp27", "cp27m"],
129131
"36": ["cp36", "cp36m", "abi3"],
130132
"37": ["cp37", "cp37m", "abi3"],
131133
"38": ["cp38", "cp38m", "abi3"],
132134
"39": ["cp39", "cp39m", "abi3"],
133135
"310": ["cp310", "cp310m", "abi3"],
134136
"311": ["cp311", "cp311m", "abi3"],
135-
"27": ["cp27", "cp27m"],
137+
"312": ["cp312", "cp312m", "abi3"],
136138
}
137139

138140
PLATFORMS_BY_OS = {

tests/data/azure-devops.req-310-expected.json

+120-118
Large diffs are not rendered by default.

tests/data/azure-devops.req-312-expected.json

+2,595
Large diffs are not rendered by default.

tests/data/azure-devops.req-38-expected.json

+120-118
Large diffs are not rendered by default.

tests/data/default-url-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.11.0",
5+
"tool_version": "0.12.0",
66
"options": [
77
"--json <file>",
88
"--operating-system linux",

tests/data/environment-marker-test-requirements.txt-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.11.0",
5+
"tool_version": "0.12.0",
66
"options": [
77
"--json-pdt <file>",
88
"--operating-system linux",

tests/data/example-requirements-ignore-errors-expected.json

+46-46
Large diffs are not rendered by default.

tests/data/frozen-requirements.txt-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.11.0",
5+
"tool_version": "0.12.0",
66
"options": [
77
"--json-pdt <file>",
88
"--operating-system linux",

tests/data/insecure-setup/setup.py-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.11.0",
5+
"tool_version": "0.12.0",
66
"options": [
77
"--analyze-setup-py-insecurely",
88
"--json <file>",

tests/data/pdt-requirements.txt-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.11.0",
5+
"tool_version": "0.12.0",
66
"options": [
77
"--json-pdt <file>",
88
"--operating-system linux",

tests/data/pinned-pdt-requirements.txt-expected.json

+20-20
Large diffs are not rendered by default.

tests/data/pinned-requirements.txt-expected.json

+21-21
Large diffs are not rendered by default.

tests/data/prefer-source-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.11.0",
5+
"tool_version": "0.12.0",
66
"options": [
77
"--json <file>",
88
"--operating-system linux",

tests/data/setup/no-direct-dependencies-setup.py-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.11.0",
5+
"tool_version": "0.12.0",
66
"options": [
77
"--analyze-setup-py-insecurely",
88
"--json <file>",

tests/data/setup/simple-setup.py-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.11.0",
5+
"tool_version": "0.12.0",
66
"options": [
77
"--json <file>",
88
"--operating-system linux",

tests/data/setup/spdx-setup.py-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"headers": {
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5-
"tool_version": "0.11.0",
5+
"tool_version": "0.12.0",
66
"options": [
77
"--analyze-setup-py-insecurely",
88
"--json-pdt <file>",

0 commit comments

Comments
 (0)