Skip to content

Commit

Permalink
Use Python 3.11 as the default in the build-and-test CI jobs (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
jobovy committed May 3, 2023
1 parent f12e009 commit db768c6
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 41 deletions.
11 changes: 10 additions & 1 deletion .appveyor.yml_deprecated
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build: off

environment:
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.11"
MINICONDA: C:\\Miniconda37-x64

matrix:
Expand Down Expand Up @@ -59,6 +59,15 @@ after_test:
}
- conda deactivate
- conda remove --name test-environment --all
# Python 3.11
- conda create -n py311 python="3.11" numpy scipy matplotlib setuptools pip pytest gsl
- conda activate py311
- pip install wheel
- set INCLUDE=%CONDA_PREFIX%\Library\include;%INCLUDE%
- set LIB=%CONDA_PREFIX%\Library\lib;%LIB%
- set LIBPATH=%CONDA_PREFIX%\Library\lib;%LIBPATH%
- python setup.py bdist_wheel
- conda deactivate
# Python 3.10
- conda create -n py310 python="3.10" numpy scipy matplotlib setuptools pip pytest gsl
- conda activate py310
Expand Down
61 changes: 35 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,39 @@ jobs:
matrix:
include:
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_actionAngle.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_sphericaldf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: true
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_actionAngleTorus.py tests/test_conversion.py tests/test_galpypaper.py tests/test_import.py tests/test_interp_potential.py tests/test_kuzminkutuzov.py tests/test_util.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_SpiralArmsPotential.py tests/test_potential.py tests/test_scf.py tests/test_snapshotpotential.py
REQUIRES_PYNBODY: true
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_quantity.py tests/test_coords.py
REQUIRES_PYNBODY: false
# needs to be separate for different config
Expand All @@ -65,69 +65,85 @@ jobs:
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_orbit.py -k test_energy_jacobi_conservation
REQUIRES_PYNBODY: true
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_orbit.py tests/test_orbits.py -k 'not test_energy_jacobi_conservation'
REQUIRES_PYNBODY: true
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_evolveddiskdf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_jeans.py tests/test_dynamfric.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_qdf.py tests/test_pv2qdf.py tests/test_streamgapdf_impulse.py tests/test_noninertial.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: true
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_streamgapdf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_diskdf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_streamdf.py tests/test_streamspraydf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
TEST_FILES: tests/test_orbit.py -k test_energy_jacobi_conservation
REQUIRES_PYNBODY: true
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: "3.10"
TEST_FILES: tests/test_orbit.py tests/test_orbits.py -k 'not test_energy_jacobi_conservation'
REQUIRES_PYNBODY: true
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: ubuntu-latest
python-version: 3.9
TEST_FILES: tests/test_orbit.py -k test_energy_jacobi_conservation
Expand Down Expand Up @@ -161,23 +177,23 @@ jobs:
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: macos-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_orbit.py -k test_energy_jacobi_conservation
REQUIRES_PYNBODY: true
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: macos-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_orbit.py tests/test_orbits.py -k 'not test_energy_jacobi_conservation'
REQUIRES_PYNBODY: true
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
env:
PYTHON_COVREPORTS_VERSION: "3.10"
PYTHON_COVREPORTS_VERSION: "3.11"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -209,19 +225,11 @@ jobs:
run: |
pip install --upgrade --upgrade-strategy eager numpy scipy matplotlib numexpr setuptools cython pytest tqdm
- name: Install pynbody
if: ${{ matrix.REQUIRES_PYNBODY && matrix.python-version != 4.0 }}
if: ${{ matrix.REQUIRES_PYNBODY }}
run: |
pip install --upgrade --upgrade-strategy eager h5py pandas pytz
pip install --upgrade --upgrade-strategy eager wheel
pip install --upgrade --upgrade-strategy eager pynbody
- name: Install pynbody (Python 4.0; doesn't exist of course, placeholder for new python v)
if: ${{ matrix.REQUIRES_PYNBODY && matrix.python-version == 4.0 }}
run: |
sudo apt-get install libhdf5-dev
pip install --upgrade --upgrade-strategy eager --no-binary=h5py git+https://github.com/h5py/h5py.git@d4e4418a3dcfea5c978fe7fcdff0e80570bb7565#egg=h5py
pip install --upgrade --upgrade-strategy eager pandas pytz
pip install --upgrade --upgrade-strategy eager wheel
pip install git+https://github.com/pynbody/pynbody.git@cfbefac64bfad3b8d042e669ff2b36bad25813ce#egg=pynbody
- name: Install astropy
if: ${{ matrix.REQUIRES_ASTROPY }}
run: pip install astropy pyerfa
Expand Down Expand Up @@ -284,8 +292,9 @@ jobs:
pip install pytest-cov
# Turn astropy deprecation warnings into errors as well if astropy
if $REQUIRES_ASTROPY; then export PYTEST_ADDOPTS="-W error::astropy.utils.exceptions.AstropyDeprecationWarning"; else export PYTEST_ADDOPTS=""; fi
export XDRLIB_DEPRECATION="-W ignore:\"'xdrlib' is deprecated and slated for removal in Python 3.13\":DeprecationWarning"
# eval necessary for -k 'not ...' in TEST_FILES
eval "pytest -W error::DeprecationWarning -W error::FutureWarning $PYTEST_ADDOPTS -v $TEST_FILES --cov galpy --cov-config .coveragerc --disable-pytest-warnings --durations=0 --cov-report=term --cov-report=xml"
eval "pytest -W error::DeprecationWarning -W error::FutureWarning $PYTEST_ADDOPTS $XDRLIB_DEPRECATION -v $TEST_FILES --cov galpy --cov-config .coveragerc --disable-pytest-warnings --durations=0 --cov-report=term --cov-report=xml"
- name: Generate code coverage
if: ${{ matrix.python-version == env.PYTHON_COVREPORTS_VERSION && matrix.os == 'ubuntu-latest' }}
run: |
Expand Down
45 changes: 31 additions & 14 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,39 @@ jobs:
matrix:
include:
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_actionAngle.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_sphericaldf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_conversion.py tests/test_galpypaper.py tests/test_import.py tests/test_interp_potential.py tests/test_kuzminkutuzov.py tests/test_util.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_SpiralArmsPotential.py tests/test_potential.py tests/test_scf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_quantity.py tests/test_coords.py
REQUIRES_PYNBODY: false
# needs to be separate for different config
Expand All @@ -65,69 +65,85 @@ jobs:
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_orbit.py -k test_energy_jacobi_conservation
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_orbit.py tests/test_orbits.py -k 'not test_energy_jacobi_conservation'
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_evolveddiskdf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_jeans.py tests/test_dynamfric.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_qdf.py tests/test_pv2qdf.py tests/test_streamgapdf_impulse.py tests/test_noninertial.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_streamgapdf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_diskdf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
python-version: "3.11"
TEST_FILES: tests/test_streamdf.py tests/test_streamspraydf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
TEST_FILES: tests/test_orbit.py -k test_energy_jacobi_conservation
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
TEST_FILES: tests/test_orbit.py tests/test_orbits.py -k 'not test_energy_jacobi_conservation'
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: 3.9
TEST_FILES: tests/test_orbit.py -k test_energy_jacobi_conservation
Expand Down Expand Up @@ -224,5 +240,6 @@ jobs:
pip install pytest-cov
# Turn astropy deprecation warnings into errors as well if astropy
if $REQUIRES_ASTROPY; then export PYTEST_ADDOPTS="-W error::astropy.utils.exceptions.AstropyDeprecationWarning"; else export PYTEST_ADDOPTS=""; fi
export XDRLIB_DEPRECATION="-W ignore:\"'xdrlib' is deprecated and slated for removal in Python 3.13\":DeprecationWarning"
# eval necessary for -k 'not ...' in TEST_FILES
eval "pytest -W error::DeprecationWarning -W error::FutureWarning $PYTEST_ADDOPTS -v $TEST_FILES --cov galpy --cov-config .coveragerc --disable-pytest-warnings --durations=0"
eval "pytest -W error::DeprecationWarning -W error::FutureWarning $PYTEST_ADDOPTS $XDRLIB_DEPRECATION -v $TEST_FILES --cov galpy --cov-config .coveragerc --disable-pytest-warnings --durations=0"

0 comments on commit db768c6

Please sign in to comment.