Skip to content

Commit

Permalink
Update CI dependencies (PedestrianDynamics#1437)
Browse files Browse the repository at this point in the history
* Update GH ACtions

Now provide python 3.13 packages.
Clang-format 19 is now target version for formatting c++ and c code.

* Update python dependencies
  • Loading branch information
Ozaq authored Jan 16, 2025
1 parent 340173a commit 54e145a
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 44 deletions.
54 changes: 37 additions & 17 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python 3.12
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"
- name: Install dependencies
run: pip install ruff

- name: Install clang-format-19
run: |
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main'
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo apt update
sudo apt install clang-format-19
- name: Run checks
run: ./scripts/ci/check_format.sh

Expand All @@ -48,10 +55,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python 3.12
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"
- name: Install dependencies
run: pip install -r requirements.txt

Expand All @@ -68,6 +75,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# Still need to use 3.12 because hdf5 is not yet available for python 3.13 and we are using this in our notbooks
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -165,7 +173,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: 3.12
python-version: 3.13

- name: Install dependencies
run: python -m pip install wheel build setuptools
Expand All @@ -187,7 +195,7 @@ jobs:
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_SKIP: "*musllinux*"
MACOSX_DEPLOYMENT_TARGET: 10.16
MACOSX_DEPLOYMENT_TARGET: 12.05
strategy:
matrix:
include:
Expand All @@ -200,6 +208,9 @@ jobs:
- os: ubuntu-latest
cibw_archs: "x86_64"
cibw_build: "cp312-*"
- os: ubuntu-latest
cibw_archs: "x86_64"
cibw_build: "cp313-*"
- os: windows-latest
cibw_archs: "auto64"
cibw_build: "cp310-*"
Expand All @@ -209,29 +220,38 @@ jobs:
- os: windows-latest
cibw_archs: "auto64"
cibw_build: "cp312-*"
- os: macos-12
- os: windows-latest
cibw_archs: "auto64"
cibw_build: "cp313-*"
- os: macos-13
cibw_archs: "x86_64"
cibw_build: "cp310-*"
- os: macos-12
- os: macos-13
cibw_archs: "x86_64"
cibw_build: "cp311-*"
- os: macos-12
- os: macos-13
cibw_archs: "x86_64"
cibw_build: "cp312-*"
- os: macos-12
- os: macos-13
cibw_archs: "x86_64"
cibw_build: "cp313-*"
- os: macos-13
cibw_archs: "arm64"
cibw_build: "cp310-*"
- os: macos-12
- os: macos-13
cibw_archs: "arm64"
cibw_build: "cp311-*"
- os: macos-12
- os: macos-13
cibw_archs: "arm64"
cibw_build: "cp312-*"
- os: macos-13
cibw_archs: "arm64"
cibw_build: "cp313-*"

steps:
- uses: actions/checkout@v4
- name: Build wheels for CPython ${{ matrix.cibw_build }} on ${{ matrix.cibw_archs }}
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_ARCHS: ${{ matrix.cibw_archs }}
Expand Down Expand Up @@ -261,8 +281,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-12, macos-14]
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-13, macos-14, macos-15]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -292,10 +312,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Python 3.12
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: 3.13

- name: Download packages
uses: actions/Download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ add_subdirectory(python_bindings_jupedsim)
# Code formatting
################################################################################
if(UNIX AND WITH_FORMAT)
set(clang-format-version 15)
set(clang-format-version 19)
find_program(CLANG_FORMAT
NAMES
clang-format-${clang-format-version}
Expand Down
2 changes: 1 addition & 1 deletion libsimulator/src/Journey.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class FixedTransition : public Transition
BaseStage* next;

public:
FixedTransition(BaseStage* next_) : next(next_){};
FixedTransition(BaseStage* next_) : next(next_) {};

BaseStage* NextStage() override { return next; }
};
Expand Down
4 changes: 1 addition & 3 deletions libsimulator/src/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,7 @@ std::vector<glm::vec2> Mesh::FVertices() const
std::begin(vertices),
std::end(vertices),
std::back_inserter(f_vertices),
[](const auto& v) {
return glm::vec2{v.x, v.y};
});
[](const auto& v) { return glm::vec2{v.x, v.y}; });
return f_vertices;
}

Expand Down
2 changes: 1 addition & 1 deletion libsimulator/src/NeighborhoodSearch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class NeighborhoodSearch
}

public:
explicit NeighborhoodSearch(double cellSize) : _cellSize(cellSize){};
explicit NeighborhoodSearch(double cellSize) : _cellSize(cellSize) {};

void AddAgent(const Value& item)
{
Expand Down
2 changes: 1 addition & 1 deletion libsimulator/src/Point.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Point
double y{};

public:
Point(double x = 0, double y = 0) : x(x), y(y){};
Point(double x = 0, double y = 0) : x(x), y(y) {};

/// Norm
double Norm() const;
Expand Down
2 changes: 1 addition & 1 deletion libsimulator/src/SocialForceModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <stdexcept>

SocialForceModel::SocialForceModel(double bodyForce_, double friction_)
: bodyForce(bodyForce_), friction(friction_){};
: bodyForce(bodyForce_), friction(friction_) {};

OperationalModelType SocialForceModel::Type() const
{
Expand Down
2 changes: 1 addition & 1 deletion notebooks/direct_steering.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
" for idx, waypoint in enumerate(waypoints):\n",
" axes.plot(waypoint[0], waypoint[1], \"ro\")\n",
" axes.annotate(\n",
" f\"WP {idx+1}\",\n",
" f\"WP {idx + 1}\",\n",
" (waypoint[0], waypoint[1]),\n",
" textcoords=\"offset points\",\n",
" xytext=(10, -15),\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/journey.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"for idx, waypoint in enumerate(waypoints):\n",
" ax.plot(waypoint[0], waypoint[1], \"ro\")\n",
" ax.annotate(\n",
" f\"WP {idx+1}\",\n",
" f\"WP {idx + 1}\",\n",
" (waypoint[0], waypoint[1]),\n",
" textcoords=\"offset points\",\n",
" xytext=(10, -15),\n",
Expand Down
12 changes: 6 additions & 6 deletions notebooks/lane-formation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
" plt.text(\n",
" centroid.x,\n",
" centroid.y,\n",
" f\"Start {id+1}\",\n",
" f\"Start {id + 1}\",\n",
" ha=\"center\",\n",
" va=\"center\",\n",
" fontsize=10,\n",
Expand Down Expand Up @@ -277,7 +277,7 @@
" every_nth_frame=5,\n",
" width=1200,\n",
" height=400,\n",
" title_note=f\"Ratio: {min(number)/sum(number):0.2f}\",\n",
" title_note=f\"Ratio: {min(number) / sum(number):0.2f}\",\n",
" ).show()"
]
},
Expand Down Expand Up @@ -307,7 +307,7 @@
" traj_width=0.3,\n",
" traj_start_marker=\".\",\n",
" )\n",
" ax.set_title(f\"Ratio: {min(number)/sum(number):.2f}\")\n",
" ax.set_title(f\"Ratio: {min(number) / sum(number):.2f}\")\n",
"plt.tight_layout()\n",
"fig.set_size_inches((10, 12))\n",
"plt.show()"
Expand Down Expand Up @@ -385,7 +385,7 @@
" pedpy.plot_density(\n",
" density=density_voronoi[number], axes=ax0, color=colors[i]\n",
" )\n",
" labels.append(f\"Ratio: {min(number)/sum(number):.3f}\")\n",
" labels.append(f\"Ratio: {min(number) / sum(number):.3f}\")\n",
"\n",
"ax0.legend(labels)\n",
"plt.show()"
Expand Down Expand Up @@ -474,14 +474,14 @@
" pedpy.plot_speed(\n",
" speed=mean_speed_r[number],\n",
" axes=ax,\n",
" title=f\"Mean speed. Ratio: {min(number)/sum(number):.3f}\",\n",
" title=f\"Mean speed. Ratio: {min(number) / sum(number):.3f}\",\n",
" color=pedpy.PEDPY_BLUE,\n",
" )\n",
"\n",
" if number in mean_speed_l:\n",
" pedpy.plot_speed(\n",
" speed=mean_speed_l[number],\n",
" title=f\"Mean speed. Ratio: {min(number)/sum(number):.3f}\",\n",
" title=f\"Mean speed. Ratio: {min(number) / sum(number):.3f}\",\n",
" axes=ax,\n",
" color=pedpy.PEDPY_RED,\n",
" )\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/routing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"for idx, (waypoint, distance) in enumerate(waypoints):\n",
" ax.plot(waypoint[0], waypoint[1], \"ro\")\n",
" ax.annotate(\n",
" f\"WP {idx+1}\",\n",
" f\"WP {idx + 1}\",\n",
" (waypoint[0], waypoint[1]),\n",
" textcoords=\"offset points\",\n",
" xytext=(10, -15),\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _speed_to_color(speed, min_speed, max_speed):
"""Map a speed value to a color using a colormap."""
normalized_speed = (speed - min_speed) / (max_speed - min_speed)
r, g, b = plt.cm.jet_r(normalized_speed)[:3]
return f"rgba({r*255:.0f}, {g*255:.0f}, {b*255:.0f}, 0.5)"
return f"rgba({r * 255:.0f}, {g * 255:.0f}, {b * 255:.0f}, 0.5)"


def _get_line_color(disk_color):
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
numpy~=1.25
numpy~=2.2
shapely~=2.0
pyside6~=6.5
vtk~=9.3
pyside6~=6.8
vtk~=9.4

# build deps
wheel
build
setuptools

# test deps
pytest~=7.2
pandas~=2.1
pytest~=8.3
pandas~=2.2

# ci deps
jinja2
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
ext_modules=[CMakeExtension("python_bindings_jupedsim")],
cmdclass={"build_ext": CMakeBuild},
zip_safe=False,
python_requires=">=3.10,<3.13",
python_requires=">=3.10,<3.14",
packages=[
"jupedsim",
"jupedsim.models",
Expand All @@ -268,10 +268,10 @@ def build_extension(self, ext: CMakeExtension) -> None:
"jupedsim_visualizer": "python_modules/jupedsim_visualizer/jupedsim_visualizer",
},
install_requires=[
"numpy~=1.25",
"numpy~=2.2",
"shapely~=2.0",
"pyside6~=6.5",
"vtk~=9.3",
"pyside6~=6.8",
"vtk~=9.4",
],
scripts=["python_modules/jupedsim_visualizer/bin/jupedsim-visualizer"],
url="https://www.jupedsim.org",
Expand All @@ -294,6 +294,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
],
Expand Down

0 comments on commit 54e145a

Please sign in to comment.