From 70ebea0e2791e0ec9c0cc4c9dbf2e2765f46eddb Mon Sep 17 00:00:00 2001 From: Derek Homeier Date: Fri, 15 Dec 2023 16:15:22 +0100 Subject: [PATCH 1/8] TST: pull in all devdeps for Numpy 2.0.dev --- tox.ini | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 469416cda..61925b14c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{38,39,310,311}-{codestyle,test,docs}-all-{dev,legacy}{,-visual} + py{38,39,310,311,312}-{codestyle,test,docs}-all-{dev,legacy}{,-visual} requires = pip >= 18.0 setuptools >= 30.3.0 @@ -10,7 +10,7 @@ passenv = DISPLAY HOME setenv = - dev: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + dev: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple visual: MPLFLAGS = -m "mpl_image_compare" --mpl --mpl-generate-summary=html --mpl-results-path={toxinidir}/results --mpl-hash-library={toxinidir}/glue/tests/visual/{envname}.json --mpl-baseline-path=https://raw.githubusercontent.com/glue-viz/glue-core-visual-tests/images/{envname}/ whitelist_externals = find @@ -22,7 +22,12 @@ changedir = docs: doc deps = dev: numpy>=0.0.dev0 + dev: scipy>=0.0.dev0 dev: astropy>=0.0.dev0 + dev: pyerfa>=0.0.dev0 + dev: matplotlib>=0.0.dev0 + dev: git+https://github.com/contourpy/contourpy.git + dev: git+https://github.com/pandas-dev/pandas.git lts: astropy==5.0.* lts: matplotlib==3.5.* # Pin numpy-lts until permanent solution for #2353/#2428 @@ -46,6 +51,10 @@ extras = all: all docs: docs visual: visualtest +# Need `--no-deps` as long as pandas and contours have no branch for numpy>=2.0 +install_command = + !dev: python -I -m pip install + dev: python -I -m pip install -v --pre --no-deps commands = test: pip freeze test: pytest --pyargs glue --cov glue --cov-config={toxinidir}/setup.cfg {env:MPLFLAGS} {posargs} From 3cd33e910fff27182f04d539acced17a27472431 Mon Sep 17 00:00:00 2001 From: Derek Homeier Date: Tue, 27 Feb 2024 18:43:37 +0100 Subject: [PATCH 2/8] Add pytest*, astropy, matplotlib + pandas deps for dev job; fast-histogram --- setup.cfg | 1 + tox.ini | 28 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 44e4f5bed..479fe963a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,6 +28,7 @@ install_requires = pandas>=1.2 echo>=0.6 astropy>=4.0 + fast_histogram>=0.12 setuptools>=30.3.0 ipython>=4.0 dill>=0.2 diff --git a/tox.ini b/tox.ini index 61925b14c..cc4acadd3 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,31 @@ deps = dev: matplotlib>=0.0.dev0 dev: git+https://github.com/contourpy/contourpy.git dev: git+https://github.com/pandas-dev/pandas.git + # pytest* + dev: coverage + dev: exceptiongroup + dev: flake8 + dev: iniconfig + dev: mccabe + dev: packaging + dev: pluggy + dev: pycodestyle + dev: pyflakes + dev: tomli + # astropy + dev: astropy-iers-data + dev: pyyaml + # matplotlib + dev: cycler + dev: fonttools + dev: kiwisolver + dev: pillow + dev: pyparsing + # pandas + dev: python-dateutil + dev: pytz + dev: six + dev: tzdata lts: astropy==5.0.* lts: matplotlib==3.5.* # Pin numpy-lts until permanent solution for #2353/#2428 @@ -51,7 +76,8 @@ extras = all: all docs: docs visual: visualtest -# Need `--no-deps` as long as pandas and contours have no branch for numpy>=2.0 +# Need `--no-deps` as long as pandas and contours have no branch for numpy>=2.0 - +# for as long all test deps need to be manually pulled in above as well! install_command = !dev: python -I -m pip install dev: python -I -m pip install -v --pre --no-deps From 10443dde5f08c65314a1446ef570048e92be6314 Mon Sep 17 00:00:00 2001 From: Derek Homeier Date: Tue, 27 Feb 2024 18:44:22 +0100 Subject: [PATCH 3/8] Install shapely for numpy-2.0 with hard version pin --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index cc4acadd3..ac74d9545 100644 --- a/tox.ini +++ b/tox.ini @@ -26,6 +26,7 @@ deps = dev: astropy>=0.0.dev0 dev: pyerfa>=0.0.dev0 dev: matplotlib>=0.0.dev0 + dev: shapely==2.0.1+78.gba0924e dev: git+https://github.com/contourpy/contourpy.git dev: git+https://github.com/pandas-dev/pandas.git # pytest* From 1e0cb837673c536baa2b5fadd56166e043c35a16 Mon Sep 17 00:00:00 2001 From: Derek Homeier Date: Wed, 28 Feb 2024 23:17:54 +0100 Subject: [PATCH 4/8] DNM: use fast-histogram+casa-formats-io dev builds against numpy-2.0; contourpy+pandas+shapely unpinned --- tox.ini | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index ac74d9545..649f0898e 100644 --- a/tox.ini +++ b/tox.ini @@ -26,9 +26,11 @@ deps = dev: astropy>=0.0.dev0 dev: pyerfa>=0.0.dev0 dev: matplotlib>=0.0.dev0 - dev: shapely==2.0.1+78.gba0924e - dev: git+https://github.com/contourpy/contourpy.git - dev: git+https://github.com/pandas-dev/pandas.git + dev: shapely>=0.0.dev0 + dev: contourpy>=0.0.dev0 + dev: pandas>=0.0.dev0 + dev: git+https://github.com/radio-astro-tools/casa-formats-io.git + dev: git+https://github.com/astrofrog/fast-histogram.git # pytest* dev: coverage dev: exceptiongroup @@ -54,6 +56,22 @@ deps = dev: pytz dev: six dev: tzdata + # ipython + dev: asttokens + dev: decorator + dev: executing + dev: jedi>=0.16 + dev: matplotlib-inline + dev: parso + dev: pexpect + dev: prompt_toolkit>=3.0.41,<3.1.0 + dev: ptyprocess + dev: pure-eval + dev: pygments>=2.4.0 + dev: stack_data + dev: traitlets + dev: wcwidth + # LTS lts: astropy==5.0.* lts: matplotlib==3.5.* # Pin numpy-lts until permanent solution for #2353/#2428 @@ -77,7 +95,8 @@ extras = all: all docs: docs visual: visualtest -# Need `--no-deps` as long as pandas and contours have no branch for numpy>=2.0 - +# Need `--pre` for packages like pandas having no released version supporting numpy>=2.0 yet, +# + `--no-deps` for casa-formats-io having no branch for numpy>=2.0 - # for as long all test deps need to be manually pulled in above as well! install_command = !dev: python -I -m pip install From 8970d7bb9ab8ada1bc3c43cb174eefe8a0a61a74 Mon Sep 17 00:00:00 2001 From: Derek Homeier Date: Wed, 28 Feb 2024 23:18:43 +0100 Subject: [PATCH 5/8] TST: add py312 jobs --- .github/workflows/ci_workflows.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_workflows.yml b/.github/workflows/ci_workflows.yml index 9d1d04c42..c521d4e39 100644 --- a/.github/workflows/ci_workflows.yml +++ b/.github/workflows/ci_workflows.yml @@ -30,7 +30,7 @@ jobs: - linux: py39-test - linux: py310-test-all - linux: py311-test - - linux: py311-test-all + - linux: py312-test-all # Documentation build - linux: py38-docs @@ -43,14 +43,18 @@ jobs: - macos: py39-test - macos: py310-test-all - macos: py311-test + - macos: py312-test-all # Test some configurations on Windows - windows: py38-test - windows: py310-test + - windows: py311-test + - windows: py312-test # Test against latest developer versions of some packages - linux: py310-test-dev-all - linux: py311-test-dev + - linux: py312-test-dev-all publish: needs: tests From 4daac43edaf1bf65604495b1e67d6da90891a49b Mon Sep 17 00:00:00 2001 From: Derek Homeier Date: Wed, 17 Apr 2024 13:41:50 +0200 Subject: [PATCH 6/8] Use np.array(copy=None) with numpy 2.0 --- glue/utils/array.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/glue/utils/array.py b/glue/utils/array.py index 9213e993f..7da7baaa3 100644 --- a/glue/utils/array.py +++ b/glue/utils/array.py @@ -504,6 +504,8 @@ class categorical_ndarray(np.ndarray): def __new__(cls, value, dtype=None, copy=True, order=None, subok=False, ndmin=0, categories=None): + if not copy and np.lib.NumpyVersion(np.__version__) >= "2.0.0rc1": + copy = None result = np.array(value, dtype=dtype, copy=copy, order=order, subok=True, ndmin=ndmin).view(categorical_ndarray) if categories is not None: From 5988a839d1975c8ac7e504b5c4053407ff2bfadc Mon Sep 17 00:00:00 2001 From: Derek Homeier Date: Wed, 17 Apr 2024 13:51:54 +0200 Subject: [PATCH 7/8] DNM: test against numpy, astropy rc; scipy 1.13; casa-formats-io main w/ deps --- tox.ini | 53 ++++------------------------------------------------- 1 file changed, 4 insertions(+), 49 deletions(-) diff --git a/tox.ini b/tox.ini index 649f0898e..af2cb3a50 100644 --- a/tox.ini +++ b/tox.ini @@ -21,56 +21,11 @@ changedir = test: .tmp/{envname} docs: doc deps = - dev: numpy>=0.0.dev0 - dev: scipy>=0.0.dev0 - dev: astropy>=0.0.dev0 - dev: pyerfa>=0.0.dev0 - dev: matplotlib>=0.0.dev0 + dev: numpy==2.0.0rc1 + dev: scipy==1.13.0 + dev: astropy==6.1.0rc1 dev: shapely>=0.0.dev0 - dev: contourpy>=0.0.dev0 - dev: pandas>=0.0.dev0 dev: git+https://github.com/radio-astro-tools/casa-formats-io.git - dev: git+https://github.com/astrofrog/fast-histogram.git - # pytest* - dev: coverage - dev: exceptiongroup - dev: flake8 - dev: iniconfig - dev: mccabe - dev: packaging - dev: pluggy - dev: pycodestyle - dev: pyflakes - dev: tomli - # astropy - dev: astropy-iers-data - dev: pyyaml - # matplotlib - dev: cycler - dev: fonttools - dev: kiwisolver - dev: pillow - dev: pyparsing - # pandas - dev: python-dateutil - dev: pytz - dev: six - dev: tzdata - # ipython - dev: asttokens - dev: decorator - dev: executing - dev: jedi>=0.16 - dev: matplotlib-inline - dev: parso - dev: pexpect - dev: prompt_toolkit>=3.0.41,<3.1.0 - dev: ptyprocess - dev: pure-eval - dev: pygments>=2.4.0 - dev: stack_data - dev: traitlets - dev: wcwidth # LTS lts: astropy==5.0.* lts: matplotlib==3.5.* @@ -100,7 +55,7 @@ extras = # for as long all test deps need to be manually pulled in above as well! install_command = !dev: python -I -m pip install - dev: python -I -m pip install -v --pre --no-deps + dev: python -I -m pip install -v --pre commands = test: pip freeze test: pytest --pyargs glue --cov glue --cov-config={toxinidir}/setup.cfg {env:MPLFLAGS} {posargs} From bd331ceeb7bfec2138b20aeb1b7b88010de121df Mon Sep 17 00:00:00 2001 From: Derek Homeier Date: Wed, 17 Apr 2024 16:00:17 +0200 Subject: [PATCH 8/8] TST: dev tests on macOS + Windows; remove py>=311-windows --- .github/workflows/ci_workflows.yml | 9 ++++++--- tox.ini | 10 ++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci_workflows.yml b/.github/workflows/ci_workflows.yml index c521d4e39..44c191816 100644 --- a/.github/workflows/ci_workflows.yml +++ b/.github/workflows/ci_workflows.yml @@ -47,15 +47,18 @@ jobs: # Test some configurations on Windows - windows: py38-test - - windows: py310-test - - windows: py311-test - - windows: py312-test + - windows: py39-test # Test against latest developer versions of some packages - linux: py310-test-dev-all - linux: py311-test-dev - linux: py312-test-dev-all + - macos: py311-test-dev-all + - macos: py312-test-dev + + - windows: py310-test-dev + publish: needs: tests uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1 diff --git a/tox.ini b/tox.ini index af2cb3a50..16da8489c 100644 --- a/tox.ini +++ b/tox.ini @@ -21,11 +21,9 @@ changedir = test: .tmp/{envname} docs: doc deps = - dev: numpy==2.0.0rc1 - dev: scipy==1.13.0 - dev: astropy==6.1.0rc1 - dev: shapely>=0.0.dev0 - dev: git+https://github.com/radio-astro-tools/casa-formats-io.git + dev: numpy>=0.0.dev0 + dev: scipy>=0.0.dev0 + dev: astropy>=0.0.dev0 # LTS lts: astropy==5.0.* lts: matplotlib==3.5.* @@ -55,7 +53,7 @@ extras = # for as long all test deps need to be manually pulled in above as well! install_command = !dev: python -I -m pip install - dev: python -I -m pip install -v --pre + dev: python -I -m pip install -v commands = test: pip freeze test: pytest --pyargs glue --cov glue --cov-config={toxinidir}/setup.cfg {env:MPLFLAGS} {posargs}