fixed many url issues, backtick issues #798
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR and Merge builds (on main branch) | |
on: | |
pull_request: | |
branches: [ main ] | |
push: | |
branches: [ main ] | |
schedule: | |
- cron: "0 4 * * 0" | |
env: | |
# increment to rebuild cspice manually | |
CSPICE_VERSION: 67 | |
CSPICE_CACHE_NUMBER: 9 | |
PYPI_CACHE_NUMBER: 1 | |
jobs: | |
build: | |
name: Build libcspice 🌶️ 📚 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-14, windows-latest] | |
steps: | |
- name: Look for cached libcspice 🌶️ 📚 | |
id: cache-libcspice | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./src/spiceypy/utils/libcspice.* | |
./src/cspice/include | |
./src/cspice/src/cspice | |
key: artifact-${{ matrix.os }}-${{ env.CSPICE_VERSION }}-${{ env.CSPICE_CACHE_NUMBER }}-libcspice | |
- name: Setup 🔬🍦🏗️ | |
if: ${{ matrix.os == 'windows-latest' && steps.cache-libcspice.outputs.cache-hit != 'true' }} | |
uses: ilammy/[email protected] | |
- name: Checkout 🌶️ 🥧 | |
if: steps.cache-libcspice.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set up Python 🐍 3.13 | |
if: steps.cache-libcspice.outputs.cache-hit != 'true' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Display Python 🐍 version | |
if: steps.cache-libcspice.outputs.cache-hit != 'true' | |
run: python -c "import sys; print(sys.version)" | |
- name: Build libcspice 🌶️ 📚 | |
if: steps.cache-libcspice.outputs.cache-hit != 'true' | |
env: | |
CSPICE_NO_TEMP: "YES" | |
run: | | |
python -m pip install -r ci-requirements.txt | |
python get_spice.py | |
ls ./src/spiceypy/utils/ | |
ls ./src | |
ls ./src/cspice | |
- name: Upload built 🏗️ libcspice 🌶️ 📚 | |
if: steps.cache-libcspice.outputs.cache-hit != 'true' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ matrix.os }}-${{ env.CSPICE_VERSION }}-${{ env.CSPICE_CACHE_NUMBER }}-libcspice | |
path: | | |
./src/spiceypy/utils/libcspice.* | |
./src/cspice/include | |
./src/cspice/src/cspice | |
test: | |
name: Test SpiceyPy 🌶️ 🥧 | |
needs: build | |
runs-on: ${{ matrix.os }} | |
permissions: | |
id-token: write | |
contents: read | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-14, windows-latest] | |
python-version: ['3.10', '3.11', '3.12', '3.13'] | |
steps: | |
- name: Setup windows msvc | |
if: ${{ matrix.os == 'windows-latest'}} | |
uses: ilammy/[email protected] | |
- name: Checkout 🌶️ 🥧 | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Download built 🏗️ libcspice 🌶️ 📚 | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./src/spiceypy/utils/libcspice.* | |
./src/cspice/include | |
./src/cspice/src/cspice | |
key: artifact-${{ matrix.os }}-${{ env.CSPICE_VERSION }}-${{ env.CSPICE_CACHE_NUMBER }}-libcspice | |
- name: Verify cache | |
run: | | |
echo "check src dir \n" | |
ls ./src | |
echo "check cspice dir \n" | |
ls ./src/cspice | |
ls ./src/cspice/include/ | |
ls ./src/cspice/src/ | |
echo "check for libcspice \n" | |
ls ./src/spiceypy/utils/ | |
echo "done" | |
- name: Set up Python 🐍 ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
check-latest: true | |
- name: Display Python 🐍 version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Get pip cache dir on mac/linux | |
if: runner.os != 'Windows' | |
id: pip-cache-nix | |
run: | | |
echo "pip_cache_dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
- name: Get pip cache dir on windows | |
if: runner.os == 'Windows' | |
shell: pwsh | |
id: pip-cache-win | |
run: | | |
echo "pip_cache_dir=$(pip cache dir)" >> $env:GITHUB_OUTPUT | |
- name: Cache pip's cache dir mac/linux | |
if: runner.os != 'Windows' | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pip-cache-nix.outputs.pip_cache_dir }} | |
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ env.PYPI_CACHE_NUMBER }}-test-pip-${{ hashFiles('**/ci-requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.python-version }}-${{ env.PYPI_CACHE_NUMBER }}-test-pip- | |
- name: Cache pip's cache dir windows | |
if: runner.os == 'Windows' | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pip-cache-win.outputs.pip_cache_dir }} | |
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ env.PYPI_CACHE_NUMBER }}-test-pip-${{ hashFiles('**/ci-requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.python-version }}-${{ env.PYPI_CACHE_NUMBER }}-test-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install -r ci-requirements.txt | |
- name: Build Cyice | |
env: | |
CSPICE_NO_TEMP: "YES" | |
CSPICE_NO_BUILD: "YES" | |
SYSTEM_VERSION_COMPAT: 0 | |
run: | | |
ls ./src/ | |
ls ./src/cspice/include/ | |
ls ./src/cspice/src/ | |
ls ./src/spiceypy/utils/ | |
echo "" | |
python setup.py build_ext -j 2 --inplace | |
echo "" | |
python -m build --wheel | |
echo "" | |
ls ./src/spiceypy/cyice/ | |
ls ./dist/ | |
- name: Install SpiceyPy 🌶️ 🥧 | |
env: | |
CSPICE_NO_TEMP: "YES" | |
CSPICE_NO_BUILD: "YES" | |
SYSTEM_VERSION_COMPAT: 0 | |
run: | | |
python -m pip install . | |
- name: Test 🧪 with coverage 📈 | |
run: | | |
coverage run --source spiceypy -m pytest --pyargs spiceypy --benchmark-disable | |
- name: Run Benchmarks on latest Python Version | |
if: ${{ matrix.python-version == '3.13' }} | |
run: | | |
python -m pytest --pyargs spiceypy --benchmark-only | |
- name: Upload 🆙 coverage 📈 report to codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: false | |
verbose: true | |
use_oidc: true | |
test_offline_shared: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout 🌶️ 🥧 | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set up Python 🐍 3.13 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Display Python 🐍 version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
echo "pip_cache_dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
- name: Cache pip's cache dir | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pip-cache.outputs.pip_cache_dir }} | |
key: ${{ runner.os }}-3.13-test-pip-${{ hashFiles('**/ci-requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-3.13-test-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install -U -r ci-requirements.txt | |
- name: Download and extract the shared library for CSPICE 🌶️ | |
run: | | |
mkdir -p /tmp/cspice/ | |
wget -O - https://anaconda.org/conda-forge/cspice/67/download/linux-64/cspice-67-h7f98852_0.tar.bz2 | tar xjC /tmp/cspice/ | |
- name: Install SpiceyPy 🌶️ 🥧 | |
env: | |
CSPICE_SHARED_LIB: "/tmp/cspice/lib/libcspice.so" | |
CSPICE_NO_TEMP: "YES" | |
CSPICE_NO_BUILD: "YES" | |
run: | | |
python get_spice.py | |
ls ./src/ | |
ls ./src/spiceypy/utils/ | |
python setup.py build_ext -j 2 --inplace | |
python -m build --wheel | |
ls ./src/spiceypy/cyice/ | |
ls ./dist/ | |
python -m pip install . --user | |
- name: Test 🧪 with coverage 📈 | |
run: | | |
coverage run --source spiceypy -m pytest -vv --pyargs spiceypy --benchmark-disable | |
- name: Upload 🆙 coverage 📈 report to codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: false | |
verbose: true | |
use_oidc: true | |
test_offline_cspice_install: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout 🌶️ 🥧 | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set up Python 🐍 3.13 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Display Python 🐍 version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
echo "pip_cache_dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
- name: Cache pip's cache dir | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pip-cache.outputs.pip_cache_dir }} | |
key: ${{ runner.os }}-3.13-test-pip-${{ hashFiles('**/ci-requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-3.13-test-pip- | |
- name: Install dependencies | |
run : | | |
python -m pip install -U -r ci-requirements.txt | |
- name: Download and extract CSPICE 🌶️ | |
run: | | |
wget -O - https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/PC_Linux_GCC_64bit/packages/cspice.tar.Z | gunzip -c | tar xC /tmp/ | |
- name: Install SpiceyPy 🌶️ 🥧 | |
env: | |
CSPICE_SRC_DIR: "/tmp/cspice" | |
run: | | |
python get_spice.py | |
ls ./src/ | |
ls ./src/spiceypy/utils/ | |
python setup.py build_ext -j 2 --inplace | |
ls ./src/spiceypy/cyice/ | |
python -m pip install . --user | |
- name: Test 🧪 with coverage 📈 | |
run: | | |
coverage run --source spiceypy -m pytest --pyargs spiceypy --benchmark-disable | |
- name: Upload 🆙 coverage 📈 report to codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: false | |
verbose: true | |
use_oidc: true |