From f354821df723a8538ea9c682d8489c1c6f969dd5 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Thu, 11 Jul 2024 22:17:55 -0700 Subject: [PATCH 01/49] python package --- .github/workflows/tests.yml | 40 +++++++++++++++++------------------ MANIFEST.in | 5 +++++ SConstruct | 2 ++ install_dependencies.sh | 20 ++++++++++++++++++ pyproject.toml | 28 ++++++++++++++++++++++++- requirements.txt | 11 ---------- setup.py | 42 ++++++++++++++++++------------------- 7 files changed, 94 insertions(+), 54 deletions(-) create mode 100644 MANIFEST.in create mode 100644 install_dependencies.sh delete mode 100644 requirements.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9b0f82d..baa30d2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,33 +2,33 @@ name: tests on: [push, pull_request] -env: - REGISTRY: ghcr.io/commaai - BUILD: docker buildx build --pull --load --cache-to type=inline --cache-from $REGISTRY/rednose:latest -t rednose -f Dockerfile . - RUN: docker run rednose bash -c - jobs: test: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - - name: Build docker image - run: eval ${{ env.BUILD }} + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Installing build dependencies + run: ./install_dependencies.sh + - name: Installing rednose + run: pip3 install --break-system-packages .[dev] - name: Static analysis - run: ${{ env.RUN }} "git init && git add -A && pre-commit run --all" + run: pre-commit run --all - name: Unit Tests - run: ${{ env.RUN }} "pytest" + run: pytest - docker_push: - name: docker push - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/rednose' + static_analysis: + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - name: Build Docker image - run: eval ${{ env.BUILD }} - - name: Push to dockerhub - run: | - docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} - docker tag rednose ${{ env.REGISTRY }}/rednose:latest - docker push ${{ env.REGISTRY }}/rednose:latest + - name: Installing build dependencies + run: ./install_dependencies.sh + - name: Installing rednose + run: pip3 install --break-system-packages .[dev] + - name: Static analysis + run: pre-commit run --all diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..3f0af2d --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +exclude rednose/**/*.o +include SConstruct +include rednose/SConscript +include examples/SConscript +recursive-include site_scons * diff --git a/SConstruct b/SConstruct index c668d1b..3a947cd 100644 --- a/SConstruct +++ b/SConstruct @@ -40,6 +40,8 @@ env = Environment( tools=["default", "cython", "rednose_filter"], ) +env.AppendENVPath('PYTHONPATH', '.') + # Cython build enviroment envCython = env.Clone() envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-shadow", "-Wno-deprecated-declarations"] diff --git a/install_dependencies.sh b/install_dependencies.sh new file mode 100644 index 0000000..28adcb0 --- /dev/null +++ b/install_dependencies.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +cd $DIR + +SUDO="" + +# Use sudo if not root +if [[ ! $(id -u) -eq 0 ]]; then + if [[ -z $(which sudo) ]]; then + echo "Please install sudo or run as root" + exit 1 + fi + SUDO="sudo" +fi + +$SUDO apt-get update +$SUDO apt-get install -y --no-install-recommends capnproto libcapnp-dev clang wget git autoconf libtool curl make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl libeigen3-dev python3-pip python3-dev + diff --git a/pyproject.toml b/pyproject.toml index fa6ae11..d0f03a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,30 @@ -# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml +[project] +name = "rednose" +requires-python = ">= 3.8" +version = "0.1.0" + +dependencies = [ + "sympy", + "numpy", + "scipy", + "tqdm", + "cffi", + "scons", + "Cython", +] + +[project.optional-dependencies] +dev = [ + "ruff", + "pre-commit", + "pytest", + "pytest-xdist", +] + +[build-system] +requires = ["setuptools","scons","Cython","numpy","sympy", "pytest", "cffi"] +build-backend = "setuptools.build_meta" + [tool.ruff] line-length = 160 target-version="py311" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 81875a8..0000000 --- a/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -ruff -sympy -numpy -scipy -tqdm -cffi -scons -pre-commit -Cython -pytest -pytest-xdist diff --git a/setup.py b/setup.py index 492b58f..284c756 100644 --- a/setup.py +++ b/setup.py @@ -1,26 +1,24 @@ +from setuptools import Command, setup +from setuptools.command.build import build +import subprocess import os -from setuptools import setup, find_packages -here = os.path.abspath(os.path.dirname(__file__)) +class SconsBuild(Command): + def initialize_options(self) -> None: + pass + + def finalize_options(self) -> None: + pass + + def run(self) -> None: + subprocess.run(["scons -j$(nproc)"], shell=True).check_returncode() + +class CustomBuild(build): + sub_commands = [('scons_build', None)] + build.sub_commands setup( - name='rednose', - version='0.0.1', - url='https://github.com/commaai/rednose', - author='comma.ai', - author_email='harald@comma.ai', - packages=find_packages(), - platforms='any', - license='MIT', - package_data={'': ['helpers/chi2_lookup_table.npy', 'templates/*']}, - install_requires=[ - 'sympy', - 'numpy', - 'scipy', - 'tqdm', - 'cffi', - ], - ext_modules=[], - description="Kalman filter library", - long_description='See https://github.com/commaai/rednose', -) + packages = ["rednose", "examples", "rednose.helpers"], + package_data={'': ['**/*.cc', '**/*.c', '**/*.h', '**/*.pxd', '**/*.pyx', '**/*.py', '**/*.so', '**/*.npy']}, + include_package_data=True, + cmdclass={'build': CustomBuild, 'scons_build': SconsBuild} + ) From a63fce0425991261065eff2830f4c1244d4440ea Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Thu, 11 Jul 2024 22:19:11 -0700 Subject: [PATCH 02/49] x --- install_dependencies.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 install_dependencies.sh diff --git a/install_dependencies.sh b/install_dependencies.sh old mode 100644 new mode 100755 From 1e7adacfbd8c557fd0f3333da256e9b09c95392d Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Thu, 11 Jul 2024 22:21:31 -0700 Subject: [PATCH 03/49] test --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index baa30d2..2405b71 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.11", "3.12"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From c0c93f73af26fa1ee33230e2ef167468a3cdf253 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Thu, 11 Jul 2024 22:23:45 -0700 Subject: [PATCH 04/49] no pre-commit --- .github/workflows/tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2405b71..49e7f60 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,8 +17,6 @@ jobs: run: ./install_dependencies.sh - name: Installing rednose run: pip3 install --break-system-packages .[dev] - - name: Static analysis - run: pre-commit run --all - name: Unit Tests run: pytest From 4b7c92c72ed987b458c9d8669c5f390e481ee236 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Thu, 11 Jul 2024 22:24:09 -0700 Subject: [PATCH 05/49] fix --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 284c756..b0ea12f 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ from setuptools import Command, setup from setuptools.command.build import build import subprocess -import os class SconsBuild(Command): def initialize_options(self) -> None: From 9fa5079dfcdd33fd0fb107c0019ede110f495b9c Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 12 Jul 2024 15:42:57 -0700 Subject: [PATCH 06/49] instructions --- .github/workflows/tests.yml | 6 +++--- README.md | 14 ++++++++++++++ .../install_dependencies.sh | 1 - 3 files changed, 17 insertions(+), 4 deletions(-) rename install_dependencies.sh => scripts/install_dependencies.sh (99%) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 49e7f60..28dfb04 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,14 +7,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Installing build dependencies - run: ./install_dependencies.sh + run: scripts/install_dependencies.sh - name: Installing rednose run: pip3 install --break-system-packages .[dev] - name: Unit Tests @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Installing build dependencies - run: ./install_dependencies.sh + run: scripts/install_dependencies.sh - name: Installing rednose run: pip3 install --break-system-packages .[dev] - name: Static analysis diff --git a/README.md b/README.md index 264958b..f00702d 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,17 @@ A lot of measurements do not come from a Gaussian distribution and as such have of the Kalman filter. This can cause a lot of performance issues if not dealt with. This library allows the use of a mahalanobis distance statistical test on the incoming measurements to deal with this. Note that good initialization is critical to prevent good measurements from being rejected. + +### Building +On ubuntu: +``` bash +scripts/install_dependencies.sh +pip install . +``` +or run some test: +On ubuntu: +``` bash +scripts/install_dependencies.sh +pip install .[dev] +pytest +``` diff --git a/install_dependencies.sh b/scripts/install_dependencies.sh similarity index 99% rename from install_dependencies.sh rename to scripts/install_dependencies.sh index 28adcb0..59ee0d6 100755 --- a/install_dependencies.sh +++ b/scripts/install_dependencies.sh @@ -17,4 +17,3 @@ fi $SUDO apt-get update $SUDO apt-get install -y --no-install-recommends capnproto libcapnp-dev clang wget git autoconf libtool curl make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl libeigen3-dev python3-pip python3-dev - From 31f87dbd043b4c6cdcea93da885bdcd2c4346e33 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 12 Jul 2024 15:49:23 -0700 Subject: [PATCH 07/49] version --- .github/workflows/tests.yml | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 28dfb04..688f22e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 diff --git a/pyproject.toml b/pyproject.toml index d0f03a4..acea5df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "rednose" -requires-python = ">= 3.8" +requires-python = ">= 3.9" version = "0.1.0" dependencies = [ @@ -27,7 +27,7 @@ build-backend = "setuptools.build_meta" [tool.ruff] line-length = 160 -target-version="py311" +target-version="py39" [tool.ruff.lint] select = ["E", "F", "W", "PIE", "C4", "ISC", "RUF100", "A"] From eb0541bed345c9baff06f6d70a360f18ef9e12e6 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 12 Jul 2024 21:35:25 -0700 Subject: [PATCH 08/49] clean --- scripts/install_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_dependencies.sh b/scripts/install_dependencies.sh index 59ee0d6..d7f109b 100755 --- a/scripts/install_dependencies.sh +++ b/scripts/install_dependencies.sh @@ -16,4 +16,4 @@ if [[ ! $(id -u) -eq 0 ]]; then fi $SUDO apt-get update -$SUDO apt-get install -y --no-install-recommends capnproto libcapnp-dev clang wget git autoconf libtool curl make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl libeigen3-dev python3-pip python3-dev +$SUDO apt-get install -y --no-install-recommends python3 python3-pip clang libeigen3-dev From f1230d71837008a52e88481a522d54f2fd55e28e Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 12 Jul 2024 23:48:18 -0700 Subject: [PATCH 09/49] wheels --- .github/workflows/wheels.yml | 15 +++++++++++++++ scripts/build-manylinux-wheel.sh | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/wheels.yml create mode 100755 scripts/build-manylinux-wheel.sh diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..3d44958 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,15 @@ +name: wheels + +on: [push, pull_request] + +jobs: + wheels: + runs-on: ubuntu-latest + strategy: + matrix: + image: ["manylinux_2_28_x86_64"] + python_version: [ {cp: cp39-cp39, py: 39}, {cp: cp310-cp310, py: 3.10}, {cp: cp311-cp311, py: 3.11}, {cp: cp312-cp312, py: 3.12} ] + steps: + - uses: actions/checkout@v4 + - name: Building wheel + run: docker run -e PYPATH=/opt/python/${{ matrix.python_version.cp }} -e PYTHON_VERSION=${{ matrix.python_version.py }} --rm -v `pwd`:/project quay.io/pypa/${{ matrix.image }} /project/scripts/build-manylinux-wheel.sh diff --git a/scripts/build-manylinux-wheel.sh b/scripts/build-manylinux-wheel.sh new file mode 100755 index 0000000..c29ffc9 --- /dev/null +++ b/scripts/build-manylinux-wheel.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -ex + +if [ -x /usr/bin/yum ]; then + yum install -y python${PYTHON_VERSION}-devel.x86_64 clang libffi-devel eigen3-devel +fi + +if [ -e /tmp/wheels ]; then + echo "/tmp/wheels should not exist!" + exit 1 +fi + +mkdir -p /tmp/wheels + +${PYPATH}/bin/python -m pip wheel -v /project -w /tmp/wheels --no-deps +wheel=$(ls /tmp/wheels/*.whl) + +# Apply fixups. +auditwheel repair ${wheel} -w /project/dist From d2144103080e1bdc86f442f7dd44f443ae33d7d0 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 12 Jul 2024 23:51:17 -0700 Subject: [PATCH 10/49] par --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 3d44958..16b8a82 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: image: ["manylinux_2_28_x86_64"] - python_version: [ {cp: cp39-cp39, py: 39}, {cp: cp310-cp310, py: 3.10}, {cp: cp311-cp311, py: 3.11}, {cp: cp312-cp312, py: 3.12} ] + python_version: [ {cp: "cp39-cp39", py: "39"}, {cp: "cp310-cp310", py: "3.10"}, {cp: "cp311-cp311", py: "3.11"}, {cp: "cp312-cp312", py: "3.12"} ] steps: - uses: actions/checkout@v4 - name: Building wheel From 2ea36b581b64400dc3f657e733a18c3f089bb5d8 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 12 Jul 2024 23:55:52 -0700 Subject: [PATCH 11/49] 39 --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 16b8a82..8c98b23 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: image: ["manylinux_2_28_x86_64"] - python_version: [ {cp: "cp39-cp39", py: "39"}, {cp: "cp310-cp310", py: "3.10"}, {cp: "cp311-cp311", py: "3.11"}, {cp: "cp312-cp312", py: "3.12"} ] + python_version: [ {cp: "cp39-cp39", py: "39"}, {cp: "cp310-cp310", py: "39"}, {cp: "cp311-cp311", py: "3.11"}, {cp: "cp312-cp312", py: "3.12"} ] steps: - uses: actions/checkout@v4 - name: Building wheel From dd3ba67e4b84f7422dd4e1c0cd86d9fa1a84d613 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Sat, 13 Jul 2024 00:00:50 -0700 Subject: [PATCH 12/49] np --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index acea5df..25490cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ version = "0.1.0" dependencies = [ "sympy", - "numpy", + "numpy<2.0", "scipy", "tqdm", "cffi", @@ -22,7 +22,7 @@ dev = [ ] [build-system] -requires = ["setuptools","scons","Cython","numpy","sympy", "pytest", "cffi"] +requires = ["setuptools","scons","Cython","numpy<2.0","sympy", "pytest", "cffi"] build-backend = "setuptools.build_meta" [tool.ruff] From 6ba9222873ce1a5f483d854508cc96a431cecb14 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 15:45:31 -0700 Subject: [PATCH 13/49] real wheel --- MANIFEST.in | 2 +- SConstruct | 4 +--- pyproject.toml | 2 +- {examples => rednose/examples}/SConscript | 2 ++ {examples => rednose/examples}/__init__.py | 0 .../examples}/kinematic_kf.png | Bin .../examples}/kinematic_kf.py | 0 {examples => rednose/examples}/live_kf.py | 0 .../examples}/test_compare.py | 0 .../examples}/test_kinematic_kf.py | 0 scripts/build-manylinux-wheel.sh | 20 ------------------ scripts/build_wheel.sh | 11 ++++++++++ setup.py | 14 +++++++++--- 13 files changed, 27 insertions(+), 28 deletions(-) rename {examples => rednose/examples}/SConscript (87%) rename {examples => rednose/examples}/__init__.py (100%) rename {examples => rednose/examples}/kinematic_kf.png (100%) rename {examples => rednose/examples}/kinematic_kf.py (100%) rename {examples => rednose/examples}/live_kf.py (100%) rename {examples => rednose/examples}/test_compare.py (100%) rename {examples => rednose/examples}/test_kinematic_kf.py (100%) delete mode 100755 scripts/build-manylinux-wheel.sh create mode 100755 scripts/build_wheel.sh diff --git a/MANIFEST.in b/MANIFEST.in index 3f0af2d..360135c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ exclude rednose/**/*.o include SConstruct include rednose/SConscript -include examples/SConscript +include rednose/examples/SConscript recursive-include site_scons * diff --git a/SConstruct b/SConstruct index 3a947cd..e0ce849 100644 --- a/SConstruct +++ b/SConstruct @@ -40,8 +40,6 @@ env = Environment( tools=["default", "cython", "rednose_filter"], ) -env.AppendENVPath('PYTHONPATH', '.') - # Cython build enviroment envCython = env.Clone() envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-shadow", "-Wno-deprecated-declarations"] @@ -58,4 +56,4 @@ else: Export('env', 'envCython', 'common') SConscript(['#rednose/SConscript']) -SConscript(['#examples/SConscript']) +SConscript(['#rednose/examples/SConscript']) diff --git a/pyproject.toml b/pyproject.toml index 25490cd..c9608da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ dev = [ ] [build-system] -requires = ["setuptools","scons","Cython","numpy<2.0","sympy", "pytest", "cffi"] +requires = ["setuptools", "scons", "Cython", "numpy<2.0", "sympy", "pytest", "cffi"] build-backend = "setuptools.build_meta" [tool.ruff] diff --git a/examples/SConscript b/rednose/examples/SConscript similarity index 87% rename from examples/SConscript rename to rednose/examples/SConscript index 3d178ad..57ba76e 100644 --- a/examples/SConscript +++ b/rednose/examples/SConscript @@ -1,5 +1,7 @@ Import('env') +env.AppendENVPath('PYTHONPATH', env["REDNOSE_ROOT"]) + gen_dir = Dir('generated/').abspath env.RednoseCompileFilter( diff --git a/examples/__init__.py b/rednose/examples/__init__.py similarity index 100% rename from examples/__init__.py rename to rednose/examples/__init__.py diff --git a/examples/kinematic_kf.png b/rednose/examples/kinematic_kf.png similarity index 100% rename from examples/kinematic_kf.png rename to rednose/examples/kinematic_kf.png diff --git a/examples/kinematic_kf.py b/rednose/examples/kinematic_kf.py similarity index 100% rename from examples/kinematic_kf.py rename to rednose/examples/kinematic_kf.py diff --git a/examples/live_kf.py b/rednose/examples/live_kf.py similarity index 100% rename from examples/live_kf.py rename to rednose/examples/live_kf.py diff --git a/examples/test_compare.py b/rednose/examples/test_compare.py similarity index 100% rename from examples/test_compare.py rename to rednose/examples/test_compare.py diff --git a/examples/test_kinematic_kf.py b/rednose/examples/test_kinematic_kf.py similarity index 100% rename from examples/test_kinematic_kf.py rename to rednose/examples/test_kinematic_kf.py diff --git a/scripts/build-manylinux-wheel.sh b/scripts/build-manylinux-wheel.sh deleted file mode 100755 index c29ffc9..0000000 --- a/scripts/build-manylinux-wheel.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -ex - -if [ -x /usr/bin/yum ]; then - yum install -y python${PYTHON_VERSION}-devel.x86_64 clang libffi-devel eigen3-devel -fi - -if [ -e /tmp/wheels ]; then - echo "/tmp/wheels should not exist!" - exit 1 -fi - -mkdir -p /tmp/wheels - -${PYPATH}/bin/python -m pip wheel -v /project -w /tmp/wheels --no-deps -wheel=$(ls /tmp/wheels/*.whl) - -# Apply fixups. -auditwheel repair ${wheel} -w /project/dist diff --git a/scripts/build_wheel.sh b/scripts/build_wheel.sh new file mode 100755 index 0000000..b4d9394 --- /dev/null +++ b/scripts/build_wheel.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +cd $DIR/.. + +export CIBW_BUILD="cp312-manylinux_x86_64 cp311-manylinux_x86_64" +export CIBW_MANYLINUX_X86_64_IMAGE="quay.io/pypa/manylinux_2_28_x86_64" +export CIBW_BEFORE_ALL_LINUX="dnf install -y clang libffi-devel eigen3-devel" + +cibuildwheel diff --git a/setup.py b/setup.py index b0ea12f..f752cc1 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,12 @@ -from setuptools import Command, setup +from setuptools import Command, setup, Distribution from setuptools.command.build import build import subprocess +class BinaryDistribution(Distribution): + def has_ext_modules(self): + return True + + class SconsBuild(Command): def initialize_options(self) -> None: pass @@ -12,12 +17,15 @@ def finalize_options(self) -> None: def run(self) -> None: subprocess.run(["scons -j$(nproc)"], shell=True).check_returncode() + class CustomBuild(build): sub_commands = [('scons_build', None)] + build.sub_commands + setup( - packages = ["rednose", "examples", "rednose.helpers"], + packages = ["rednose", "rednose.examples", "rednose.helpers"], package_data={'': ['**/*.cc', '**/*.c', '**/*.h', '**/*.pxd', '**/*.pyx', '**/*.py', '**/*.so', '**/*.npy']}, include_package_data=True, - cmdclass={'build': CustomBuild, 'scons_build': SconsBuild} + cmdclass={'build': CustomBuild, 'scons_build': SconsBuild}, + distclass=BinaryDistribution, ) From c26fce51fa6b0a204fc23046706f317247d7d372 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 16:18:21 -0700 Subject: [PATCH 14/49] wheel --- .github/workflows/tests.yml | 2 +- .github/workflows/wheels.yml | 16 ++++++++++++---- pyproject.toml | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 688f22e..bd12620 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.11", "3.12"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8c98b23..76c6918 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -4,12 +4,20 @@ on: [push, pull_request] jobs: wheels: - runs-on: ubuntu-latest + runs-on: ${{ matrix.platform[0] }} strategy: + fail-fast: false matrix: - image: ["manylinux_2_28_x86_64"] - python_version: [ {cp: "cp39-cp39", py: "39"}, {cp: "cp310-cp310", py: "39"}, {cp: "cp311-cp311", py: "3.11"}, {cp: "cp312-cp312", py: "3.12"} ] + platform: + - ['ubuntu-20.04, manylinux_x86_64'] + python: ['cp311', 'cp312'] + steps: - uses: actions/checkout@v4 - name: Building wheel - run: docker run -e PYPATH=/opt/python/${{ matrix.python_version.cp }} -e PYTHON_VERSION=${{ matrix.python_version.py }} --rm -v `pwd`:/project quay.io/pypa/${{ matrix.image }} /project/scripts/build-manylinux-wheel.sh + uses: pypa/cibuildwheel@v2.19.2 + env: + uses: + CIBW_BUILD: "${{ matrix.python }}-${{ matrix.buildplat[1] }}" + CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28_x86_64" + CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel" diff --git a/pyproject.toml b/pyproject.toml index c9608da..a4f04c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "rednose" -requires-python = ">= 3.9" +requires-python = ">= 3.11" version = "0.1.0" dependencies = [ @@ -27,7 +27,7 @@ build-backend = "setuptools.build_meta" [tool.ruff] line-length = 160 -target-version="py39" +target-version="py311" [tool.ruff.lint] select = ["E", "F", "W", "PIE", "C4", "ISC", "RUF100", "A"] From 09470cefef6fc9541c13182a9fd211fcbade395e Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 16:20:37 -0700 Subject: [PATCH 15/49] mapping --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 76c6918..59f3161 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -18,6 +18,6 @@ jobs: uses: pypa/cibuildwheel@v2.19.2 env: uses: - CIBW_BUILD: "${{ matrix.python }}-${{ matrix.buildplat[1] }}" + CIBW_BUILD: "${{ matrix.python }}-${{ matrix.platform[1] }}" CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28_x86_64" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel" From 890c2c4a42e8442b2cc685793c89257fac0d1666 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 16:23:15 -0700 Subject: [PATCH 16/49] yml... --- .github/workflows/wheels.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 59f3161..9310002 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -17,7 +17,6 @@ jobs: - name: Building wheel uses: pypa/cibuildwheel@v2.19.2 env: - uses: - CIBW_BUILD: "${{ matrix.python }}-${{ matrix.platform[1] }}" - CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28_x86_64" - CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel" + CIBW_BUILD: "${{ matrix.python }}-${{ matrix.platform[1] }}" + CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28_x86_64" + CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel" From 735f342941f326c4de4d3efa50dc55b57ff3c5e6 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 16:36:30 -0700 Subject: [PATCH 17/49] ' --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9310002..a8b48fa 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -9,7 +9,7 @@ jobs: fail-fast: false matrix: platform: - - ['ubuntu-20.04, manylinux_x86_64'] + - [ubuntu-latest, manylinux_x86_64] python: ['cp311', 'cp312'] steps: From 76e25cf9dcb36c0bf004f4295fd16f189a1a342d Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 16:41:25 -0700 Subject: [PATCH 18/49] use this image --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a8b48fa..bb86b7b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -18,5 +18,5 @@ jobs: uses: pypa/cibuildwheel@v2.19.2 env: CIBW_BUILD: "${{ matrix.python }}-${{ matrix.platform[1] }}" - CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28_x86_64" + CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel" From f1ce9839bf860840ffb83e3f36c22ac807b2dd17 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 16:50:07 -0700 Subject: [PATCH 19/49] aarch64 --- .github/workflows/wheels.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index bb86b7b..a6fdcc9 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -10,13 +10,22 @@ jobs: matrix: platform: - [ubuntu-latest, manylinux_x86_64] + - [ubuntu-latest, manylinux_aarch64] python: ['cp311', 'cp312'] steps: - uses: actions/checkout@v4 + + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v3 + with: + platforms: all + - name: Building wheel uses: pypa/cibuildwheel@v2.19.2 env: CIBW_BUILD: "${{ matrix.python }}-${{ matrix.platform[1] }}" CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" + CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel" From a8db4b4d38f97462735c62c80ca4cab25c788ba5 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 16:53:12 -0700 Subject: [PATCH 20/49] test aarch --- .github/workflows/wheels.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a6fdcc9..aac76ff 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -9,8 +9,8 @@ jobs: fail-fast: false matrix: platform: - - [ubuntu-latest, manylinux_x86_64] - [ubuntu-latest, manylinux_aarch64] + #- [ubuntu-latest, manylinux_x86_64] python: ['cp311', 'cp312'] steps: @@ -26,6 +26,7 @@ jobs: uses: pypa/cibuildwheel@v2.19.2 env: CIBW_BUILD: "${{ matrix.python }}-${{ matrix.platform[1] }}" - CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" + #CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" + CIBW_ARCHS_LINUX: "aarch64" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel" From e382021262df038145cff168a1ed429b392c51c9 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 17:47:27 -0700 Subject: [PATCH 21/49] fake test --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index aac76ff..b0c129f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -29,4 +29,4 @@ jobs: #CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" CIBW_ARCHS_LINUX: "aarch64" - CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel" + CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python3.11-devel.aarch64" From 3bba17a17208f30c1498423127caaf068b448a94 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 20:31:41 -0700 Subject: [PATCH 22/49] macos --- .github/workflows/wheels.yml | 20 +++++++++----------- pyproject.toml | 4 ++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b0c129f..ede817a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -4,14 +4,14 @@ on: [push, pull_request] jobs: wheels: - runs-on: ${{ matrix.platform[0] }} + runs-on: ${{ matrix.platform.os }} strategy: - fail-fast: false + fail-fast: true matrix: - platform: - - [ubuntu-latest, manylinux_aarch64] - #- [ubuntu-latest, manylinux_x86_64] - python: ['cp311', 'cp312'] + platform: [ {os: "ubuntu-latest", target: "manylinux_x86_64"}, + {os: "ubuntu-latest", target: "manylinux_aarch64"}, + {os: "macos-14", target: "macosx_arm64" }] + python: [ {cp: "cp311", py: "3.11"}, {cp: "cp312", py: "3.12"}] steps: - uses: actions/checkout@v4 @@ -25,8 +25,6 @@ jobs: - name: Building wheel uses: pypa/cibuildwheel@v2.19.2 env: - CIBW_BUILD: "${{ matrix.python }}-${{ matrix.platform[1] }}" - #CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" - CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" - CIBW_ARCHS_LINUX: "aarch64" - CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python3.11-devel.aarch64" + CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}" + CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" + CIBW_BEFORE_ALL_MACOS: "brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13" diff --git a/pyproject.toml b/pyproject.toml index a4f04c5..e7371ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,3 +40,7 @@ flake8-implicit-str-concat.allow-multiline=false [tool.pytest.ini_options] addopts = "--durations=10 -n auto" + +[tool.cibuildwheel.linux] +manylinux-x86_64-image = "manylinux_2_28" +manylinux-aarch64-image = "manylinux_2_28" From b85776ae2d3fde538275babf1a62d1206b887837 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 20:34:52 -0700 Subject: [PATCH 23/49] skip --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index e7371ad..be13308 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,9 @@ flake8-implicit-str-concat.allow-multiline=false [tool.pytest.ini_options] addopts = "--durations=10 -n auto" +[tool.cibuildwheel] +skip = "cp36-* cp37-* cp-38* cp-39* cp-310* pp37-* pp38-* pp39-* pp310-* *-manylinux_i686 *_ppc64le *_s390x *_universal2" + [tool.cibuildwheel.linux] manylinux-x86_64-image = "manylinux_2_28" manylinux-aarch64-image = "manylinux_2_28" From 5a983837c8d41489578841781803046831c7d7cb Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 20:40:45 -0700 Subject: [PATCH 24/49] archs --- .github/workflows/wheels.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ede817a..52bdcfa 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -8,9 +8,9 @@ jobs: strategy: fail-fast: true matrix: - platform: [ {os: "ubuntu-latest", target: "manylinux_x86_64"}, - {os: "ubuntu-latest", target: "manylinux_aarch64"}, - {os: "macos-14", target: "macosx_arm64" }] + platform: [ {os: "ubuntu-latest", target: "manylinux_x86_64", arch: "x86_64"}, + {os: "ubuntu-latest", target: "manylinux_aarch64", arch: "aarch64"}, + {os: "macos-14", target: "macosx_arm64" arch: "arm64"}] python: [ {cp: "cp311", py: "3.11"}, {cp: "cp312", py: "3.12"}] steps: @@ -26,5 +26,6 @@ jobs: uses: pypa/cibuildwheel@v2.19.2 env: CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}" + CIBW_ARCHS: "${{ matrix.platform.arch }}" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" CIBW_BEFORE_ALL_MACOS: "brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13" From 5cd9791af6815bb84d5c391a85709c316dfb914b Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 20:44:24 -0700 Subject: [PATCH 25/49] fix --- .github/workflows/wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 52bdcfa..90878b9 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -10,8 +10,8 @@ jobs: matrix: platform: [ {os: "ubuntu-latest", target: "manylinux_x86_64", arch: "x86_64"}, {os: "ubuntu-latest", target: "manylinux_aarch64", arch: "aarch64"}, - {os: "macos-14", target: "macosx_arm64" arch: "arm64"}] - python: [ {cp: "cp311", py: "3.11"}, {cp: "cp312", py: "3.12"}] + {os: "macos-14", target: "macosx_arm64", arch: "arm64"} ] + python: [ {cp: "cp311", py: "3.11"}, {cp: "cp312", py: "3.12"} ] steps: - uses: actions/checkout@v4 From ae7409e9afaabc40bdfcb9143a5f79fd8bd83bcb Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 20:48:11 -0700 Subject: [PATCH 26/49] nproc --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f752cc1..823c18e 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ def finalize_options(self) -> None: pass def run(self) -> None: - subprocess.run(["scons -j$(nproc)"], shell=True).check_returncode() + subprocess.run(["scons -j$(nproc || sysctl -n hw.logicalcpu)"], shell=True).check_returncode() class CustomBuild(build): From 016609d98ce284d40e267626624b1bdad8f16db0 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 21:01:39 -0700 Subject: [PATCH 27/49] try --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 90878b9..a62e287 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -28,4 +28,4 @@ jobs: CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}" CIBW_ARCHS: "${{ matrix.platform.arch }}" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" - CIBW_BEFORE_ALL_MACOS: "brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13" + CIBW_BEFORE_ALL_MACOS: "brew install cmake && brew install zlib && brew install coreutils && brew install libarchive && brew install libtool && brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 && brew info eigen" From d022fe4e20bee93cd82b58dfc3db8fff05454494 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 21:09:41 -0700 Subject: [PATCH 28/49] freeling --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a62e287..460fbb4 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -28,4 +28,4 @@ jobs: CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}" CIBW_ARCHS: "${{ matrix.platform.arch }}" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" - CIBW_BEFORE_ALL_MACOS: "brew install cmake && brew install zlib && brew install coreutils && brew install libarchive && brew install libtool && brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 && brew info eigen" + CIBW_BEFORE_ALL_MACOS: "brew install cmake && brew install zlib && brew install coreutils && brew install libarchive && brew install libtool && brew uninstall freeling && brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 && brew info eigen" From f8ee985afa074952e678826d42f7f6e3f316abd5 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 21:16:17 -0700 Subject: [PATCH 29/49] try --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 460fbb4..b18a106 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -28,4 +28,4 @@ jobs: CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}" CIBW_ARCHS: "${{ matrix.platform.arch }}" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" - CIBW_BEFORE_ALL_MACOS: "brew install cmake && brew install zlib && brew install coreutils && brew install libarchive && brew install libtool && brew uninstall freeling && brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 && brew info eigen" + CIBW_BEFORE_BUILD_MACOS: "brew install cmake && brew install zlib && brew install coreutils && brew install libarchive && brew install libtool && brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 && brew info eigen" From 2c765de222ad8e5e86a27e0e1a8acf931d31b7fb Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 21:44:18 -0700 Subject: [PATCH 30/49] scons --- SConstruct | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index e0ce849..992742f 100644 --- a/SConstruct +++ b/SConstruct @@ -6,8 +6,9 @@ import numpy as np arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() common = '' - python_path = sysconfig.get_paths()['include'] + +libpath = [] cpppath = [ '#', '#rednose', @@ -17,6 +18,15 @@ cpppath = [ np.get_include(), ] +if arch == "Darwin": + brew_prefix = subprocess.check_output(['brew', '--prefix'], encoding='utf8').strip() + libpath += [ + f"{brew_prefix}/lib", + ] + cpppath += [ + f"{brew_prefix}/include", + ] + env = Environment( ENV=os.environ, CC='clang', @@ -32,7 +42,7 @@ env = Environment( "-Werror=format-extra-args", "-Wshadow", ], - LIBPATH=["#rednose/examples/generated"], + LIBPATH=libpath + ["#rednose/examples/generated"], CFLAGS="-std=gnu11", CXXFLAGS="-std=c++1z", CPPPATH=cpppath, From 1139a9d5ba3d2ab989c5cdcfd9cdf42a907e6e35 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 21:56:32 -0700 Subject: [PATCH 31/49] test --- SConstruct | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 992742f..b1e4dcd 100644 --- a/SConstruct +++ b/SConstruct @@ -1,4 +1,5 @@ import os +import platform import subprocess import sysconfig import numpy as np @@ -18,13 +19,16 @@ cpppath = [ np.get_include(), ] -if arch == "Darwin": +if platform.processor() == "arm": brew_prefix = subprocess.check_output(['brew', '--prefix'], encoding='utf8').strip() + print('xxxxxxx', brew_prefix) libpath += [ f"{brew_prefix}/lib", + "/opt/homebrew/lib" ] cpppath += [ f"{brew_prefix}/include", + "/opt/homebrew/include" ] env = Environment( @@ -42,7 +46,7 @@ env = Environment( "-Werror=format-extra-args", "-Wshadow", ], - LIBPATH=libpath + ["#rednose/examples/generated"], + LIBPATH=libpath + ["#rednose/examples/generated", '/opt/homebrew/lib'], CFLAGS="-std=gnu11", CXXFLAGS="-std=c++1z", CPPPATH=cpppath, From 6073df9d8f24e81fe6a2614d1d4bf75cc8af7aee Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 22:11:33 -0700 Subject: [PATCH 32/49] py lib --- SConstruct | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index b1e4dcd..b5b6c0e 100644 --- a/SConstruct +++ b/SConstruct @@ -46,7 +46,7 @@ env = Environment( "-Werror=format-extra-args", "-Wshadow", ], - LIBPATH=libpath + ["#rednose/examples/generated", '/opt/homebrew/lib'], + LIBPATH=libpath + ["#rednose/examples/generated"], CFLAGS="-std=gnu11", CXXFLAGS="-std=c++1z", CPPPATH=cpppath, @@ -60,6 +60,7 @@ envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-shadow", "-Wno-deprecated-decla envCython["LIBS"] = [] if arch == "Darwin": + envCython["CPPPATH"] += [python_path, np.get_include()] envCython["LINKFLAGS"] = ["-bundle", "-undefined", "dynamic_lookup"] elif arch == "aarch64": envCython["LINKFLAGS"] = ["-shared"] From 86b5b79ff32d082ba917e17df62509c2e9af9e46 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 22:19:13 -0700 Subject: [PATCH 33/49] try --- .github/workflows/wheels.yml | 2 +- rednose/SConscript | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b18a106..33f250c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -28,4 +28,4 @@ jobs: CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}" CIBW_ARCHS: "${{ matrix.platform.arch }}" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" - CIBW_BEFORE_BUILD_MACOS: "brew install cmake && brew install zlib && brew install coreutils && brew install libarchive && brew install libtool && brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 && brew info eigen" + CIBW_BEFORE_BUILD_MACOS: "brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 && brew info eigen" diff --git a/rednose/SConscript b/rednose/SConscript index 52e36e0..6f442b8 100644 --- a/rednose/SConscript +++ b/rednose/SConscript @@ -12,6 +12,6 @@ if common != "": ekf_objects = env.SharedObject(cc_sources) rednose = env.Library("helpers/ekf_sym", ekf_objects, LIBS=libs) rednose_python = envCython.Program("helpers/ekf_sym_pyx.so", ["helpers/ekf_sym_pyx.pyx", ekf_objects], - LIBS=libs + envCython["LIBS"]) + LIBS=libs + envCython["LIBS"], CPPPATH=envCython["CPPPATH"]) Export('rednose', 'rednose_python') From a24e8ce7b2ab771fcfc96ab1f9ed223ba94659f3 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 22:22:46 -0700 Subject: [PATCH 34/49] try this --- rednose/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rednose/SConscript b/rednose/SConscript index 6f442b8..a61b79d 100644 --- a/rednose/SConscript +++ b/rednose/SConscript @@ -12,6 +12,6 @@ if common != "": ekf_objects = env.SharedObject(cc_sources) rednose = env.Library("helpers/ekf_sym", ekf_objects, LIBS=libs) rednose_python = envCython.Program("helpers/ekf_sym_pyx.so", ["helpers/ekf_sym_pyx.pyx", ekf_objects], - LIBS=libs + envCython["LIBS"], CPPPATH=envCython["CPPPATH"]) + LIBS=libs + envCython["LIBS"], CPPPATH=["/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12", "/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11"]) Export('rednose', 'rednose_python') From 754355c0311174d4474ef0b012e0573fb9bb5de2 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 22:30:04 -0700 Subject: [PATCH 35/49] should work --- SConstruct | 3 ++- rednose/SConscript | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index b5b6c0e..d462a49 100644 --- a/SConstruct +++ b/SConstruct @@ -59,7 +59,8 @@ envCython = env.Clone() envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-shadow", "-Wno-deprecated-declarations"] envCython["LIBS"] = [] -if arch == "Darwin": +if platform.processor() == "arm": + print('AAAAA:', arch) envCython["CPPPATH"] += [python_path, np.get_include()] envCython["LINKFLAGS"] = ["-bundle", "-undefined", "dynamic_lookup"] elif arch == "aarch64": diff --git a/rednose/SConscript b/rednose/SConscript index a61b79d..52e36e0 100644 --- a/rednose/SConscript +++ b/rednose/SConscript @@ -12,6 +12,6 @@ if common != "": ekf_objects = env.SharedObject(cc_sources) rednose = env.Library("helpers/ekf_sym", ekf_objects, LIBS=libs) rednose_python = envCython.Program("helpers/ekf_sym_pyx.so", ["helpers/ekf_sym_pyx.pyx", ekf_objects], - LIBS=libs + envCython["LIBS"], CPPPATH=["/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12", "/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11"]) + LIBS=libs + envCython["LIBS"]) Export('rednose', 'rednose_python') From a4f19778d6d9d9b94ac977f1a2bd671480641a2c Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 22:39:00 -0700 Subject: [PATCH 36/49] get arch test --- SConstruct | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SConstruct b/SConstruct index d462a49..463c5e6 100644 --- a/SConstruct +++ b/SConstruct @@ -19,16 +19,15 @@ cpppath = [ np.get_include(), ] -if platform.processor() == "arm": +print('AAAAA:', arch) +#if platform.processor() == "arm": +if arch == "Darwin": brew_prefix = subprocess.check_output(['brew', '--prefix'], encoding='utf8').strip() - print('xxxxxxx', brew_prefix) libpath += [ f"{brew_prefix}/lib", - "/opt/homebrew/lib" ] cpppath += [ f"{brew_prefix}/include", - "/opt/homebrew/include" ] env = Environment( @@ -59,8 +58,9 @@ envCython = env.Clone() envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-shadow", "-Wno-deprecated-declarations"] envCython["LIBS"] = [] -if platform.processor() == "arm": - print('AAAAA:', arch) +#if platform.processor() == "arm": +if arch == "Darwin": + print('aaaaaaAAAAA:', arch) envCython["CPPPATH"] += [python_path, np.get_include()] envCython["LINKFLAGS"] = ["-bundle", "-undefined", "dynamic_lookup"] elif arch == "aarch64": From b3499f769c759616ef1b20b7d7cd439adb79ec8b Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 17 Jul 2024 22:46:00 -0700 Subject: [PATCH 37/49] fix all --- .github/workflows/wheels.yml | 2 +- SConstruct | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 33f250c..b9e612b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -28,4 +28,4 @@ jobs: CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}" CIBW_ARCHS: "${{ matrix.platform.arch }}" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" - CIBW_BEFORE_BUILD_MACOS: "brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 && brew info eigen" + CIBW_BEFORE_BUILD_MACOS: "brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13" diff --git a/SConstruct b/SConstruct index 463c5e6..3fe4232 100644 --- a/SConstruct +++ b/SConstruct @@ -5,9 +5,11 @@ import sysconfig import numpy as np arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() +if platform.system() == "Darwin": + arch = "Darwin" common = '' -python_path = sysconfig.get_paths()['include'] +py_include = sysconfig.get_paths()['include'] libpath = [] cpppath = [ @@ -15,12 +17,10 @@ cpppath = [ '#rednose', '#rednose/examples/generated', '/usr/lib/include', - python_path, + py_include, np.get_include(), ] -print('AAAAA:', arch) -#if platform.processor() == "arm": if arch == "Darwin": brew_prefix = subprocess.check_output(['brew', '--prefix'], encoding='utf8').strip() libpath += [ @@ -56,16 +56,14 @@ env = Environment( # Cython build enviroment envCython = env.Clone() envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-shadow", "-Wno-deprecated-declarations"] +envCython["CPPPATH"] += [py_include, np.get_include()] envCython["LIBS"] = [] -#if platform.processor() == "arm": if arch == "Darwin": - print('aaaaaaAAAAA:', arch) - envCython["CPPPATH"] += [python_path, np.get_include()] envCython["LINKFLAGS"] = ["-bundle", "-undefined", "dynamic_lookup"] elif arch == "aarch64": envCython["LINKFLAGS"] = ["-shared"] - envCython["LIBS"] = [os.path.basename(python_path)] + envCython["LIBS"] = [os.path.basename(py_include)] else: envCython["LINKFLAGS"] = ["-pthread", "-shared"] From fec51dd67583603df7f380e0745b6c0623720ec5 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Thu, 18 Jul 2024 10:32:10 -0700 Subject: [PATCH 38/49] clean --- .github/workflows/wheels.yml | 2 ++ pyproject.toml | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b9e612b..aff93ee 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -29,3 +29,5 @@ jobs: CIBW_ARCHS: "${{ matrix.platform.arch }}" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" CIBW_BEFORE_BUILD_MACOS: "brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13" + CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" + CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" diff --git a/pyproject.toml b/pyproject.toml index be13308..a4f04c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,10 +40,3 @@ flake8-implicit-str-concat.allow-multiline=false [tool.pytest.ini_options] addopts = "--durations=10 -n auto" - -[tool.cibuildwheel] -skip = "cp36-* cp37-* cp-38* cp-39* cp-310* pp37-* pp38-* pp39-* pp310-* *-manylinux_i686 *_ppc64le *_s390x *_universal2" - -[tool.cibuildwheel.linux] -manylinux-x86_64-image = "manylinux_2_28" -manylinux-aarch64-image = "manylinux_2_28" From 1988025a91b676154ce1319ae1e67b4921612d9b Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 19 Jul 2024 17:33:26 -0700 Subject: [PATCH 39/49] test this --- .github/workflows/tests.yml | 55 +++++++++++++++++++++++------------ .github/workflows/wheels.yml | 1 + Dockerfile | 14 --------- requirements.txt | 56 ++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 32 deletions(-) delete mode 100644 Dockerfile create mode 100644 requirements.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bd12620..78697c4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,30 +3,49 @@ name: tests on: [push, pull_request] jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.11", "3.12"] + static_analysis: + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} - - name: Installing build dependencies - run: scripts/install_dependencies.sh - - name: Installing rednose - run: pip3 install --break-system-packages .[dev] - - name: Unit Tests - run: pytest + python-version: '3.11' + - name: Installing requirements + run: + python -m pip install -r requirements.txt + - name: Static analysis + run: pre-commit run --all - static_analysis: + smoke_test: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Installing python requirements + run: + python -m pip install -r requirements.txt + - name: Installing ubuntu requirements + run: + apt-get install -y --no-install-recommends clang libeigen3-dev + - name: Building + run: scons -j$(nproc) + + full_test: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - name: Installing build dependencies - run: scripts/install_dependencies.sh + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Installing python requirements + run: + python -m pip install -r requirements.txt + - name: Installing ubuntu requirements + run: + apt-get install -y --no-install-recommends clang libeigen3-dev - name: Installing rednose - run: pip3 install --break-system-packages .[dev] - - name: Static analysis - run: pre-commit run --all + run: pip install -e . + - name: Running all tests + run: pytest diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index aff93ee..057599c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -31,3 +31,4 @@ jobs: CIBW_BEFORE_BUILD_MACOS: "brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13" CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" + CIBW_TEST_COMMAND: pytest {package} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 57bd4c1..0000000 --- a/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM ubuntu:24.04 - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y capnproto libcapnp-dev clang wget git autoconf libtool curl make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl libeigen3-dev python3-pip python3-dev - -WORKDIR /project - -ENV PYTHONPATH=/project - -COPY . . -RUN rm -rf .git -RUN pip3 install --break-system-packages --no-cache-dir -r requirements.txt -RUN python3 setup.py install -RUN scons -c && scons -j$(nproc) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f82c232 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,56 @@ +# This file was autogenerated by uv via the following command: +# uv pip compile --all-extras -o requirements.txt pyproject.toml +cffi==1.16.0 + # via rednose (pyproject.toml) +cfgv==3.4.0 + # via pre-commit +cython==3.0.10 + # via rednose (pyproject.toml) +distlib==0.3.8 + # via virtualenv +execnet==2.1.1 + # via pytest-xdist +filelock==3.15.4 + # via virtualenv +identify==2.6.0 + # via pre-commit +iniconfig==2.0.0 + # via pytest +mpmath==1.3.0 + # via sympy +nodeenv==1.9.1 + # via pre-commit +numpy==1.26.4 + # via + # rednose (pyproject.toml) + # scipy +packaging==24.1 + # via pytest +platformdirs==4.2.2 + # via virtualenv +pluggy==1.5.0 + # via pytest +pre-commit==3.7.1 + # via rednose (pyproject.toml) +pycparser==2.22 + # via cffi +pytest==8.2.2 + # via + # rednose (pyproject.toml) + # pytest-xdist +pytest-xdist==3.6.1 + # via rednose (pyproject.toml) +pyyaml==6.0.1 + # via pre-commit +ruff==0.5.3 + # via rednose (pyproject.toml) +scipy==1.14.0 + # via rednose (pyproject.toml) +scons==4.8.0 + # via rednose (pyproject.toml) +sympy==1.13.1 + # via rednose (pyproject.toml) +tqdm==4.66.4 + # via rednose (pyproject.toml) +virtualenv==20.26.3 + # via pre-commit From 376c1d3de2ae43a4bc12f4df8d27cfcc699e2e98 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 19 Jul 2024 17:34:50 -0700 Subject: [PATCH 40/49] sudo --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 78697c4..448c352 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,7 +28,7 @@ jobs: python -m pip install -r requirements.txt - name: Installing ubuntu requirements run: - apt-get install -y --no-install-recommends clang libeigen3-dev + sudo apt-get install -y --no-install-recommends clang libeigen3-dev - name: Building run: scons -j$(nproc) @@ -44,7 +44,7 @@ jobs: python -m pip install -r requirements.txt - name: Installing ubuntu requirements run: - apt-get install -y --no-install-recommends clang libeigen3-dev + sudo apt-get install -y --no-install-recommends clang libeigen3-dev - name: Installing rednose run: pip install -e . - name: Running all tests From 5598c22daf059f33cd9f3fa3ddb54f339d1a72b7 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 19 Jul 2024 17:40:55 -0700 Subject: [PATCH 41/49] fix --- .github/workflows/tests.yml | 5 +---- .github/workflows/wheels.yml | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 448c352..eda6312 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,13 +39,10 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.11' - - name: Installing python requirements - run: - python -m pip install -r requirements.txt - name: Installing ubuntu requirements run: sudo apt-get install -y --no-install-recommends clang libeigen3-dev - name: Installing rednose - run: pip install -e . + run: pip install -e .[dev] - name: Running all tests run: pytest diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 057599c..59b7095 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -31,4 +31,4 @@ jobs: CIBW_BEFORE_BUILD_MACOS: "brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13" CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" - CIBW_TEST_COMMAND: pytest {package} + CIBW_TEST_COMMAND: pip install -r {project}/requirements.txt && pytest {package} From 39327b7c3e6de6a5d98a914cedb94013743118fa Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 19 Jul 2024 18:51:00 -0700 Subject: [PATCH 42/49] macos --- .github/workflows/tests.yml | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eda6312..a0a7ba4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,32 +16,50 @@ jobs: - name: Static analysis run: pre-commit run --all - smoke_test: - runs-on: ubuntu-24.04 + scons_test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ["ubuntu-20.04", "ubuntu-24.04", "macos-14"] + python: ["3.11", "3.12"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: ${{ matrix.python }} - name: Installing python requirements run: python -m pip install -r requirements.txt - name: Installing ubuntu requirements + if: startsWith(${{ matrix.os }}, 'ubuntu') run: sudo apt-get install -y --no-install-recommends clang libeigen3-dev + - name: Installing macos requirements + if: startsWith(${{ matrix.os }}, 'macos') + run: + brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 - name: Building - run: scons -j$(nproc) + run: scons -j$(nproc || sysctl -n hw.logicalcpu) full_test: - runs-on: ubuntu-24.04 + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ["ubuntu-20.04", "ubuntu-24.04", "macos-14"] + python: ["3.11", "3.12"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: ${{ matrix.python }} - name: Installing ubuntu requirements + if: startsWith(${{ matrix.os }}, 'ubuntu') run: sudo apt-get install -y --no-install-recommends clang libeigen3-dev + - name: Installing macos requirements + if: startsWith(${{ matrix.os }}, 'macos') + run: + brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 - name: Installing rednose run: pip install -e .[dev] - name: Running all tests From a4bd7c07c72dd0b4e8c1bd82dd1899cb6cc0baf8 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 19 Jul 2024 18:55:56 -0700 Subject: [PATCH 43/49] try --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a0a7ba4..4e69558 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,11 +31,11 @@ jobs: run: python -m pip install -r requirements.txt - name: Installing ubuntu requirements - if: startsWith(${{ matrix.os }}, 'ubuntu') + if: ${{startsWith(matrix.os, 'ubuntu')}} run: sudo apt-get install -y --no-install-recommends clang libeigen3-dev - name: Installing macos requirements - if: startsWith(${{ matrix.os }}, 'macos') + if: ${{startsWith(matrix.os, 'macos')}} run: brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 - name: Building @@ -53,11 +53,11 @@ jobs: with: python-version: ${{ matrix.python }} - name: Installing ubuntu requirements - if: startsWith(${{ matrix.os }}, 'ubuntu') + if: ${{startsWith(matrix.os, 'ubuntu')}} run: sudo apt-get install -y --no-install-recommends clang libeigen3-dev - name: Installing macos requirements - if: startsWith(${{ matrix.os }}, 'macos') + if: ${{startsWith(matrix.os, 'macos')}} run: brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 - name: Installing rednose From b5f49d16b0cd3a59f89c35e0bb9831d24d807205 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 19 Jul 2024 19:00:02 -0700 Subject: [PATCH 44/49] fix --- pyproject.toml | 1 + requirements.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index a4f04c5..1337e81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ dependencies = [ "cffi", "scons", "Cython", + "setuptools", ] [project.optional-dependencies] diff --git a/requirements.txt b/requirements.txt index f82c232..d5a0215 100644 --- a/requirements.txt +++ b/requirements.txt @@ -48,6 +48,8 @@ scipy==1.14.0 # via rednose (pyproject.toml) scons==4.8.0 # via rednose (pyproject.toml) +setuptools==71.0.4 + # via rednose (pyproject.toml) sympy==1.13.1 # via rednose (pyproject.toml) tqdm==4.66.4 From c62a75a6b12651afda8bd79e50eebb074535f4cd Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 19 Jul 2024 19:42:49 -0700 Subject: [PATCH 45/49] cleanup --- .github/workflows/tests.yml | 8 ++++---- .github/workflows/wheels.yml | 19 ++++++++++++++++++- scripts/build_wheel.sh | 11 ----------- scripts/install_dependencies.sh | 19 ------------------- scripts/macos_dependencies.sh | 6 ++++++ scripts/ubuntu_dependencies.sh | 12 ++++++++++++ 6 files changed, 40 insertions(+), 35 deletions(-) delete mode 100755 scripts/build_wheel.sh delete mode 100755 scripts/install_dependencies.sh create mode 100755 scripts/macos_dependencies.sh create mode 100755 scripts/ubuntu_dependencies.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4e69558..5cb8306 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,11 +33,11 @@ jobs: - name: Installing ubuntu requirements if: ${{startsWith(matrix.os, 'ubuntu')}} run: - sudo apt-get install -y --no-install-recommends clang libeigen3-dev + scripts/ubuntu_dependencies.sh - name: Installing macos requirements if: ${{startsWith(matrix.os, 'macos')}} run: - brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 + scripts/macos_dependencies.sh - name: Building run: scons -j$(nproc || sysctl -n hw.logicalcpu) @@ -55,11 +55,11 @@ jobs: - name: Installing ubuntu requirements if: ${{startsWith(matrix.os, 'ubuntu')}} run: - sudo apt-get install -y --no-install-recommends clang libeigen3-dev + scripts/ubuntu_dependencies.sh - name: Installing macos requirements if: ${{startsWith(matrix.os, 'macos')}} run: - brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 + scripts/macos_dependencies.sh - name: Installing rednose run: pip install -e .[dev] - name: Running all tests diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 59b7095..a2ae3bb 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -28,7 +28,24 @@ jobs: CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}" CIBW_ARCHS: "${{ matrix.platform.arch }}" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" - CIBW_BEFORE_BUILD_MACOS: "brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13" + CIBW_BEFORE_BUILD_MACOS: {project}/scripts/macos_dependencies.sh CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" CIBW_TEST_COMMAND: pip install -r {project}/requirements.txt && pytest {package} + + + - uses: actions/setup-python@v5 + if: ${{ matrix.platform.arch }} != 'aarch64' + with: + python-version: ${{ matrix.python.py }} + + - name: Installing the wheel + if: ${{ matrix.platform.arch }} != 'aarch64' + run: | + pip install --break-system-packages ./wheelhouse/*.whl + + - name: Saving wheel + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.platform.target }}-${{ matrix.python.cp }} + path: ./wheelhouse/*.whl diff --git a/scripts/build_wheel.sh b/scripts/build_wheel.sh deleted file mode 100755 index b4d9394..0000000 --- a/scripts/build_wheel.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -cd $DIR/.. - -export CIBW_BUILD="cp312-manylinux_x86_64 cp311-manylinux_x86_64" -export CIBW_MANYLINUX_X86_64_IMAGE="quay.io/pypa/manylinux_2_28_x86_64" -export CIBW_BEFORE_ALL_LINUX="dnf install -y clang libffi-devel eigen3-devel" - -cibuildwheel diff --git a/scripts/install_dependencies.sh b/scripts/install_dependencies.sh deleted file mode 100755 index d7f109b..0000000 --- a/scripts/install_dependencies.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -cd $DIR - -SUDO="" - -# Use sudo if not root -if [[ ! $(id -u) -eq 0 ]]; then - if [[ -z $(which sudo) ]]; then - echo "Please install sudo or run as root" - exit 1 - fi - SUDO="sudo" -fi - -$SUDO apt-get update -$SUDO apt-get install -y --no-install-recommends python3 python3-pip clang libeigen3-dev diff --git a/scripts/macos_dependencies.sh b/scripts/macos_dependencies.sh new file mode 100755 index 0000000..10534fc --- /dev/null +++ b/scripts/macos_dependencies.sh @@ -0,0 +1,6 @@ +#!/bin/bash +brew bundle --file=- <<-EOS +brew "eigen" +cask "gcc-arm-embedded" +brew "gcc@13" +EOS diff --git a/scripts/ubuntu_dependencies.sh b/scripts/ubuntu_dependencies.sh new file mode 100755 index 0000000..652f236 --- /dev/null +++ b/scripts/ubuntu_dependencies.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +if [[ ! $(id -u) -eq 0 ]]; then + if [[ -z $(which sudo) ]]; then + echo "Please install sudo or run as root" + exit 1 + fi + SUDO="sudo" +fi + +$SUDO apt-get update +$SUDO apt-get install -y --no-install-recommends clang libeigen3-dev From 6e3b10c2a08a91aa793412816aa4325c3c05739a Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 19 Jul 2024 19:46:14 -0700 Subject: [PATCH 46/49] fix --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a2ae3bb..c43c7ec 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -28,7 +28,7 @@ jobs: CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}" CIBW_ARCHS: "${{ matrix.platform.arch }}" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" - CIBW_BEFORE_BUILD_MACOS: {project}/scripts/macos_dependencies.sh + CIBW_BEFORE_BUILD_MACOS: "bash {project}/scripts/macos_dependencies.sh" CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" CIBW_TEST_COMMAND: pip install -r {project}/requirements.txt && pytest {package} From dde0fcbfaf4ffe78a7989a84a82b51d8bc92eebe Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 19 Jul 2024 22:37:02 -0700 Subject: [PATCH 47/49] fix install --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index c43c7ec..24e2b98 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -35,7 +35,7 @@ jobs: - uses: actions/setup-python@v5 - if: ${{ matrix.platform.arch }} != 'aarch64' + if: ${{ matrix.platform.arch != 'aarch64' }} with: python-version: ${{ matrix.python.py }} From 2401657cd7a36f0c1b8ebd231a4d66f92c2ff693 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 19 Jul 2024 22:45:33 -0700 Subject: [PATCH 48/49] last one --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 24e2b98..b4db7b7 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -40,7 +40,7 @@ jobs: python-version: ${{ matrix.python.py }} - name: Installing the wheel - if: ${{ matrix.platform.arch }} != 'aarch64' + if: ${{ matrix.platform.arch != 'aarch64' }} run: | pip install --break-system-packages ./wheelhouse/*.whl From b9555c01aa678103c099f859b9f9f1ce600eba7f Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Mon, 22 Jul 2024 13:32:15 -0700 Subject: [PATCH 49/49] remove this --- README.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/README.md b/README.md index f00702d..264958b 100644 --- a/README.md +++ b/README.md @@ -49,17 +49,3 @@ A lot of measurements do not come from a Gaussian distribution and as such have of the Kalman filter. This can cause a lot of performance issues if not dealt with. This library allows the use of a mahalanobis distance statistical test on the incoming measurements to deal with this. Note that good initialization is critical to prevent good measurements from being rejected. - -### Building -On ubuntu: -``` bash -scripts/install_dependencies.sh -pip install . -``` -or run some test: -On ubuntu: -``` bash -scripts/install_dependencies.sh -pip install .[dev] -pytest -```