From 95f222f332d91eaf293d6b8d1fbce7afa2f3dcda Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 13:01:58 -0600 Subject: [PATCH 01/31] updated action versions; clearer install errors; back to uploading wheels --- .github/workflows/cpp_tests.yml | 2 +- .github/workflows/docs.yml | 4 +- .github/workflows/joss.yml | 2 +- .github/workflows/pypi.yml | 77 +++++++++++++++++++----------- .github/workflows/python_tests.yml | 4 +- build_python.sh | 19 ++++++++ grss/version.txt | 2 +- pyproject.toml | 2 +- setup.py | 5 ++ 9 files changed, 82 insertions(+), 35 deletions(-) diff --git a/.github/workflows/cpp_tests.yml b/.github/workflows/cpp_tests.yml index 16034013..ccbf21a7 100644 --- a/.github/workflows/cpp_tests.yml +++ b/.github/workflows/cpp_tests.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build GRSS library run: | source initialize.sh --tm-overwrite diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 499dedb6..37163390 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Install GRSS (including dependencies) diff --git a/.github/workflows/joss.yml b/.github/workflows/joss.yml index 6161d8fd..7d68700e 100644 --- a/.github/workflows/joss.yml +++ b/.github/workflows/joss.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build draft PDF uses: openjournals/openjournals-draft-action@master with: diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index bd8f21a6..fd77af39 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -12,30 +12,53 @@ permissions: id-token: write jobs: - build-and-upload: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - name: Initialize repository - run: | - source initialize.sh --no-tm-overwrite - - name: Run build script - run: source build_python.sh - - name: Show files - run: ls -l dist - - name: Publish to Test PyPI - if: github.ref == 'refs/heads/dev' - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository-url: https://test.pypi.org/legacy/ - - name: Publish to PyPI - if: github.ref == 'refs/heads/main' - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} + build: + name: build ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.8" + - name: Initialize repository + run: | + source initialize.sh --no-tm-overwrite + - name: Build python distributions + run: source build_python.sh + - name: Upload distribution for next job + uses: actions/upload-artifact@master + with: + name: dist-${{ matrix.os }} + path: dist + publish: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download Ubuntu distribution from previous job + uses: actions/download-artifact@master + with: + name: dist-ubuntu-latest + path: dist + - name: Download MacOS distribution from previous job + uses: actions/download-artifact@master + with: + name: dist-macos-latest + path: dist + - name: Show files + run: ls -l dist + - name: Publish to Test PyPI + if: github.ref == 'refs/heads/dev' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository-url: https://test.pypi.org/legacy/ + - name: Publish to PyPI + if: github.ref == 'refs/heads/main' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 5e8b762b..646e4eed 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -10,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Install GRSS (including dependencies) diff --git a/build_python.sh b/build_python.sh index b556da21..6c65cf97 100755 --- a/build_python.sh +++ b/build_python.sh @@ -4,6 +4,25 @@ rm -rf build dist grss.egg-info python3 -m pip install --upgrade pip python3 -m pip install --upgrade build twine cibuildwheel +unameOut="$(uname -s)" +case "${unameOut}" in + Linux*) machine=Linux;; + Darwin*) machine=Mac;; + CYGWIN*) machine=Cygwin;; + MINGW*) machine=MinGw;; + MSYS_NT*) machine=Git;; + *) machine="UNKNOWN:${unameOut}" +esac + +if [ $machine = "Mac" ]; then + # force download arm64 version of cspice + export ARCHFLAGS="-arch arm64" + cd ./extern + python3 get_cspice.py + cd .. +fi + python3 -m build --sdist --outdir dist +python3 -m cibuildwheel --output-dir dist twine check dist/* diff --git a/grss/version.txt b/grss/version.txt index a0cd9f0c..50e47c89 100644 --- a/grss/version.txt +++ b/grss/version.txt @@ -1 +1 @@ -3.1.0 \ No newline at end of file +3.1.1 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index feb11db0..0d2b6b6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,7 @@ package-data = {"grss" = [ dependencies = {file = ["requirements.txt"]} [tool.cibuildwheel.macos] -archs = ["x86_64", "arm64"] +archs = ["arm64"] [tool.cibuildwheel.linux] archs = ["x86_64"] diff --git a/setup.py b/setup.py index 789dc4a2..918c4f81 100644 --- a/setup.py +++ b/setup.py @@ -35,6 +35,11 @@ class CMakeBuild(build_ext): def build_extension(self, ext: CMakeExtension) -> None: subprocess.run(["./build_cpp.sh"], cwd=ext.sourcedir, check=True) + binary_created = [f for f in os.listdir(f"{ext.sourcedir}/build/") + if f.startswith("prop_simulation")] + if not binary_created: + raise FileNotFoundError("prop_simulation binary for C++ source code not found " + "in cmake build directory") os.system(f"cp {ext.sourcedir}/build/prop_simulation* {self.build_lib}/grss/prop/") return From 09b6a722886c72be39e227b96fae8a3530648ae9 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 13:18:00 -0600 Subject: [PATCH 02/31] back to uploading wheels part 2 --- .github/workflows/pypi.yml | 1 + MANIFEST.in | 1 - grss/version.txt | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index fd77af39..bbbb1262 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -28,6 +28,7 @@ jobs: - name: Initialize repository run: | source initialize.sh --no-tm-overwrite + conda install pybind11 -c conda-forge - name: Build python distributions run: source build_python.sh - name: Upload distribution for next job diff --git a/MANIFEST.in b/MANIFEST.in index 1e3ca676..ac0c0820 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,7 +3,6 @@ include src/*.cpp include src/CMakeLists.txt include extern/get_cspice.py -recursive-include extern/pybind11 * recursive-include tests * include CMakeLists.txt diff --git a/grss/version.txt b/grss/version.txt index 50e47c89..6ebad148 100644 --- a/grss/version.txt +++ b/grss/version.txt @@ -1 +1 @@ -3.1.1 \ No newline at end of file +3.1.2 \ No newline at end of file From 7f1a80994f039df16dfbf0d7c08c35877b556792 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 13:31:24 -0600 Subject: [PATCH 03/31] back to uploading wheels part 3 --- .github/workflows/pypi.yml | 1 - build_python.sh | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index bbbb1262..fd77af39 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -28,7 +28,6 @@ jobs: - name: Initialize repository run: | source initialize.sh --no-tm-overwrite - conda install pybind11 -c conda-forge - name: Build python distributions run: source build_python.sh - name: Upload distribution for next job diff --git a/build_python.sh b/build_python.sh index 6c65cf97..52f20525 100755 --- a/build_python.sh +++ b/build_python.sh @@ -23,6 +23,7 @@ if [ $machine = "Mac" ]; then fi python3 -m build --sdist --outdir dist +pybind11_DIR=$(pybind11-config --cmakedir) python3 -m cibuildwheel --output-dir dist twine check dist/* From 3cad3e003c06aff7f4a850cee7c84a2bb9655bc3 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 13:36:46 -0600 Subject: [PATCH 04/31] refined github action triggers (except pypi since that needs testing) --- .github/workflows/cpp_tests.yml | 4 ++++ .github/workflows/docs.yml | 6 ++++++ .github/workflows/joss.yml | 2 ++ .github/workflows/pypi.yml | 4 ++-- .github/workflows/python_tests.yml | 5 +++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp_tests.yml b/.github/workflows/cpp_tests.yml index ccbf21a7..64ff9786 100644 --- a/.github/workflows/cpp_tests.yml +++ b/.github/workflows/cpp_tests.yml @@ -4,6 +4,10 @@ on: branches: - main - dev + paths: + - 'include/**' + - 'src/**' + - 'tests/cpp/**' jobs: prop-only: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 37163390..7649cb29 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,6 +4,12 @@ on: branches: - main - dev + paths: + - 'include/**' + - 'src/**' + - 'grss/**' + - 'tests/python/**' + jobs: sphinx: diff --git a/.github/workflows/joss.yml b/.github/workflows/joss.yml index 7d68700e..fe48cfdd 100644 --- a/.github/workflows/joss.yml +++ b/.github/workflows/joss.yml @@ -4,6 +4,8 @@ on: branches: - main - dev + paths: + - 'joss/**' jobs: paper: diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index fd77af39..1bda8448 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -5,8 +5,8 @@ on: branches: - main - dev - paths: - - "grss/version.txt" + # paths: + # - "grss/version.txt" permissions: id-token: write diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 646e4eed..e5ecd8e2 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -4,6 +4,11 @@ on: branches: - main - dev + paths: + - 'include/**' + - 'src/**' + - 'grss/**' + - 'tests/python/**' jobs: prop-and-fit: From f6756887dafa0a6b0a690ccb163010c3630bda8b Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 13:48:13 -0600 Subject: [PATCH 05/31] back to uploading wheels part 4 --- build_python.sh | 1 - pyproject.toml | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build_python.sh b/build_python.sh index 52f20525..6c65cf97 100755 --- a/build_python.sh +++ b/build_python.sh @@ -23,7 +23,6 @@ if [ $machine = "Mac" ]; then fi python3 -m build --sdist --outdir dist -pybind11_DIR=$(pybind11-config --cmakedir) python3 -m cibuildwheel --output-dir dist twine check dist/* diff --git a/pyproject.toml b/pyproject.toml index 0d2b6b6a..ff2edf58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,6 +60,9 @@ package-data = {"grss" = [ [tool.setuptools.dynamic] dependencies = {file = ["requirements.txt"]} +[tool.cibuildwheel] +before-build = "pip install pybind11 && pybind11_DIR=$(pybind11-config --cmakedir)" + [tool.cibuildwheel.macos] archs = ["arm64"] From 7b69fec92bd22bb8c89b1552528662edadd5f169 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 13:56:41 -0600 Subject: [PATCH 06/31] back to uploading wheels part 5 --- pyproject.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ff2edf58..389d1ea9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,12 @@ package-data = {"grss" = [ dependencies = {file = ["requirements.txt"]} [tool.cibuildwheel] -before-build = "pip install pybind11 && pybind11_DIR=$(pybind11-config --cmakedir)" +before-build = [ + "pip install pybind11", + "pybind11_DIR=$(pybind11-config --cmakedir)", + "export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$pybind11_DIR", + "echo $pybind11_DIR" +] [tool.cibuildwheel.macos] archs = ["arm64"] From c4094b2ab645a01f6d83abee301dc15e89cef866 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 14:00:50 -0600 Subject: [PATCH 07/31] back to uploading wheels part 6 --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 389d1ea9..07b3c259 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,8 @@ before-build = [ "pip install pybind11", "pybind11_DIR=$(pybind11-config --cmakedir)", "export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$pybind11_DIR", - "echo $pybind11_DIR" + "export CMAKE_MODULE_PATH=$CMAKE_MODULE_PATH:$pybind11_DIR", + "ls -l $pybind11_DIR" ] [tool.cibuildwheel.macos] From 335da290afdcecc2a6df0cac0e373b92d64979da Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 14:08:53 -0600 Subject: [PATCH 08/31] back to uploading wheels part 7 --- pyproject.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 07b3c259..646bd9c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,10 +62,8 @@ dependencies = {file = ["requirements.txt"]} [tool.cibuildwheel] before-build = [ - "pip install pybind11", + "conda install pybind11 -c conda-forge", "pybind11_DIR=$(pybind11-config --cmakedir)", - "export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$pybind11_DIR", - "export CMAKE_MODULE_PATH=$CMAKE_MODULE_PATH:$pybind11_DIR", "ls -l $pybind11_DIR" ] From 637c532e94f02e46eefc0c5cd47e30569719cbb6 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 14:12:26 -0600 Subject: [PATCH 09/31] back to uploading wheels part 8 --- build_python.sh | 21 +-------------------- pyproject.toml | 6 ++++-- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/build_python.sh b/build_python.sh index 6c65cf97..9b3b3dbb 100755 --- a/build_python.sh +++ b/build_python.sh @@ -1,26 +1,7 @@ #!/bin/bash rm -rf build dist grss.egg-info -python3 -m pip install --upgrade pip -python3 -m pip install --upgrade build twine cibuildwheel - -unameOut="$(uname -s)" -case "${unameOut}" in - Linux*) machine=Linux;; - Darwin*) machine=Mac;; - CYGWIN*) machine=Cygwin;; - MINGW*) machine=MinGw;; - MSYS_NT*) machine=Git;; - *) machine="UNKNOWN:${unameOut}" -esac - -if [ $machine = "Mac" ]; then - # force download arm64 version of cspice - export ARCHFLAGS="-arch arm64" - cd ./extern - python3 get_cspice.py - cd .. -fi +python3 -m pip install --upgrade pip build twine cibuildwheel python3 -m build --sdist --outdir dist python3 -m cibuildwheel --output-dir dist diff --git a/pyproject.toml b/pyproject.toml index 646bd9c6..898362e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,9 +62,11 @@ dependencies = {file = ["requirements.txt"]} [tool.cibuildwheel] before-build = [ - "conda install pybind11 -c conda-forge", + "pip install pybind11", "pybind11_DIR=$(pybind11-config --cmakedir)", - "ls -l $pybind11_DIR" + "ls -l $pybind11_DIR", + "cp $pybind11_DIR/pybind11Config.cmake .", + "ls -l", ] [tool.cibuildwheel.macos] From b771d0dd140e16966f2c58a58ddcd9eae0492189 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 14:16:40 -0600 Subject: [PATCH 10/31] back to uploading wheels part 9 --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 898362e0..a8184c10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,9 +64,8 @@ dependencies = {file = ["requirements.txt"]} before-build = [ "pip install pybind11", "pybind11_DIR=$(pybind11-config --cmakedir)", + "cmake -Dpybind11_DIR=$pybind11_DIR", "ls -l $pybind11_DIR", - "cp $pybind11_DIR/pybind11Config.cmake .", - "ls -l", ] [tool.cibuildwheel.macos] From ba2661615cdb8bde055b351eed6786717af7c8b6 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 14:31:04 -0600 Subject: [PATCH 11/31] back to uploading wheels part 10 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a8184c10..3ef4c302 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,10 +62,10 @@ dependencies = {file = ["requirements.txt"]} [tool.cibuildwheel] before-build = [ - "pip install pybind11", "pybind11_DIR=$(pybind11-config --cmakedir)", "cmake -Dpybind11_DIR=$pybind11_DIR", - "ls -l $pybind11_DIR", + "pwd", + "ls -la", ] [tool.cibuildwheel.macos] From f2e34baf3faa503164cb1da95854f9c91bd04a08 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 14:33:15 -0600 Subject: [PATCH 12/31] back to uploading wheels part 11 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 3ef4c302..dd39df2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,6 +62,7 @@ dependencies = {file = ["requirements.txt"]} [tool.cibuildwheel] before-build = [ + "pip install pybind11", "pybind11_DIR=$(pybind11-config --cmakedir)", "cmake -Dpybind11_DIR=$pybind11_DIR", "pwd", From 6cb99afb9ed3b168b28eeffc15a3b3405cf865b0 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 14:39:28 -0600 Subject: [PATCH 13/31] back to uploading wheels part 12 --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index dd39df2d..be346db9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,9 +63,10 @@ dependencies = {file = ["requirements.txt"]} [tool.cibuildwheel] before-build = [ "pip install pybind11", + "mkdir build", + "cmake -B./build -S.", "pybind11_DIR=$(pybind11-config --cmakedir)", "cmake -Dpybind11_DIR=$pybind11_DIR", - "pwd", "ls -la", ] From e6b775927c8eef023b4a843ffbc414b37ef8d6d0 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 14:42:37 -0600 Subject: [PATCH 14/31] back to uploading wheels part 13 --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index be346db9..2af80bad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,9 +64,8 @@ dependencies = {file = ["requirements.txt"]} before-build = [ "pip install pybind11", "mkdir build", - "cmake -B./build -S.", "pybind11_DIR=$(pybind11-config --cmakedir)", - "cmake -Dpybind11_DIR=$pybind11_DIR", + "cmake -Dpybind11_DIR=$pybind11_DIR -B./build -S.", "ls -la", ] From 07ea56a3d41ae2c1ebcf64cb9603bebfdaa556aa Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 14:49:38 -0600 Subject: [PATCH 15/31] back to uploading wheels part 14 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2af80bad..cc41d960 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,10 +63,10 @@ dependencies = {file = ["requirements.txt"]} [tool.cibuildwheel] before-build = [ "pip install pybind11", + "rm -rf build", "mkdir build", "pybind11_DIR=$(pybind11-config --cmakedir)", "cmake -Dpybind11_DIR=$pybind11_DIR -B./build -S.", - "ls -la", ] [tool.cibuildwheel.macos] From 21bc5375415ed96959bc6db84e2c6afb5df8c83a Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 15:00:47 -0600 Subject: [PATCH 16/31] back to uploading wheels part 15 --- build_python.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/build_python.sh b/build_python.sh index 9b3b3dbb..92fd3b2c 100755 --- a/build_python.sh +++ b/build_python.sh @@ -3,6 +3,24 @@ rm -rf build dist grss.egg-info python3 -m pip install --upgrade pip build twine cibuildwheel +unameOut="$(uname -s)" +case "${unameOut}" in + Linux*) machine=Linux;; + Darwin*) machine=Mac;; + CYGWIN*) machine=Cygwin;; + MINGW*) machine=MinGw;; + MSYS_NT*) machine=Git;; + *) machine="UNKNOWN:${unameOut}" +esac + +if [ $machine = "Mac" ]; then + # force download arm64 version of cspice + export ARCHFLAGS="-arch arm64" + cd ./extern + python3 get_cspice.py + cd .. +fi + python3 -m build --sdist --outdir dist python3 -m cibuildwheel --output-dir dist From 8224540a65088586e453a07aa7772582396d96e7 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 15:21:49 -0600 Subject: [PATCH 17/31] back to uploading wheels part 16 --- CMakeLists.txt | 1 + build_python.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c24610f7..4dbd2ee5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ cmake_minimum_required(VERSION 3.18.0) if(APPLE) set(CMAKE_C_COMPILER gcc-13) set(CMAKE_CXX_COMPILER g++-13) + set(CMAKE_OSX_ARCHITECTURES "arm64") endif() # set the project name and get version from version.txt diff --git a/build_python.sh b/build_python.sh index 92fd3b2c..56fa3eed 100755 --- a/build_python.sh +++ b/build_python.sh @@ -21,7 +21,9 @@ if [ $machine = "Mac" ]; then cd .. fi -python3 -m build --sdist --outdir dist +if [ $machine = "Linux" ]; then + python3 -m build --sdist --outdir dist +fi python3 -m cibuildwheel --output-dir dist twine check dist/* From 3dcdf26e66dbb2453f56b5c77026ace38014f299 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 15:35:04 -0600 Subject: [PATCH 18/31] back to uploading wheels part 17 --- .github/workflows/pypi.yml | 4 ++-- build_python.sh | 22 +--------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 1bda8448..8e9a01a8 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -17,7 +17,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-14] steps: - name: Checkout repo uses: actions/checkout@v4 @@ -47,7 +47,7 @@ jobs: - name: Download MacOS distribution from previous job uses: actions/download-artifact@master with: - name: dist-macos-latest + name: dist-macos-14 path: dist - name: Show files run: ls -l dist diff --git a/build_python.sh b/build_python.sh index 56fa3eed..9b3b3dbb 100755 --- a/build_python.sh +++ b/build_python.sh @@ -3,27 +3,7 @@ rm -rf build dist grss.egg-info python3 -m pip install --upgrade pip build twine cibuildwheel -unameOut="$(uname -s)" -case "${unameOut}" in - Linux*) machine=Linux;; - Darwin*) machine=Mac;; - CYGWIN*) machine=Cygwin;; - MINGW*) machine=MinGw;; - MSYS_NT*) machine=Git;; - *) machine="UNKNOWN:${unameOut}" -esac - -if [ $machine = "Mac" ]; then - # force download arm64 version of cspice - export ARCHFLAGS="-arch arm64" - cd ./extern - python3 get_cspice.py - cd .. -fi - -if [ $machine = "Linux" ]; then - python3 -m build --sdist --outdir dist -fi +python3 -m build --sdist --outdir dist python3 -m cibuildwheel --output-dir dist twine check dist/* From eb08f94d4b8834ba780441c4f50871dd2596f635 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 15:40:24 -0600 Subject: [PATCH 19/31] back to uploading wheels part 18 --- .github/workflows/pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 8e9a01a8..5c8c9e01 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -24,7 +24,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" - name: Initialize repository run: | source initialize.sh --no-tm-overwrite From 02830e6d7685455c555d5eb24b4c62e975c07f26 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 15:51:28 -0600 Subject: [PATCH 20/31] back to uploading wheels part 19 --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4dbd2ee5..34f61f27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,6 @@ cmake_minimum_required(VERSION 3.18.0) if(APPLE) set(CMAKE_C_COMPILER gcc-13) set(CMAKE_CXX_COMPILER g++-13) - set(CMAKE_OSX_ARCHITECTURES "arm64") endif() # set the project name and get version from version.txt @@ -19,6 +18,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) add_compile_options(-std=c++11 -O3 -fPIC -fopenmp) # operational flags # add_compile_options(-std=c++11 -DLONGDOUBLE -g3 -fPIC -fopenmp -Werror -Wall -Wextra -pedantic -Wno-unused-but-set-variable -Wno-unused-result) # debugging flags +# if clang, add -Wl, -ld_classic flags +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_compile_options(-Wl -ld_classic) +endif() + # Set header file directories include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_SOURCE_DIR}/extern/cspice/include) From 8e7886fda73c4b6d64a273121a7911dc43768b81 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 15:59:53 -0600 Subject: [PATCH 21/31] back to uploading wheels part 20 --- CMakeLists.txt | 5 ----- pyproject.toml | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34f61f27..c24610f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,11 +18,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) add_compile_options(-std=c++11 -O3 -fPIC -fopenmp) # operational flags # add_compile_options(-std=c++11 -DLONGDOUBLE -g3 -fPIC -fopenmp -Werror -Wall -Wextra -pedantic -Wno-unused-but-set-variable -Wno-unused-result) # debugging flags -# if clang, add -Wl, -ld_classic flags -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - add_compile_options(-Wl -ld_classic) -endif() - # Set header file directories include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_SOURCE_DIR}/extern/cspice/include) diff --git a/pyproject.toml b/pyproject.toml index cc41d960..53dc8a06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,6 +68,7 @@ before-build = [ "pybind11_DIR=$(pybind11-config --cmakedir)", "cmake -Dpybind11_DIR=$pybind11_DIR -B./build -S.", ] +skip = "cp38-macosx_arm64" [tool.cibuildwheel.macos] archs = ["arm64"] From 4637d89c3fdc410411f6e557b4895378752f8354 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 16:05:55 -0600 Subject: [PATCH 22/31] back to uploading wheels part 21 --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 53dc8a06..6018378a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,10 +68,12 @@ before-build = [ "pybind11_DIR=$(pybind11-config --cmakedir)", "cmake -Dpybind11_DIR=$pybind11_DIR -B./build -S.", ] -skip = "cp38-macosx_arm64" [tool.cibuildwheel.macos] archs = ["arm64"] +before-build = [ + "brew reinstall -sv gcc" +] + tool.cibuildwheel.before-build [tool.cibuildwheel.linux] archs = ["x86_64"] From 332e47869a365dc9b6fac759c71a448d62e75182 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 16:09:15 -0600 Subject: [PATCH 23/31] back to uploading wheels part 22 --- pyproject.toml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6018378a..6f96fcc7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,8 +60,10 @@ package-data = {"grss" = [ [tool.setuptools.dynamic] dependencies = {file = ["requirements.txt"]} -[tool.cibuildwheel] +[tool.cibuildwheel.macos] +archs = ["arm64"] before-build = [ + "brew reinstall -sv gcc", "pip install pybind11", "rm -rf build", "mkdir build", @@ -69,11 +71,12 @@ before-build = [ "cmake -Dpybind11_DIR=$pybind11_DIR -B./build -S.", ] -[tool.cibuildwheel.macos] -archs = ["arm64"] -before-build = [ - "brew reinstall -sv gcc" -] + tool.cibuildwheel.before-build - [tool.cibuildwheel.linux] archs = ["x86_64"] +before-build = [ + "pip install pybind11", + "rm -rf build", + "mkdir build", + "pybind11_DIR=$(pybind11-config --cmakedir)", + "cmake -Dpybind11_DIR=$pybind11_DIR -B./build -S.", +] From 7af9cee2e520934b7e58f845b680862e05273e9d Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 16:23:22 -0600 Subject: [PATCH 24/31] back to uploading wheels part 23 --- CMakeLists.txt | 1 + pyproject.toml | 14 ++++---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c24610f7..b1d3b69f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ cmake_minimum_required(VERSION 3.18.0) if(APPLE) set(CMAKE_C_COMPILER gcc-13) set(CMAKE_CXX_COMPILER g++-13) + add_compile_options(-largs -Wl, -ld_classic) endif() # set the project name and get version from version.txt diff --git a/pyproject.toml b/pyproject.toml index 6f96fcc7..cc41d960 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,10 +60,8 @@ package-data = {"grss" = [ [tool.setuptools.dynamic] dependencies = {file = ["requirements.txt"]} -[tool.cibuildwheel.macos] -archs = ["arm64"] +[tool.cibuildwheel] before-build = [ - "brew reinstall -sv gcc", "pip install pybind11", "rm -rf build", "mkdir build", @@ -71,12 +69,8 @@ before-build = [ "cmake -Dpybind11_DIR=$pybind11_DIR -B./build -S.", ] +[tool.cibuildwheel.macos] +archs = ["arm64"] + [tool.cibuildwheel.linux] archs = ["x86_64"] -before-build = [ - "pip install pybind11", - "rm -rf build", - "mkdir build", - "pybind11_DIR=$(pybind11-config --cmakedir)", - "cmake -Dpybind11_DIR=$pybind11_DIR -B./build -S.", -] From e84e0fdeaec5cd4d0351b329b82d18fb58ee2e17 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 16:45:27 -0600 Subject: [PATCH 25/31] back to uploading wheels part 24 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1d3b69f..f6717a7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.18.0) if(APPLE) set(CMAKE_C_COMPILER gcc-13) set(CMAKE_CXX_COMPILER g++-13) - add_compile_options(-largs -Wl, -ld_classic) + add_compile_options(-Wl, -ld_classic, -ld64) endif() # set the project name and get version from version.txt @@ -17,7 +17,7 @@ project(grss VERSION ${ver}) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED True) add_compile_options(-std=c++11 -O3 -fPIC -fopenmp) # operational flags -# add_compile_options(-std=c++11 -DLONGDOUBLE -g3 -fPIC -fopenmp -Werror -Wall -Wextra -pedantic -Wno-unused-but-set-variable -Wno-unused-result) # debugging flags +# add_compile_options(-std=c++11 -DLONGDOUBLE -g3 -fPIC -fopenmp -Werror -Wall -Wextra -pedantic) # debugging flags # Set header file directories include_directories(${CMAKE_SOURCE_DIR}/include) From c8a9015a22974b01da151cb3bb7a278710ad1113 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 21:04:42 -0600 Subject: [PATCH 26/31] back to uploading wheels part 25 --- .github/workflows/pypi.yml | 5 +++++ CMakeLists.txt | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 5c8c9e01..2c97f6bd 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -25,6 +25,11 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.10" + - name: Set up Xcode + if: matrix.os == 'macos-14' + uses: maxim-lobanov/setup-xcode@v1.6.0 + with: + xcode-version: '15.1.0' - name: Initialize repository run: | source initialize.sh --no-tm-overwrite diff --git a/CMakeLists.txt b/CMakeLists.txt index f6717a7e..f871713c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,6 @@ cmake_minimum_required(VERSION 3.18.0) if(APPLE) set(CMAKE_C_COMPILER gcc-13) set(CMAKE_CXX_COMPILER g++-13) - add_compile_options(-Wl, -ld_classic, -ld64) endif() # set the project name and get version from version.txt From ec8cd77034e3f2275c8b32b4f6e6131fa7b0be08 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 21:58:49 -0600 Subject: [PATCH 27/31] final update to workflows for today (hopefully a while) --- .github/workflows/docs.yml | 6 ------ .github/workflows/pypi.yml | 4 ++-- .github/workflows/python_tests.yml | 5 ----- CMakeLists.txt | 4 ++++ grss/version.txt | 2 +- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7649cb29..37163390 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,12 +4,6 @@ on: branches: - main - dev - paths: - - 'include/**' - - 'src/**' - - 'grss/**' - - 'tests/python/**' - jobs: sphinx: diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 2c97f6bd..13600019 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -5,8 +5,8 @@ on: branches: - main - dev - # paths: - # - "grss/version.txt" + paths: + - "grss/version.txt" permissions: id-token: write diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index e5ecd8e2..646e4eed 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -4,11 +4,6 @@ on: branches: - main - dev - paths: - - 'include/**' - - 'src/**' - - 'grss/**' - - 'tests/python/**' jobs: prop-and-fit: diff --git a/CMakeLists.txt b/CMakeLists.txt index f871713c..281944da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,10 @@ set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) include(CPack) # create pybind11 module +find_package(PythonInterp 3.8 REQUIRED) +find_package(PythonLibs 3.8 REQUIRED) +find_package(PythonInterp 3.10) +find_package(PythonLibs 3.10) find_package(pybind11 REQUIRED) pybind11_add_module(prop_simulation src/${PROJECT_NAME}.cpp) target_link_libraries(prop_simulation PRIVATE ${PROJECT_NAME}) diff --git a/grss/version.txt b/grss/version.txt index 6ebad148..711ee4f5 100644 --- a/grss/version.txt +++ b/grss/version.txt @@ -1 +1 @@ -3.1.2 \ No newline at end of file +3.1.3 \ No newline at end of file From 261396ac3b72202017f29bf5ea03804fa04a911c Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 22:03:27 -0600 Subject: [PATCH 28/31] committed too soon :( --- .github/workflows/pypi.yml | 4 ++-- CMakeLists.txt | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 13600019..2c97f6bd 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -5,8 +5,8 @@ on: branches: - main - dev - paths: - - "grss/version.txt" + # paths: + # - "grss/version.txt" permissions: id-token: write diff --git a/CMakeLists.txt b/CMakeLists.txt index 281944da..af56d871 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,10 +31,7 @@ set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) include(CPack) # create pybind11 module -find_package(PythonInterp 3.8 REQUIRED) -find_package(PythonLibs 3.8 REQUIRED) -find_package(PythonInterp 3.10) -find_package(PythonLibs 3.10) +find_package(Python3 REQUIRED COMPONENTS Interpreter Development) find_package(pybind11 REQUIRED) pybind11_add_module(prop_simulation src/${PROJECT_NAME}.cpp) target_link_libraries(prop_simulation PRIVATE ${PROJECT_NAME}) From db32c5140dba2a34ef863a8173447852fc9b9fe9 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 22:09:46 -0600 Subject: [PATCH 29/31] come on... --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af56d871..9a98d2a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) include(CPack) # create pybind11 module -find_package(Python3 REQUIRED COMPONENTS Interpreter Development) +find_package(Python3 COMPONENTS Interpreter Development REQUIRED) find_package(pybind11 REQUIRED) pybind11_add_module(prop_simulation src/${PROJECT_NAME}.cpp) target_link_libraries(prop_simulation PRIVATE ${PROJECT_NAME}) From 3a0f00390d660bcf9f68bbbd78bc7f9576b06f07 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 22:28:37 -0600 Subject: [PATCH 30/31] i'm done with this for now --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a98d2a7..f871713c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,6 @@ set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) include(CPack) # create pybind11 module -find_package(Python3 COMPONENTS Interpreter Development REQUIRED) find_package(pybind11 REQUIRED) pybind11_add_module(prop_simulation src/${PROJECT_NAME}.cpp) target_link_libraries(prop_simulation PRIVATE ${PROJECT_NAME}) From c3bcc3797ea007b7c12c44a1a1fc1753f0ff94d0 Mon Sep 17 00:00:00 2001 From: Rahil Makadia Date: Mon, 19 Feb 2024 22:54:04 -0600 Subject: [PATCH 31/31] added back wheels on PyPI --- .github/workflows/pypi.yml | 4 ++-- README.md | 6 ++++++ docs/source/start.rst | 6 ++++++ grss/version.txt | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 2c97f6bd..13600019 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -5,8 +5,8 @@ on: branches: - main - dev - # paths: - # - "grss/version.txt" + paths: + - "grss/version.txt" permissions: id-token: write diff --git a/README.md b/README.md index d5be566e..7cfb3a96 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,12 @@ The GRSS library is available on PyPI and can be installed using the following c pip install grss ``` +If this installation fails (i.e., you get an error when importing GRSS), you can try installing it without using the binary wheel on PyPI by using the following command: + +``` console + pip install grss --no-binary grss +``` + NOTE: The GRSS library is currently not pip-installable on Intel-based Macs. To use the library on an Intel-based Mac, please install the library using the source code from the GitHub repository (see below for instructions). ### Install via source code diff --git a/docs/source/start.rst b/docs/source/start.rst index 323bee6a..51206728 100644 --- a/docs/source/start.rst +++ b/docs/source/start.rst @@ -14,6 +14,12 @@ The GRSS library is available on PyPI and can be installed using the following c pip install grss +If this installation fails (i.e., you get an error when importing GRSS), you can try installing it without using the binary wheel on PyPI by using the following command: + +.. code-block:: console + + pip install grss --no-binary grss + NOTE: The GRSS library is currently not pip-installable on Intel-based Macs. To use the library on an Intel-based Mac, please install the library using the source code from the GitHub repository (see below for instructions). ----------------------- diff --git a/grss/version.txt b/grss/version.txt index 711ee4f5..a4f52a5d 100644 --- a/grss/version.txt +++ b/grss/version.txt @@ -1 +1 @@ -3.1.3 \ No newline at end of file +3.2.0 \ No newline at end of file