Skip to content

Commit

Permalink
Working on Python 3.13: argon2-cffi-bindings astropy contourpy deptha…
Browse files Browse the repository at this point in the history
…i ephem grpcio jpegio kiwisolver lameenc matplotlib pyerfa
  • Loading branch information
mhsmith committed Oct 23, 2024
1 parent 72bca42 commit 432281b
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 12 deletions.
2 changes: 1 addition & 1 deletion server/pypi/packages/astropy/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package:
name: astropy
version: "6.0.0"
version: "6.1.4"

build:
number: 0
Expand Down
30 changes: 27 additions & 3 deletions server/pypi/packages/astropy/patches/chaquopy.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
--- src-original/setup.py 2022-05-24 19:43:02.000000000 +0000
+++ src/setup.py 2023-07-24 14:54:26.328796259 +0000
@@ -4,6 +4,10 @@
--- aaa/setup.py 2024-09-26 23:30:11.000000000 +0000
+++ src/setup.py 2024-10-23 12:14:38.516825749 +0000
@@ -4,6 +4,22 @@
# NOTE: The configuration for the package, including the name, version, and
# other information are set in the pyproject.toml file.

+# Chaquopy
+import builtins
+builtins.__NUMPY_SETUP__ = True # Prevent the compiled parts from being imported.
+
+# Chaquopy: complex.h functions were introduced between API levels 23 and 26, so make
+# Cython use its own implementations instead.
+#
+# This isn't a problem with Cython's C++ mode, e.g. in qutip, presumably because libcxx
+# contains its own implementations of complex number functions in order to be compatible
+# with the minimum API level supported by the NDK. In fact, setting CYTHON_CCOMPLEX=0
+# for such a module causes Cython to generate code that passes Cython's own complex type
+# to C++ standard library functions, which obviously fails to compile. So that's why we
+# can't add this to the default CFLAGS.
+import os
+os.environ["CFLAGS"] += " -DCYTHON_CCOMPLEX=0"
+
import sys

# First provide helpful messages if contributors try and run legacy commands
--- aaa/astropy/utils/xml/src/iterparse.map 2024-09-26 23:30:11.000000000 +0000
+++ src/astropy/utils/xml/src/iterparse.map 2024-10-23 12:06:04.257576909 +0000
@@ -1,6 +1,8 @@
VERS_1.0 {
global:
- init_iterparser;
+ /* Chaquopy: this Python 2 symbol doesn't exist anymore, and ld.lld gives a
+ * "symbol not defined" error.
+ * init_iterparser; */
PyInit__iterparser;
local:
*;
2 changes: 1 addition & 1 deletion server/pypi/packages/ephem/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: ephem
version: "4.1.5"
version: "4.1.6"

build:
number: 0
2 changes: 1 addition & 1 deletion server/pypi/packages/grpcio/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See also pycares, which shares some of the same patches to c-ares.
package:
name: grpcio
version: "1.59.3"
version: "1.67.0"

build:
script_env:
Expand Down
2 changes: 1 addition & 1 deletion server/pypi/packages/kiwisolver/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: kiwisolver
version: "1.4.5"
version: "1.4.7"

build:
number: 0
2 changes: 1 addition & 1 deletion server/pypi/packages/matplotlib/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package:
name: matplotlib
version: "3.8.2"
version: "3.8.4"

build:
number: 0
Expand Down
13 changes: 13 additions & 0 deletions server/pypi/packages/matplotlib/patches/chaquopy.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
--- aaa/setup.py 2024-04-03 22:39:51.000000000 +0000
+++ src/setup.py 2024-10-23 14:42:19.219926523 +0000
@@ -156,6 +156,10 @@
if ranlib and has_flag(self.compiler, '-flto'):
for ext in self.extensions:
ext.extra_compile_args.append('-flto')
+
+ # Chaquopy: https://github.com/android/ndk/issues/2069#issuecomment-2347153515
+ ext.extra_link_args.append('-flto')
+
cppflags.append('-flto')
ldflags.append('-flto')
# Needed so FreeType static library doesn't lose its LTO objects.
--- src-original/setupext.py 2022-09-15 23:26:26.000000000 +0000
+++ src/setupext.py 2022-10-04 20:30:48.569071439 +0000
@@ -199,7 +199,7 @@
Expand Down
2 changes: 1 addition & 1 deletion server/pypi/packages/pyerfa/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package:
name: pyerfa
version: "2.0.1.1"
version: "2.0.1.4"

requirements:
host:
Expand Down
18 changes: 15 additions & 3 deletions server/pypi/packages/pyerfa/patches/chaquopy.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- src-original/setup.py 2021-11-02 19:17:42.000000000 +0000
+++ src/setup.py 2023-06-03 11:19:23.806406705 +0000
@@ -26,6 +26,10 @@
--- aaa/setup.py 2023-10-19 18:22:05.000000000 +0000
+++ src/setup.py 2024-10-23 15:52:22.725808497 +0000
@@ -39,6 +39,10 @@

@property
def include_dirs(self):
Expand All @@ -11,3 +11,15 @@
from numpy import get_include
return self._include_dirs + [get_include()]

@@ -119,7 +123,10 @@
if not os.path.exists(configure):
subprocess.run(
['./bootstrap.sh'], check=True, cwd=LIBERFADIR)
- subprocess.run(['./configure'], check=True, cwd=LIBERFADIR)
+
+ # Chaquopy: added --host (https://github.com/liberfa/pyerfa/issues/141)
+ subprocess.run(['./configure', f'--host={os.environ["HOST"]}'], check=True, cwd=LIBERFADIR)
+
except (subprocess.SubprocessError, OSError) as exc:
warn(f'unable to configure liberfa: {exc}')

0 comments on commit 432281b

Please sign in to comment.