Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/benchmark_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install dependencies
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/binding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -177,10 +177,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python 3.12
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: "3.12"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- 'test'
- 'examples'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Run clang-format style check
uses: jidicula/clang-format-action@v4.16.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
brew install tbb
fi

- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Build DSF with examples and install
working-directory: ${{github.workspace}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flawfinder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: flawfinder_scan
uses: david-a-wheeler/flawfinder@8e4a779ad59dbfaee5da586aa9210853b701959c
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: true

Expand Down
86 changes: 67 additions & 19 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Extract version from dsf.hpp
id: extract
Expand Down Expand Up @@ -78,9 +78,57 @@ jobs:
echo "should_build=true" >> $GITHUB_OUTPUT
fi

uv-validate:
name: Validate uv workflows
needs: [check-version]
runs-on: ubuntu-latest
if: needs.check-version.outputs.should_build == 'true'

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Set up uv
uses: astral-sh/setup-uv@v5

- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y cmake build-essential doxygen libtbb-dev

- name: Validate uv build
env:
CMAKE_ARGS: "-DDSF_OPTIMIZE_ARCH=OFF"
DSF_OPTIMIZE_ARCH: "OFF"
DSF_PACKAGE_VERSION: ${{ needs.check-version.outputs.publish_version }}
run: uv build

- name: Validate uv source install
env:
DSF_PACKAGE_VERSION: ${{ needs.check-version.outputs.publish_version }}
run: |
uv venv .venv-uv-install
source .venv-uv-install/bin/activate
uv pip install .
python -c "import dsf; print(dsf.__version__)"

- name: Validate uv editable install
env:
DSF_PACKAGE_VERSION: ${{ needs.check-version.outputs.publish_version }}
run: |
uv venv .venv-uv-editable
source .venv-uv-editable/bin/activate
uv pip install -e .
python -c "import dsf; print(dsf.__version__)"

build-wheels-linux:
name: Build wheels on Linux (Python ${{ matrix.python-version }})
needs: [check-version]
needs: [check-version, uv-validate]
runs-on: ubuntu-latest
if: needs.check-version.outputs.should_build == 'true'
strategy:
Expand All @@ -89,10 +137,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -125,14 +173,14 @@ jobs:
python -c "import dsf; print('DSF wheel installation successful')"

- name: Upload wheels as artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: wheel-linux-${{ matrix.python-version }}
path: wheelhouse/*.whl

build-wheels-macos:
name: Build wheels on macOS (Python ${{ matrix.python-version }})
needs: [check-version]
needs: [check-version, uv-validate]
runs-on: macos-latest
if: needs.check-version.outputs.should_build == 'true'
strategy:
Expand All @@ -141,10 +189,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -174,14 +222,14 @@ jobs:
delocate-wheel -w wheelhouse -v --require-archs $(uname -m) dist/*.whl

- name: Upload wheels as artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: wheel-macos-${{ matrix.python-version }}
path: wheelhouse/*.whl

build-wheels-windows:
name: Build wheels on Windows (Python ${{ matrix.python-version }})
needs: [check-version]
needs: [check-version, uv-validate]
runs-on: windows-latest
if: needs.check-version.outputs.should_build == 'true'
strategy:
Expand All @@ -190,10 +238,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -220,23 +268,23 @@ jobs:
run: python -m build --wheel

- name: Upload wheels as artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: wheel-windows-${{ matrix.python-version }}
path: dist/*.whl

build-sdist:
name: Build source distribution
needs: [check-version]
needs: [check-version, uv-validate]
runs-on: ubuntu-latest
if: needs.check-version.outputs.should_build == 'true'

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: "3.12"

Expand All @@ -256,14 +304,14 @@ jobs:
run: python -m build --sdist

- name: Upload sdist as artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: sdist
path: dist/*.tar.gz

publish:
name: Publish to PyPI
needs: [check-version, build-wheels-linux, build-wheels-macos, build-wheels-windows, build-sdist]
needs: [check-version, uv-validate, build-wheels-linux, build-wheels-macos, build-wheels-windows, build-sdist]
runs-on: ubuntu-latest
if: needs.check-version.outputs.should_build == 'true'

Expand All @@ -282,7 +330,7 @@ jobs:
ls -la dist/

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: "3.12"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
python-version: ["3.10", "3.12"]

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Python 3.12
uses: actions/setup-python@v3
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
Expand Down
66 changes: 64 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
[build-system]
requires = ["setuptools>=61.0", "wheel", "pybind11-stubgen"]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=77.0.0", "wheel", "cmake>=3.16", "pybind11-stubgen"]
build-backend = "setuptools.build_meta"

[project]
name = "dsf-mobility"
description = "DSF C++ core with Python bindings via pybind11"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.10"
license = "CC-BY-NC-SA-4.0"
license-files = ["LICENSE"]
authors = [
{ name = "Grufoony", email = "gregorio.berselli@studio.unibo.it" },
]
keywords = [
"traffic",
"simulation",
"dynamics",
"network",
"modeling",
"transportation",
"mobility",
"congestion",
"flow",
"optimization",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.12",
"Programming Language :: C++",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
]
dependencies = [
"osmnx>=2.0.6",
"networkx>=3",
"numpy",
"geopandas",
"shapely",
"folium",
]
dynamic = ["version"]

[project.urls]
Homepage = "https://github.com/physycom/DynamicalSystemFramework"
Documentation = "https://physycom.github.io/DynamicalSystemFramework/"
Repository = "https://github.com/physycom/DynamicalSystemFramework"
Issues = "https://github.com/physycom/DynamicalSystemFramework/issues"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["src"]
include = ["dsf*"]
namespaces = true

[tool.setuptools.package-data]
dsf = ["*.pyi", "py.typed", "**/*.pyi"]
Loading
Loading