Skip to content

Add support for Python3.12 #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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