Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary mismatch between p4p 4.1.5 + numpy 1.24.2 in Python 3.8 #102

Open
AlexanderWells-diamond opened this issue Apr 12, 2023 · 1 comment
Assignees
Labels

Comments

@AlexanderWells-diamond
Copy link
Contributor

When trying to use numpy 1.24.2 alongside p4p 4.1.5 I see the following two warnings (which pytest is elevating to errors) in my tests:

___________________ ERROR collecting tests/test_pvaccess.py ____________________
Traceback (most recent call last):
  File "/home/eyh46967/dev/PandABlocks-ioc/tests/test_pvaccess.py", line 8, in <module>
    from p4p import Value
  File "/home/eyh46967/dev/PandABlocks-ioc/venv/lib64/python3.8/site-packages/p4p/__init__.py", line 14, in <module>
    from .wrapper import Value, Type
  File "/home/eyh46967/dev/PandABlocks-ioc/venv/lib64/python3.8/site-packages/p4p/wrapper.py", line 5, in <module>
    from . import _p4p
  File "__init__.pxd", line 918, in init p4p._p4p
RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 232 from PyObject
___________________ ERROR collecting tests/test_pvaccess.py ____________________
Traceback (most recent call last):
  File "/home/eyh46967/dev/PandABlocks-ioc/tests/test_pvaccess.py", line 8, in <module>
    from p4p import Value
  File "/home/eyh46967/dev/PandABlocks-ioc/venv/lib64/python3.8/site-packages/p4p/__init__.py", line 14, in <module>
    from .wrapper import Value, Type
  File "/home/eyh46967/dev/PandABlocks-ioc/venv/lib64/python3.8/site-packages/p4p/wrapper.py", line 5, in <module>
    from . import _p4p
  File "src/p4p/_p4p.pyx", line 599, in init p4p._p4p
AttributeError: type object 'p4p._p4p.ClientProvider' has no attribute '__reduce_cython__'

If I downgrade the numpy version to 1.21.6 then this warning disappears. Alternatively, if I upgrade to Python 3.10 this warning also disappears.

Does this mean that p4p has an implicit dependency on a particular numpy version, or is this warning on this version innocuous and can be safely added to an ignore list?

@mdavidsaver
Copy link
Member

I have a suspicion that the situation being addressed in numpy/numpy@3a81135 is relevant. In particular, the condition for numpy >= 1.22.0 fits into the version range you mention.

At core, I guess my understanding of managing numpy ABI compatibility needs to be revised. Ideally, this would be translated into install_requires=[] for wheel files a la. epicscorelibs.version.abi_requires(). However, I worry that this won't be straightforward, or forward compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants