Skip to content

Commit 1ba4291

Browse files
authored
Merge pull request #26 from CellProfiler/404
Fix numpy deprecations and bump
2 parents 79c1a91 + 2a5f6ca commit 1ba4291

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

.github/workflows/python-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python
1818
uses: actions/setup-python@v2
1919
with:
20-
python-version: '3.x'
20+
python-version: '3.9'
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip

_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)