Skip to content

Commit 77dc72e

Browse files
manodeeplgarrison
andauthored
Bumped min numpy version to 1.18 (#324)
* Bumped min numpy version to 1.18 * Updated numpy min version and min py version Now minimum supported numpy is 1.18 and minimum supported python (py3) is 3.9 * Don't run numpy2 on py2.7 Probably pissed off some software gremlins by allowing that combo! * Adding in Numpy 2 (#325) * Fix headers and include paths for NumPy 2 (currently breaks NumPy 1 build support) * Fix NumPy 1 build by using numpy.get_include() --------- Co-authored-by: Lehman Garrison <lgarrison@flatironinstitute.org> * No more py2 Too much hassle trying to maintain py2 * Dropping py2.7, updating to numpy 1.20 as the min tested version * Can't run numpy1.20 with py3.12 * dropped python2 * Trying to keep the bot happy * Reinstate py2.7 support for patch release (before completely dropping py2) * Added change-log [ci skip] * Ugghhh wrong date [ci skip] --------- Co-authored-by: Lehman Garrison <lgarrison@flatironinstitute.org>
1 parent b7350a1 commit 77dc72e

File tree

5 files changed

+34
-43
lines changed

5 files changed

+34
-43
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ jobs:
1515
matrix:
1616
os: ["ubuntu-20.04", "ubuntu-latest", "macos-latest"]
1717
compiler: [gcc-7, gcc-9, clang]
18-
python-version: ["2.7", "3.7", "3.8", "3.9"]
19-
numpy-version: ["1.16", "1.18"]
18+
python-version: ["3.9", "3.12"]
19+
numpy-version: ["1.20", "2.0.1"]
2020

2121
include:
22-
- numpy-version: "1.22"
22+
- numpy-version: "1.23"
2323
compiler: gcc-10
2424
python-version: "3.10"
2525
os: ubuntu-latest
2626

27-
- numpy-version: "1.22"
27+
- numpy-version: "1.23"
2828
compiler: gcc-11
2929
python-version: "3.10"
3030
os: ubuntu-latest
@@ -39,17 +39,17 @@ jobs:
3939
python-version: "3.10"
4040
os: ubuntu-latest
4141

42-
- numpy-version: "1.22"
42+
- numpy-version: "1.23"
4343
compiler: gcc-10
4444
python-version: "3.11"
4545
os: ubuntu-latest
4646

47-
- numpy-version: "1.22"
47+
- numpy-version: "1.23"
4848
compiler: gcc-11
4949
python-version: "3.11"
5050
os: ubuntu-latest
5151

52-
- numpy-version: "1.22"
52+
- numpy-version: "1.23"
5353
compiler: gcc-12
5454
python-version: "3.11"
5555
os: ubuntu-latest
@@ -88,39 +88,21 @@ jobs:
8888
- os: "ubuntu-latest"
8989
compiler: gcc-7
9090

91-
# Don't run numpy 1.16 on ubuntu-latest
92-
- os: "ubuntu-latest"
93-
numpy-version: 1.16
94-
91+
# Only use latest numpy on ubuntu-latest
9592
- os: "ubuntu-latest"
96-
numpy-version: 1.18
93+
numpy-version: 1.20
9794

9895
# python3.10 only on ubuntu-latest
9996
# - os: "ubuntu-20.04"
10097
# python-version: "3.10"
10198
# - os: "macos-latest"
10299
# python-version: "3.10"
103100

104-
# numpy1.18 only on python3.10
105-
# (which, in turn, is only on 'latest')
106-
- python-version: "2.7"
107-
numpy-version: "1.18"
108101
- python-version: "3.9"
109-
numpy-version: "1.18"
110-
- python-version: "3.8"
111-
numpy-version: "1.18"
112-
- python-version: "3.7"
113-
numpy-version: "1.18"
114-
115-
# excludes for numpy 1.22
116-
# - python-version: "2.7"
117-
# numpy-version: "1.22"
118-
# - python-version: "3.9"
119-
# numpy-version: "1.22"
120-
# - python-version: "3.8"
121-
# numpy-version: "1.22"
122-
# - python-version: "3.7"
123-
# numpy-version: "1.22"
102+
numpy-version: "2.0.1"
103+
104+
- python-version: "3.12"
105+
numpy-version: "1.20"
124106

125107
env:
126108
CC: ${{ matrix.compiler }}

CHANGES.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ New features
1010
- conda installable package
1111
- GPU version
1212

13+
2.5.3 (06/08/2024)
14+
==================
15+
Final release of the 2.5.x series and last Corrfunc version to support ``python2``
16+
17+
Infrastructure
18+
--------------
19+
- Updated minimum numpy to ``1.20`` [#324]
20+
- No longer testing on ``python2`` [#324]
21+
1322
2.5.2 (04/10/2023)
1423
==================
1524

@@ -23,7 +32,7 @@ Infrastructure
2332
- Automatic uploads of new releases to PyPI [#305]
2433
- Added @dependabot for automatic dependency updates in GitHub Actions [#306, #307, #308]
2534

26-
35+
2736
2.5.1 (28/07/2023)
2837
==================
2938

common.mk

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ ifeq ($(DO_CHECKS), 1)
375375
endif
376376

377377
# Check if using clang on Apple with M1/M1 Max/M2 etc
378-
# if so, remove -march=native from CFLAGS and
378+
# if so, remove -march=native from CFLAGS and
379379
# then add -mcpu=apple-m1 -mtune=apple-m1
380380
# ARCH := $(shell uname -m)
381381
# $(info ARCH is $(ARCH))
@@ -400,12 +400,12 @@ ifeq ($(DO_CHECKS), 1)
400400
#### MS: 3rd May 2023
401401
### For reasons unknown to me, the addition to CFLAGS does not work correctly if I
402402
### change this variable name "opt" to match the remaining names of "copt". Works fine
403-
### for 'clang' on OSX but not for 'gcc'. Adds the -march=native but somehow that
403+
### for 'clang' on OSX but not for 'gcc'. Adds the -march=native but somehow that
404404
### extra flag is removed when testing the -mcpu/-mtune compiler options. For the sake
405405
### of my sanity, I have accepted that this is how it shall work! Hopefully, in the future,
406-
### someone will figure out/explain *why* this behaviour is expected. It
407-
### seems more like a gcc bug to me where gcc is updating CFLAGS based on
408-
### the options on the last compile call (since cland does not show
406+
### someone will figure out/explain *why* this behaviour is expected. It
407+
### seems more like a gcc bug to me where gcc is updating CFLAGS based on
408+
### the options on the last compile call (since cland does not show
409409
### this behaviour) - MS: 3rd May, 2023
410410

411411
## TLDR: Leave this variable as "opt" while the remaining are set to "copt". Otherwise,
@@ -424,7 +424,7 @@ ifeq ($(DO_CHECKS), 1)
424424
CFLAGS += $(copt)
425425
else
426426
CFLAGS := $(filter-out $(copt), $(CFLAGS))
427-
endif
427+
endif
428428

429429
copt := -mtune=apple-m1
430430
COMPILE_OPT_SUPPORTED := $(shell $(CC) $(copt) -dM -E - < /dev/null 2>&1 1>/dev/null)
@@ -478,7 +478,7 @@ ifeq ($(DO_CHECKS), 1)
478478
MIN_PYTHON_MINOR := 7
479479

480480
MIN_NUMPY_MAJOR := 1
481-
MIN_NUMPY_MINOR := 16
481+
MIN_NUMPY_MINOR := 20
482482

483483
PYTHON_AVAIL := $(shell [ $(PYTHON_VERSION_MAJOR) -gt $(MIN_PYTHON_MAJOR) -o \( $(PYTHON_VERSION_MAJOR) -eq $(MIN_PYTHON_MAJOR) -a $(PYTHON_VERSION_MINOR) -ge $(MIN_PYTHON_MINOR) \) ] && echo true)
484484
NUMPY_AVAIL := $(shell [ $(NUMPY_VERSION_MAJOR) -gt $(MIN_NUMPY_MAJOR) -o \( $(NUMPY_VERSION_MAJOR) -eq $(MIN_NUMPY_MAJOR) -a $(NUMPY_VERSION_MINOR) -ge $(MIN_NUMPY_MINOR) \) ] && echo true)
@@ -506,14 +506,14 @@ ifeq ($(DO_CHECKS), 1)
506506
# NUMPY is available -> next step should not fail
507507
# That's why we are not checking if the NUMPY_INCL_FLAG is defined.
508508
ifeq ($(NUMPY_CHECKED), 0)
509-
export NUMPY_INCL_FLAG := $(shell $(PYTHON) -c "from __future__ import print_function; import numpy; print('-isystem ' + numpy.__path__[0] + '/core/include/numpy/')")
509+
export NUMPY_INCL_FLAG := $(shell $(PYTHON) -c "from __future__ import print_function; import numpy; print('-isystem ' + numpy.get_include())")
510510
# Take the second word -> the path (the first word is "isystem")
511511
NUMPY_INCL_PATH := $(word 2, ${NUMPY_INCL_FLAG})
512512
# Now check that the 'arrayobject.h' file is present in the
513513
# supposed numpy directory. Otherwise, compilation will fail.
514514
# The absence of the file likely indicates a missing numpy-devel
515515
# package (see issue #134 on github)
516-
NUMPY_NEEDED_HEADER_FILE := ${NUMPY_INCL_PATH}arrayobject.h
516+
NUMPY_NEEDED_HEADER_FILE := ${NUMPY_INCL_PATH}/numpy/arrayobject.h
517517
ifeq (,$(wildcard ${NUMPY_NEEDED_HEADER_FILE}))
518518
$(error Required $(ccred)numpy headers$(ccreset) are missing...stopping the compilation. You might be able to fix this by installing $(ccblue)numpy-devel$(ccreset))
519519
endif

mocks/python_bindings/_countpairs_mocks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <Python.h>
1111

1212
/* Now, include the numpy header*/
13-
#include <arrayobject.h>
13+
#include <numpy/arrayobject.h>
1414

1515
//for correlation functions
1616
#include "countpairs_rp_pi_mocks.h"

theory/python_bindings/_countpairs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <stdint.h>
1616

1717
/* Now, include the numpy header*/
18-
#include <arrayobject.h>
18+
#include <numpy/arrayobject.h>
1919

2020
//for correlation functions
2121
#include "countpairs.h"

0 commit comments

Comments
 (0)