Skip to content

Commit 0832e64

Browse files
authored
Merge pull request #2422 from SCIInstitute/py3.12
Upgrade to Python 3.12 (#2421)
2 parents f50ad2f + c32bb95 commit 0832e64

File tree

30 files changed

+1069
-243
lines changed

30 files changed

+1069
-243
lines changed

.github/workflows/Dockerfile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
# Based on old ubuntu to create more compatible binaries
22

3-
# To build (e.g. for ShapeWorks 6.5):
4-
# docker build --progress=plain -t akenmorris/ubuntu-build-box-focal-sw65 .
3+
# To build (e.g. for ShapeWorks 6.7):
4+
# docker build --progress=plain -t akenmorris/ubuntu-build-box-jammy-sw67 .
55
# To publish:
6-
# docker push akenmorris/ubuntu-build-box-focal-sw65
6+
# docker push akenmorris/ubuntu-build-box-jammy-sw67
77

8-
FROM ubuntu:focal-20240123 AS env
8+
FROM ubuntu:jammy-20250819 AS env
99
1010

1111
# Set environment variables
12-
ENV PATH=/opt/conda/bin:/opt/rh/devtoolset-9/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
13-
ENV LDFLAGS=-L/opt/conda/lib
12+
ENV PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
1413

1514
ARG DEBIAN_FRONTEND=noninteractive
1615
ENV TZ=Etc/UTC
1716

1817
# Update
1918
RUN apt-get update -y && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get install build-essential software-properties-common -y && add-apt-repository ppa:ubuntu-toolchain-r/test -y && apt-get update -y
2019

21-
# Install GCC 9
22-
RUN apt-get install gcc-9 g++-9 -y
23-
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 && update-alternatives --config gcc
24-
2520
# Install git and git-lfs
2621
RUN add-apt-repository ppa:git-core/ppa
2722
RUN apt-get update
@@ -36,6 +31,8 @@ RUN apt-get install rsync freeglut3-dev libgl1-mesa-dev libegl1-mesa zip libcups
3631
RUN curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o /tmp/Miniconda3-latest-Linux-x86_64.sh \
3732
&& bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda \
3833
&& ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh \
34+
&& /opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main \
35+
&& /opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r \
3936
&& conda update -n base -c defaults conda \
4037
&& conda install pip \
4138
&& echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc \

.github/workflows/build-linux-debug.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
build:
2525

2626
runs-on: ubuntu-latest
27-
container: akenmorris/ubuntu-build-box-focal-sw65
27+
container: akenmorris/ubuntu-build-box-jammy-sw67
2828

2929
steps:
3030

@@ -67,8 +67,6 @@ jobs:
6767
with:
6868
path: /github/home/install
6969
key: ${{ runner.os }}-deps-debug-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
70-
restore-keys: |
71-
${{ runner.os }}-deps-
7270

7371
- name: Check space3.5
7472
run: df -h
@@ -101,7 +99,6 @@ jobs:
10199
run: df -h
102100

103101
- name: Build Dependencies
104-
if: steps.cache-deps-restore.outputs.cache-hit != 'true'
105102
shell: bash -l {0}
106103
run: .github/workflows/gha_deps.sh
107104

.github/workflows/build-linux.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
build:
2626

2727
runs-on: ubuntu-latest
28-
container: akenmorris/ubuntu-build-box-focal-sw65
28+
container: akenmorris/ubuntu-build-box-jammy-sw67
2929

3030
steps:
3131

@@ -65,8 +65,6 @@ jobs:
6565
with:
6666
path: /github/home/install
6767
key: ${{ runner.os }}-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
68-
restore-keys: |
69-
${{ runner.os }}-deps-
7068

7169
- name: try import vtk
7270
shell: bash -l {0}

.github/workflows/build-mac-arm64.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ jobs:
5656
with:
5757
path: /Users/runner/install
5858
key: ${{ runner.os }}-arm64-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
59-
restore-keys: |
60-
${{ runner.os }}-deps-
6159

6260
- name: Build Dependencies
6361
if: steps.cache-deps-restore.outputs.cache-hit != 'true'

.github/workflows/build-mac.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,8 @@ jobs:
5757
with:
5858
path: /Users/runner/install
5959
key: ${{ runner.os }}-intel-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
60-
restore-keys: |
61-
${{ runner.os }}-deps-
6260

6361
- name: Build Dependencies
64-
if: steps.cache-deps-restore.outputs.cache-hit != 'true'
6562
shell: bash -l {0}
6663
run: .github/workflows/gha_deps.sh
6764

.github/workflows/build-windows.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ jobs:
9393
with:
9494
path: C:\deps
9595
key: ${{ runner.os }}-deps-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
96-
restore-keys: |
97-
${{ runner.os }}-deps-
9896

9997
- name: Build Dependencies
10098
if: steps.cache-deps-restore.outputs.cache-hit != 'true'
@@ -164,7 +162,12 @@ jobs:
164162
# Execute tests defined by the CMake configuration.
165163
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
166164
run: conda activate shapeworks && source ${GITHUB_WORKSPACE}/devenv.sh ./bin/Release && ctest --output-on-failure -VV -C $BUILD_TYPE --debug
167-
165+
166+
- name: Setup tmate session on failure
167+
if: ${{ failure() }}
168+
uses: mxschmitt/action-tmate@v3
169+
timeout-minutes: 30
170+
168171
- uses: actions/upload-artifact@v4
169172
with:
170173
name: artifact-${{github.sha}}-windows

.github/workflows/gha_deps.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ else
3232
NPROCS=2
3333
fi
3434

35-
./build_dependencies.sh --build-type=$BUILD_TYPE --num-procs=$NPROCS --clean-after
35+
# Always build dependencies in Release mode now. There is not enough disk space for linux-debug on GHA anymore.
36+
./build_dependencies.sh --build-type=Release --num-procs=$NPROCS --clean-after
3637
rm -rf $BUILD_DIR
3738
fi

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ endif()
1818
set(CMAKE_CXX_STANDARD 17) # available options are [98, 11, 14, 17. 20]
1919

2020
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
21-
find_package(Python3 3.9 EXACT REQUIRED COMPONENTS Interpreter Development)
21+
find_package(Python3 3.12 EXACT REQUIRED COMPONENTS Interpreter Development)
2222

2323
if (NOT APPLE)
2424
option(USE_OPENMP "Build using OpenMP" ON)

Libs/Application/Job/PythonWorker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class PythonWorker : public QObject {
1818
Q_OBJECT
1919

2020
public:
21-
constexpr static const char* python_api_version = "6.6";
21+
constexpr static const char* python_api_version = "6.7";
2222

2323
PythonWorker();
2424
~PythonWorker();

Libs/Groom/Groom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ void Groom::increment_progress(int amount) {
535535
std::scoped_lock lock(mutex);
536536
progress_counter_ += amount;
537537
progress_ = static_cast<float>(progress_counter_) / static_cast<float>(total_ops_) * 100.0;
538-
SW_PROGRESS(progress_, fmt::format("Grooming ({}/{} ops)", progress_counter_, total_ops_));
538+
SW_PROGRESS(progress_, fmt::format("Grooming ({}/{} ops)", progress_counter_.load(), total_ops_.load()));
539539
}
540540

541541
//---------------------------------------------------------------------------

0 commit comments

Comments
 (0)