Skip to content

Commit 3c20069

Browse files
committed
Fix numpy deprecations and bump
1 parent 79c1a91 commit 3c20069

4 files changed

Lines changed: 11 additions & 13 deletions

File tree

_javabridge.pyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import numpy as np
1414
import sys
1515
import threading
1616
cimport numpy as np
17+
np.import_array()
1718
cimport cython
1819
cimport _javabridge_osspecific
1920
cimport cpython
@@ -43,11 +44,8 @@ cdef extern from "numpy/arrayobject.h":
4344
cdef char *data
4445
cdef Py_intptr_t *dimensions
4546
cdef Py_intptr_t *strides
46-
cdef void import_array()
4747
cdef int PyArray_ITEMSIZE(np.ndarray)
4848

49-
import_array()
50-
5149
cdef extern from "jni.h":
5250
enum:
5351
JNI_VERSION_1_4

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "cython<3", "numpy>=1.24.0,<2"]
3+
build-backend = "setuptools.build_meta"

requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def ext_modules():
115115
# Build libjvm from jvm.dll on Windows.
116116
# This assumes that we're using mingw32 for build
117117
#
118-
# generate the jvm.def file matching to the jvm.dll
118+
# generate the jvm.def file matching to the jvm.dll
119119
cmd = ["gendef", os.path.join(jdk_home,"jre\\bin\\server\\jvm.dll")]
120120
p = subprocess.Popen(cmd)
121121
p.communicate()
@@ -381,7 +381,7 @@ def get_version():
381381
os.chdir(os.path.dirname(__file__))
382382

383383
setup(name="python-javabridge",
384-
version="4.0.3",
384+
version="4.0.4",
385385
description="Python wrapper for the Java Native Interface",
386386
long_description='''The python-javabridge package makes it easy to start a Java virtual
387387
machine (JVM) from Python and interact with it. Python code can
@@ -398,12 +398,12 @@ def get_version():
398398
],
399399
license='BSD License',
400400
setup_requires=[
401-
'Cython>=0.29.16',
402-
'numpy>=1.20.1',
403-
],
401+
'Cython>=0.29.16,<3',
402+
'numpy<2',
403+
],
404404
install_requires=[
405-
'numpy>=1.20.1',
406-
],
405+
'numpy>=1.20.1,<2',
406+
],
407407
tests_require="nose",
408408
entry_points={'nose.plugins.0.10': [
409409
'javabridge = javabridge.noseplugin:JavabridgePlugin'

0 commit comments

Comments
 (0)