Skip to content

Commit 6ca4083

Browse files
authored
Add support for Python 3.12 (#1138)
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent e797550 commit 6ca4083

File tree

8 files changed

+21
-13
lines changed

8 files changed

+21
-13
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
max-parallel: 4
3333
matrix:
34-
python-version: ["3.10", "3.11"]
34+
python-version: ["3.10", "3.11", "3.12"]
3535

3636
steps:
3737
- name: Checkout code

.github/workflows/pypi-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python
1818
uses: actions/setup-python@v5
1919
with:
20-
python-version: 3.11
20+
python-version: 3.12
2121

2222
- name: Install pypa/build
2323
run: python -m pip install build --user

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Changelog
44
v34.2.0 (unreleased)
55
--------------------
66

7+
- Add support for Python 3.12 and upgrade to Python 3.12 in the Dockerfile.
8+
https://github.com/nexB/scancode.io/pull/1138
9+
710
- Add support for CycloneDX XML inputs.
811
https://github.com/nexB/scancode.io/issues/1136
912

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# ScanCode.io is a free software code scanning tool from nexB Inc. and others.
2121
# Visit https://github.com/nexB/scancode.io for support and download.
2222

23-
FROM --platform=linux/amd64 python:3.11-slim
23+
FROM --platform=linux/amd64 python:3.12-slim
2424

2525
LABEL org.opencontainers.image.source="https://github.com/nexB/scancode.io"
2626
LABEL org.opencontainers.image.description="ScanCode.io"

docs/installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ Pre-installation Checklist
236236

237237
Before you install ScanCode.io, make sure you have the following prerequisites:
238238

239-
* **Python: versions 3.10 to 3.11** found at https://www.python.org/downloads/
239+
* **Python: versions 3.10 to 3.12** found at https://www.python.org/downloads/
240240
* **Git**: most recent release available at https://git-scm.com/
241241
* **PostgreSQL**: release 11 or later found at https://www.postgresql.org/ or
242242
https://postgresapp.com/ on macOS
@@ -294,8 +294,8 @@ Clone and Configure
294294

295295
softwareupdate --install-rosetta
296296
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
297-
arch -x86_64 /usr/local/Homebrew/bin/brew install python@3.11
298-
make dev PYTHON_EXE=/usr/local/bin/python3.11
297+
arch -x86_64 /usr/local/Homebrew/bin/brew install python@3.12
298+
make dev PYTHON_EXE=/usr/local/bin/python3.12
299299
(. bin/activate; pip install psycopg[binary])
300300

301301
* Create an environment file::

scanpipe/tests/pipes/test_symbols.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
# ScanCode.io is a free software code scanning tool from nexB Inc. and others.
2121
# Visit https://github.com/nexB/scancode.io for support and download.
2222

23+
import sys
2324
from pathlib import Path
25+
from unittest import skipIf
2426

2527
from django.test import TestCase
2628

@@ -36,8 +38,8 @@ class ScanPipeSymbolsPipesTest(TestCase):
3638
def setUp(self):
3739
self.project1 = Project.objects.create(name="Analysis")
3840

41+
@skipIf(sys.platform == "darwin", "Not supported on macOS")
3942
def test_scanpipe_pipes_symbols_collect_and_store_resource_symbols(self):
40-
4143
dir = self.project1.codebase_path / "codefile"
4244
dir.mkdir(parents=True)
4345

scanpipe/tests/test_pipelines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,7 @@ def mock_request_post_return(url, data, headers, timeout):
12171217
self.assertIn("1 PURLs were already present in PurlDB index queue", run.log)
12181218
self.assertIn("Couldn't index 1 unsupported PURLs", run.log)
12191219

1220+
@skipIf(sys.platform == "darwin", "Not supported on macOS")
12201221
def test_scanpipe_collect_symbols_pipeline_integration(self):
12211222
pipeline_name = "collect_symbols"
12221223
project1 = Project.objects.create(name="Analysis")

setup.cfg

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ classifiers =
1616
Programming Language :: Python :: 3 :: Only
1717
Programming Language :: Python :: 3.10
1818
Programming Language :: Python :: 3.11
19+
Programming Language :: Python :: 3.12
1920
Topic :: Utilities
2021
keywords =
2122
open source
@@ -48,22 +49,23 @@ packages=find:
4849
include_package_data = true
4950
zip_safe = false
5051
install_requires =
51-
importlib-metadata==7.0.2
52+
importlib-metadata==7.1.0
53+
setuptools==69.2.0
5254
# Django related
5355
Django==5.0.3
5456
django-environ==0.11.2
5557
django-crispy-forms==2.1
5658
crispy-bootstrap3==2024.1
57-
django-filter==24.1
58-
djangorestframework==3.15.0
59+
django-filter==24.2
60+
djangorestframework==3.15.1
5961
django-taggit==5.0.1
6062
# Database
6163
psycopg[binary]==3.1.18
6264
# wait_for_database Django management command
6365
django-probes==1.7.0
6466
# Task queue
6567
rq==1.16.1
66-
django-rq==2.10.1
68+
django-rq==2.10.2
6769
redis==5.0.3
6870
# WSGI server
6971
gunicorn==21.2.0
@@ -76,9 +78,9 @@ install_requires =
7678
# FetchCode
7779
fetchcode-container==1.2.3.210512; sys_platform == "linux"
7880
# Inspectors
79-
python-inspector==0.11.0
81+
python-inspector==0.12.0
8082
elf-inspector==0.0.1
81-
source-inspector==0.2.0
83+
source-inspector==0.3.0
8284
aboutcode-toolkit==10.1.0
8385
# Utilities
8486
XlsxWriter==3.2.0

0 commit comments

Comments
 (0)