Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.11 support #503

Merged
merged 48 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bdc7f07
Test against soon-to-be-released Python 3.11
jobovy Aug 31, 2022
6208f29
Try installing scipy 3.11 wheel
jobovy Aug 31, 2022
d08f5e1
Try fixing syntax
jobovy Aug 31, 2022
a4efe65
Try fixing syntax again
jobovy Aug 31, 2022
72f84df
Install nightly matplotlib wheel
jobovy Aug 31, 2022
e7d07c3
Add matplotlib version
jobovy Aug 31, 2022
daca00b
Install contourpy
jobovy Aug 31, 2022
52f06eb
Add cycler
jobovy Aug 31, 2022
57e505d
Add fonttools
jobovy Aug 31, 2022
8c24874
Install all matplotlib dependencies
jobovy Aug 31, 2022
94c936c
Don't specify matplotlib dev version, just use latest
jobovy Aug 31, 2022
a91db0e
Install h5py from source
jobovy Aug 31, 2022
e893337
Try fixing syntax again
jobovy Aug 31, 2022
cc219e3
Install a specific pandas wheel to speed things up for now
jobovy Aug 31, 2022
baaf772
Fix pandas wheel URL
jobovy Aug 31, 2022
7e6b78c
Install macos wheels for scipy/pandas
jobovy Aug 31, 2022
c37f0ca
Use brew to install hdf5
jobovy Aug 31, 2022
98f77ff
Merge branch 'main' into py311
jobovy Oct 17, 2022
dd8cce4
Try building jaxlib from source for Python 3.11
jobovy Oct 17, 2022
6448fd6
Just download jax
jobovy Oct 17, 2022
aa20fa6
Follow redirects to download jaxlib
jobovy Oct 17, 2022
6077363
Python 3.11 wheels available now in PyPI for scipy and matplotlib
jobovy Oct 17, 2022
98b9777
Save jax wheel
jobovy Oct 17, 2022
95413ac
Switch to installing jax wheel
jobovy Oct 17, 2022
6346635
Try installing latest h5py
jobovy Oct 17, 2022
35cb9fe
Try latest h5py
jobovy Oct 17, 2022
63de8a8
Merge branch 'main' into py311
jobovy Oct 17, 2022
d901d96
Merge branch 'main' into py311
jobovy Oct 18, 2022
178d929
Install h5py mac os x wheel
jobovy Nov 3, 2022
e97e3e1
Try switching appveyor build/test to Python 3.11
jobovy Nov 3, 2022
7d686d3
Switch to Python=3.11, not dev
jobovy Nov 4, 2022
09238c2
New jax release with 3.11 support, so just switch back to standard in…
jobovy Nov 4, 2022
508b3da
Also switch to 3.11 in windows GHA build
jobovy Nov 4, 2022
e3a8f9d
Install latest h5py with Python 3.11 support
jobovy Jan 23, 2023
f245b50
Merge branch 'main' into py311
jobovy Jan 23, 2023
c0ecd8b
Try ignoring xdrlib deprecation warning
jobovy Jan 23, 2023
4fd4907
Ignore xdrlib deprecation warning
jobovy Jan 23, 2023
f9df50a
Try fix env variable definition syntax
jobovy Jan 23, 2023
ff8edd3
Syntax again
jobovy Jan 23, 2023
47c645e
Try using gcc for pynbody
jobovy Jan 24, 2023
df510e5
Install my pynbody 3.11 wheel
jobovy Jan 24, 2023
efa5e05
Fix )
jobovy Jan 24, 2023
842e8bc
Switch back to usual pynbody install now that there are 3.11 wheels
jobovy Jan 30, 2023
d007a3c
Merge branch 'main' into py311
jobovy Feb 4, 2023
a7f0934
Merge branch 'main' into py311
jobovy Apr 7, 2023
ee956d5
Try with numba python 3.11 RC
jobovy Apr 7, 2023
557b801
numba now has 3.11 support
jobovy May 2, 2023
dda753f
Merge branch 'main' into py311
jobovy May 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"