Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Python 3.12
Browse files Browse the repository at this point in the history
schroedtert committed Oct 23, 2023
1 parent 836df4a commit 5e54e6c
Showing 6 changed files with 45 additions and 24 deletions.
2 changes: 1 addition & 1 deletion container/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ RUN dnf upgrade && \

COPY requirements.txt /opt/

RUN /opt/python/cp310-cp310/bin/pip install -r /opt/requirements.txt && \
RUN /opt/python/cp312-cp312/bin/pip install -r /opt/requirements.txt && \
/opt/python/cp311-cp311/bin/pip install -r /opt/requirements.txt && \
pipx install isort==5.12.0 --python python3.11 && \
pipx install black==23.7.0 --python python3.11
13 changes: 13 additions & 0 deletions scripts/ci/build_apple_clang_python312.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#! /bin/zsh
set -e
eval "$(/opt/homebrew/bin/brew shellenv)"
numcpus=$(sysctl -n hw.logicalcpu)
mkdir build && cd build
python3.12 -m venv python-env
source python-env/bin/activate
pip install -r ../requirements.txt
cmake .. -DBUILD_TESTS=ON -DWERROR=ON -DCMAKE_UNITY_BUILD=ON
cmake --build . -- -j ${numcpus}
cmake --build . -t tests -- -j ${numcpus}
cd ..
python -m build -w
16 changes: 16 additions & 0 deletions scripts/ci/build_gcc_python312.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set -e
export CXX=$(which g++)
export CC=$(which gcc)
export PYTHON_DIR=/opt/python/cp312-cp312

# Compile library and Python extension + testing
numcpus=$(nproc)
mkdir build && cd build
cmake .. -DBUILD_TESTS=ON -DWERROR=ON -DPython_ROOT_DIR=$PYTHON_DIR -DCMAKE_UNITY_BUILD=ON
cmake --build . -- -j ${numcpus} -- VERBOSE=1
cmake --build . -t tests -- -j${numcpus} -- VERBOSE=1

# Create Python wheel
cd .. && mkdir output
$PYTHON_DIR/bin/pip wheel . -w output
auditwheel repair output/jupedsim*whl
14 changes: 14 additions & 0 deletions scripts/ci/build_msvc_python312.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
call C:\Python\Python312\python.exe -m venv venv312
call venv312\Scripts\activate.bat
pip install -r requirements.txt
:: Build time in CI is currently too long to justify building twice just for unit tests
::mkdir build
::set PYTHONPATH=%cd%\python_modules\jupedsim;%cd%\build\lib\Release
::cd build
::echo %PYTHONPATH%
::cmake .. -DBUILD_TESTS=ON -DCMAKE_UNITY_BUILD=ON
::cmake --build . --config Release
::cmake --build . --config Release --target unittests
::cd ..
python -m build -w
23 changes: 0 additions & 23 deletions scripts/ci/build_rtd_docu.sh

This file was deleted.

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -291,6 +291,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
],

0 comments on commit 5e54e6c

Please sign in to comment.