Skip to content

Commit 027dd1f

Browse files
Merge pull request #35 from oscarbenjamin/pr_cython3
Add `__radd__` etc methods for Cython 3.x
2 parents 69b4737 + 0370688 commit 027dd1f

30 files changed

+1343
-962
lines changed

.github/workflows/buildwheel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
CIBW_BEFORE_ALL_MACOS: bin/cibw_before_all_macosx_x86_64.sh
4444
CIBW_BEFORE_ALL_WINDOWS: msys2 -c bin/cibw_before_all_windows.sh
4545
CIBW_BEFORE_BUILD_WINDOWS: msys2 -c bin/cibw_before_build_windows.sh
46-
CIBW_BEFORE_BUILD: pip install numpy cython delvewheel
46+
CIBW_BEFORE_BUILD: pip install numpy cython==3.0.0b2 delvewheel
4747
CIBW_ENVIRONMENT: >
4848
C_INCLUDE_PATH=$(pwd)/.local/include/
4949
LIBRARY_PATH=$(pwd)/.local/lib/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ MANIFEST
1515
*.egg-info
1616
.coverage
1717
*.swp
18+
.python-version

bin/build_dependencies_unix.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ do
4848
PATCH_GMP_ARM64=yes
4949
shift
5050
;;
51+
--use-gmp-github-mirror)
52+
USE_GMP_GITHUB_MIRROR=yes
53+
shift
54+
;;
5155
*)
5256
2>&1 echo "unrecognised argument:" $key
5357
exit 1
@@ -82,17 +86,22 @@ if [ $USE_GMP = "gmp" ]; then
8286
# #
8387
# ----------------------------------------------------------------------- #
8488

85-
curl -O https://gmplib.org/download/gmp/gmp-$GMPVER.tar.xz
89+
if [ $USE_GMP_GITHUB_MIRROR = "yes" ]; then
90+
# Needed in GitHub Actions because it is blocked from gmplib.org
91+
git clone https://github.com/oscarbenjamin/gmp_mirror.git
92+
cp gmp_mirror/gmp-$GMPVER.tar.xz .
93+
else
94+
curl -O https://gmplib.org/download/gmp/gmp-$GMPVER.tar.xz
95+
fi
96+
8697
tar xf gmp-$GMPVER.tar.xz
8798
cd gmp-$GMPVER
8899

89100
#
90101
# See https://github.com/aleaxit/gmpy/issues/350
91102
#
92-
# We need to patch GMP for OSX arm64 (Apple M1) hardware. This patch is
93-
# from the GMP repo but was applied after the release of GMP 6.2.1.
94-
# Hopefully when a newer version of GMP is released we will not need to
95-
# apply this patch any more.
103+
# We need to patch GMP for OSX arm64 (Apple M1) hardware for GMP 6.2.1.
104+
# Now with GMP 6.3.0 this should not be needed any more.
96105
#
97106
if [ $PATCH_GMP_ARM64 = "yes" ]; then
98107
echo
@@ -103,6 +112,7 @@ if [ $USE_GMP = "gmp" ]; then
103112
fi
104113

105114
# Show the output of configfsf.guess
115+
chmod +x configfsf.guess
106116
./configfsf.guess
107117
./configure --prefix=$PREFIX\
108118
--enable-fat\

bin/build_variables.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
PREFIX=$(pwd)/.local
1414
mkdir -p $PREFIX
1515

16-
GMPVER=6.2.1
16+
GMPVER=6.3.0
1717
YASMVER=1.3.0
1818
MPIRVER=3.0.0
1919
MPFRVER=4.1.0

bin/cibw_before_all_linux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
yum install -y xz
44
bin/build_dependencies_unix.sh\
55
--gmp gmp\
6-
--host x86_64-pc-linux-gnu
6+
--host x86_64-pc-linux-gnu\
7+
--use-gmp-github-mirror

bin/cibw_before_all_macosx_arm64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export LDFLAGS=" -arch arm64"
66
bin/build_dependencies_unix.sh\
77
--gmp gmp\
88
--host aarch64-apple-darwin\
9-
--patch-gmp-arm64
9+
--use-gmp-github-mirror

bin/cibw_before_all_macosx_x86_64.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
bin/build_dependencies_unix.sh\
44
--gmp gmp\
5-
--host x86_64-apple-darwin
5+
--host x86_64-apple-darwin\
6+
--use-gmp-github-mirror

bin/cibw_before_all_windows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ cat setup.cfg
1717
pacman -S --noconfirm mingw-w64-x86_64-gcc m4 make mingw-w64-x86_64-tools-git
1818

1919
# This takes ~30mins
20-
bin/build_dependencies_unix.sh
20+
bin/build_dependencies_unix.sh --use-gmp-github-mirror

bin/cibw_before_build_windows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ mv libpython${VER}.a libs
4040
# Install build dependencies #
4141
###################################################
4242

43-
pip install Cython numpy delvewheel
43+
pip install cython numpy delvewheel

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@
4545

4646

4747
define_macros = []
48-
compiler_directives = {'language_level':3}
48+
compiler_directives = {
49+
'language_level': 3,
50+
'binding': False,
51+
}
4952

5053

5154
# Enable coverage tracing

0 commit comments

Comments
 (0)