Skip to content

Bump version to 2.0.6, regenerate lock file, update versioned DOI for… #2821

Bump version to 2.0.6, regenerate lock file, update versioned DOI for…

Bump version to 2.0.6, regenerate lock file, update versioned DOI for… #2821

Workflow file for this run

name: build
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ${{ matrix.os }}
# runs-on: macos-latest
strategy:
matrix:
#python-version: [3.5, 3.6, 3.7, 3.8]
#os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
#os: [ubuntu-latest]
#os: [windows-latest]
python-version: [3.12]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies (Linux)
env:
MMS_AUTH_U: ${{ secrets.MMS_AUTH_U }}
MMS_AUTH_P: ${{ secrets.MMS_AUTH_P }}
VIRES_TOKEN: ${{ secrets.VIRES_AUTH }}
run: |
working_dir=$(pwd)
echo working dir: ${working_dir}
echo virtual env: $VIRTUAL_ENV
# Create fresh virtual environment in a known location
python -m venv ../.venv
# Activate new environment
source ../.venv/bin/activate
echo "Which pip:"
which pip
echo "Installing pip, pdm, and uv"
python -m pip install --upgrade pip
pip install pdm
pip install uv
pdm config use_uv true
hash -r
echo "which pdm?"
which pdm
echo "which uv?"
which uv
echo "Installing lint, setup, and test dependencies only"
pdm install -dG lint -dG test -dG setup --no-default
echo "Activating venv created by pdm"
source ../.venv/bin/activate
echo "python: $(which python)"
echo "Building pyspedas sdist and wheel"
python -m build
wheelbase=$(echo dist/*.whl)
extras='[all]'
wheel_extras=${extras}
echo "Installing pyspedas, pyspedas dependencies and extras in venv"
pip install ${wheelbase}${wheel_extras}
echo "Setting up credentials for MMS tests"
python -m pyspedas.projects.mms.tests.test_mms_setup
if: matrix.os == 'ubuntu-latest'
- name: Install dependencies (Windows)
env:
MMS_AUTH_U: ${{ secrets.MMS_AUTH_U }}
MMS_AUTH_P: ${{ secrets.MMS_AUTH_P }}
VIRES_TOKEN: ${{ secrets.VIRES_AUTH }}
run: |
working_dir=$(pwd)
echo working dir: ${working_dir}
echo virtual env: $VIRTUAL_ENV
# Create fresh virtual environment in a known location
python -m venv ../.venv
# Activate new environment
source ../.venv/bin/activate
echo "Which pip:"
which pip
echo "Installing pip, pdm, and uv"
python -m pip install --upgrade pip
pip install pdm
pip install uv
pdm config use_uv true
hash -r
echo "which pdm?"
which pdm
echo "which uv?"
which uv
echo "Installing lint, setup, and test dependencies only"
pdm install -dG lint -dG test -dG setup --no-default
echo "Activating venv created by pdm"
source ../.venv/bin/activate
echo "python: $(which python)"
echo "Building pyspedas sdist and wheel"
python -m build
wheelbase=$(echo dist/*.whl)
extras='[all]'
wheel_extras=${extras}
echo "Installing pyspedas, pyspedas dependencies and extras in venv"
pip install ${wheelbase}${wheel_extras}
echo "Setting up credentials for MMS tests"
python -m pyspedas.projects.mms.tests.test_mms_setup
if: matrix.os == 'windows-latest'
- name: Install dependencies (macOS)
env:
MMS_AUTH_U: ${{ secrets.MMS_AUTH_U }}
MMS_AUTH_P: ${{ secrets.MMS_AUTH_P }}
VIRES_TOKEN: ${{ secrets.VIRES_AUTH }}
run: |
working_dir=$(pwd)
echo working dir: ${working_dir}
echo virtual env: $VIRTUAL_ENV
# Create fresh virtual environment in a known location
python -m venv ../.venv
# Activate new environment
source ../.venv/bin/activate
echo "Which pip:"
which pip
echo "Installing pip, pdm, and uv"
python -m pip install --upgrade pip
pip install pdm
pip install uv
pdm config use_uv true
hash -r
echo "which pdm?"
which pdm
echo "which uv?"
which uv
echo "Installing lint, setup, and test dependencies only"
pdm install -dG lint -dG test -dG setup --no-default
echo "Activating venv created by pdm"
source ../.venv/bin/activate
echo "python: $(which python)"
echo "Building pyspedas sdist and wheel"
python -m build
wheelbase=$(echo dist/*.whl)
extras='[all]'
wheel_extras=${extras}
echo "Installing pyspedas, pyspedas dependencies and extras in venv"
pip install ${wheelbase}${wheel_extras}
echo "Setting up credentials for MMS tests"
python -m pyspedas.projects.mms.tests.test_mms_setup
if: matrix.os == 'macos-latest'
- name: Lint with flake8
run: |
source ../.venv/bin/activate
#pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --exclude '*venv*','build' --count --select=E9,F63,F7,F82 --show-source --statistics --max-line-length=127
# exit-zero treats all errors as warnings.
flake8 . --exclude '*venv*','build' --count --exit-zero --max-complexity=10 --statistics --max-line-length=127
- name: Lint with ruff
run: |
source ../.venv/bin/activate
# stop the build if there are Python syntax errors or undefined names
ruff check . --select=E9,F63,F7,F82 --statistics
# exit-zero treats all errors as warnings.
ruff check . --exit-zero --statistics --line-length=127 -- --max-complexity=10
- name: Hide the repo copy so imports use site-packages
run: |
# keep it around for debugging; delete instead if you want the space back
if [ -d pyspedas ]; then mv pyspedas __repo_pyspedas; fi
- name: Sanity check import location
shell: bash
run: |
source ../.venv/bin/activate
python - <<'PY'
import pyspedas, pathlib, sys
p = pathlib.Path(pyspedas.__file__).resolve()
print("sys.executable:", sys.executable)
print("pyspedas import path:", p)
print("sys.path[0]:", sys.path[0])
assert "site-packages" in str(p), f"Still importing from repo: {p}"
PY
- name: Test with unittest
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/refactor_projects' || github.ref == 'refs/heads/pyspedas_2_0_dev'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
VIRES_TOKEN: ${{ secrets.VIRES_AUTH }}
SPEDAS_DATA_DIR: data
ACE_DATA_DIR: ace_data/
BARREL_DATA_DIR: barrel_data/
CLUSTER_DATA_DIR: cluster_data/
DSC_DATA_DIR: dsc_data/
CSSWE_DATA_DIR: csswe_data/
EQUATORS_DATA_DIR: eqs_data/
FAST_DATA_DIR: fast_data/
GEOTAIL_DATA_DIR: geotail_data/
GOES_DATA_DIR: goes_data/
IMAGE_DATA_DIR: img_data/
MICA_DATA_DIR: mica_data/
MMS_DATA_DIR: mms_data/
OMNI_DATA_DIR: omni_data/
POES_DATA_DIR: poes_data/
POLAR_DATA_DIR: polar_data/
PSP_DATA_DIR: psp_data/
RBSP_DATA_DIR: rbsp_data/
SOLO_DATA_DIR: solo_data/
STEREO_DATA_DIR: stereo_data/
THM_DATA_DIR: themis_data/
TWINS_DATA_DIR: twins_data/
ULY_DATA_DIR: uly_data/
WIND_DATA_DIR: wind_data/
LANL_DATA_DIR: lanl_data/
CNOFS_DATA_DIR: cnofs_data/
ST5_DATA_DIR: st5_data/
PYTPLOT_LOGGING_LEVEL: error
run: |
source ../.venv/bin/activate
echo "========================================================="
# Show the free disk space on this filesystem
echo "Disk space prior to starting tests:"
df -h .
# Show the IP address the test suite is running from (useful for troubleshooting data server access issues)
echo "========================================================="
echo IP address for this test:
coverage run -a -m pyspedas.utilities.tests.test_find_ip_address
echo Starting mms data_rate_segments tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_data_rate_seg
echo Starting akebono tests at `date`
coverage run -a -m pyspedas.projects.akebono.tests.test_akebono
#echo Starting maven S3 tests at `date`
#coverage run -a -m pyspedas.projects.maven.tests.test_maven_uri
echo Starting maven tests at `date`
coverage run -a -m pyspedas.projects.maven.tests.test_maven
echo Starting ace tests at `date`
coverage run -a -m pyspedas.projects.ace.tests.test_ace
echo Starting erg tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg
echo Starting erg cotrans tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_cotrans
echo Starting erg ground data tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_ground
echo Starting erg mepe particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_mepe
echo Starting erg mepi particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_mepi
echo Starting erg lepe particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_lepe
echo Starting erg lepi particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_lepi
echo Starting erg xep particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_xep
echo Starting erg hep particle tests at `date`
coverage run -a -m pyspedas.projects.erg.tests.test_erg_hep
echo "========================================================="
# Show the free disk space on this filesystem
echo "Disk space after ERG tests:"
df -h .
# Clean up files downloaded so far
/bin/rm -rf data/*
echo "Disk space after cleanup:"
df -h .
echo "========================================================="
echo Starting VIRES client tests at `date`
coverage run -a -m pyspedas.vires.tests.test_vires
echo Starting secs tests at `date`
coverage run -a -m pyspedas.projects.secs.tests.test_secs
echo Starting MTH5 import test at `date`
coverage run -a -m pyspedas.mth5.tests.test_mth5_import
echo Starting MTH5 load_fdsn test at `date`
coverage run -a -m pyspedas.mth5.tests.test_load_fdsn
echo Starting cluster tests at `date`
coverage run -a -m pyspedas.projects.cluster.tests.test_cluster
echo Starting cluster S3 tests at `date`
coverage run -a -m pyspedas.projects.cluster.tests.test_cluster_uri
echo Starting CDAWeb tests at `date`
coverage run -a -m pyspedas.cdagui_tools.tests.test_cdagui
echo Starting themis tplot_time tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_tplot_time
echo Starting barrel tests at `date`
coverage run -a -m pyspedas.projects.barrel.tests.test_barrel
echo Starting elfin epd_l1 tests at `date`
coverage run -a -m pyspedas.projects.elfin.tests.test_epd_l1
echo Starting elfin epd_l2 tests at `date`
coverage run -a -m pyspedas.projects.elfin.tests.test_epd_l2
echo Starting elfin state tests at `date`
coverage run -a -m pyspedas.projects.elfin.tests.test_state
echo Starting elfin tests at `date`
coverage run -a -m pyspedas.projects.elfin.tests.test_elfin
echo Starting elfin epd calibration tests at `date`
coverage run -a -m pyspedas.projects.elfin.tests.test_epd_calibration
echo Starting soho tests at `date`
coverage run -a -m pyspedas.projects.soho.tests.test_soho
echo Starting de2 tests at `date`
coverage run -a -m pyspedas.projects.de2.tests.test_de2
echo Starting st5 tests at `date`
coverage run -a -m pyspedas.projects.st5.tests.test_st5
echo Starting lanl tests at `date`
coverage run -a -m pyspedas.projects.lanl.tests.test_lanl
echo Starting cotrans quaternion tests at `date`
coverage run -a -m pyspedas.cotrans_tools.tests.test_quaternions
echo Starting cnofs tests at `date`
coverage run -a -m pyspedas.projects.cnofs.tests.test_cnofs
echo Starting kompsat tests at `date`
coverage run -a -m pyspedas.projects.kompsat.tests.test_kompsat
echo Starting hapi tests at `date`
coverage run -a -m pyspedas.hapi_tools.tests.test_hapi
echo Starting noaa tests at `date`
coverage run -a -m pyspedas.projects.noaa.tests.test_noaa
echo Starting particles tests at `date`
coverage run -a -m pyspedas.particles.tests.test_particles
echo Starting mms cotrans tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_cotrans
echo Starting mms events tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_events
echo Starting mms orbit_plots tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_orbit_plots
echo Starting mms overview_plots tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_overview_plots
echo Starting mms neutral sheet tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_neutral_sheet
echo Starting mms ql_lib_sitl tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_ql_l1b_sitl
echo Starting mms_part_getspec tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_part_getspec
echo Starting mms_part_getspec FPI bulk velocity subtraction tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_getspec_bulkv
echo Starting mms load routine tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_load_routine
echo Starting mms feeps tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_feeps
echo Starting mms eis tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_eis
echo Starting mms fpi tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_fpi
echo Starting mms file_filter tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_file_filter
echo Starting mms curlometer tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_curlometer
echo Starting mms wavpol tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_wavpol
echo Starting mms slice2d tests at `date`
coverage run -a -m pyspedas.projects.mms.tests.test_mms_slice2d
#echo Starting mms S3 tests at `date`
#coverage run -a -m pyspedas.projects.mms.tests.test_mms_load_uri
echo "========================================================="
# Show the free disk space on this filesystem
echo "Disk space after MMS tests:"
df -h .
# Clean up MMS data
/bin/rm -rf mms_data/*
echo "Disk space after MMS cleanup:"
df -h .
echo "========================================================="
echo Starting dscovr tests at `date`
coverage run -a -m pyspedas.projects.dscovr.tests.test_dscovr
echo Starting utilities download tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_download
echo Starting utilities misc tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_misc
echo Starting tplot wildcard tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_tplot_wildcard
echo Starting plotting tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_plot
echo Starting utilities time_tests tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_time
echo Starting utilities libs_tests tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_libs
echo Starting utilities S3 tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_utilities_download_uri
echo Starting cotrans tests at `date`
coverage run -a -m pyspedas.cotrans_tools.tests.test_cotrans
echo Starting utilities xdegap tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_xdegap
echo Starting utilities tplot_math tests at `date`
coverage run -a -m pyspedas.utilities.tests.test_math
echo Starting cotrans minvar tests at `date`
coverage run -a -m pyspedas.cotrans_tools.tests.test_minvar
echo Starting cotrans fac tests at `date`
coverage run -a -m pyspedas.cotrans_tools.tests.test_fac
echo Starting cotrans lmn tests at `date`
coverage run -a -m pyspedas.cotrans_tools.tests.test_lmn
echo Starting csswe tests at `date`
coverage run -a -m pyspedas.projects.csswe.tests.test_csswe
echo Starting equator_s tests at `date`
coverage run -a -m pyspedas.projects.equator_s.tests.test_equator_s
echo Starting image tests at `date`
coverage run -a -m pyspedas.projects.image.tests.test_image
echo Starting psp tests at `date`
coverage run -a -m pyspedas.projects.psp.tests.test_psp
echo Starting rbsp tests at `date`
coverage run -a -m pyspedas.projects.rbsp.tests.test_rbsp
echo Starting stereo tests at `date`
coverage run -a -m pyspedas.projects.stereo.tests.test_stereo
echo Starting twins tests at `date`
coverage run -a -m pyspedas.projects.twins.tests.test_twins
echo Starting wind tests at `date`
coverage run -a -m pyspedas.projects.wind.tests.test_wind
echo Starting poes tests at `date`
coverage run -a -m pyspedas.projects.poes.tests.test_poes
echo Starting polar tests at `date`
coverage run -a -m pyspedas.projects.polar.tests.test_polar
echo Starting geopack tests at `date`
coverage run -a -m pyspedas.geopack.tests.test_geopack
echo Starting geopack-IDL validation tests at `date`
coverage run -a -m pyspedas.geopack.tests.test_geopack_idl_validation
echo Starting geotail tests at `date`
coverage run -a -m pyspedas.projects.geotail.tests.test_geotail
echo Starting analysis tests at `date`
coverage run -a -m pyspedas.analysis.tests.test_analysis
echo Starting analysis wavpol tests at `date`
coverage run -a -m pyspedas.analysis.tests.test_twavpol
echo Starting analysis wavelet tests at `date`
coverage run -a -m pyspedas.analysis.tests.test_wavelet
echo Starting analysis magnetic nulls tests at `date`
coverage run -a -m pyspedas.analysis.tests.test_magnetic_nulls
echo Starting fast tests at `date`
coverage run -a -m pyspedas.projects.fast.tests.test_fast
echo Starting omni tests at `date`
coverage run -a -m pyspedas.projects.omni.tests.test_omni
echo Starting themis tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis
echo Starting goes tests at `date`
coverage run -a -m pyspedas.projects.goes.tests.test_goes
echo Starting mica tests at `date`
coverage run -a -m pyspedas.projects.mica.tests.test_mica
echo Starting ulysses tests at `date`
coverage run -a -m pyspedas.projects.ulysses.tests.test_ulysses
echo Starting solo tests at `date`
coverage run -a -m pyspedas.projects.solo.tests.test_solo
echo Starting kyoto tests at `date`
coverage run -a -m pyspedas.projects.kyoto.tests.test_kyoto
echo Starting swarm tests at `date`
coverage run -a -m pyspedas.projects.swarm.tests.test_swarm
echo Starting themis_check_args tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_check_args
echo Starting themis autoload support tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_autoload_support
echo Starting themis cal_fit tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_cal_fit
echo Starting themis dsl_cotrans tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_dsl_cotrans
echo Starting themis lunar_cotrans tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_lunar_cotrans
echo Starting themis spinmodel tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_spinmodel
echo Starting themis state tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_state
echo Starting themis scpot2dens tests at `date`
coverage run -a -m pyspedas.projects.themis.tests.test_themis_scpot2dens
echo "========================================================="
# Show the free disk space on this filesystem
echo "Disk space after all tests:"
df -h .
echo "========================================================="
echo Done with tests at `date`
echo "Restoring pyspedas directory to produce coverage report"
mv __repo_pyspedas pyspedas
echo "Producing coverage report"
pdm run coverage xml --debug=pathmap
grep avg_data coverage.xml
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/refactor_projects' || github.ref == 'refs/heads/pyspedas_2_0_dev'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: coverage.xml
format: cobertura