2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
isPyPy,
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build-system
|
|
|
|
cython,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
|
|
|
packaging,
|
|
|
|
cffi,
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# dependencies
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
py,
|
|
|
|
pytestCheckHook,
|
|
|
|
python,
|
|
|
|
pythonOlder,
|
|
|
|
tornado,
|
|
|
|
zeromq,
|
|
|
|
pytest-asyncio,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyzmq";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "25.1.2";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2022-06-26 10:26:21 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-k/GqMR6LuRLjTwBM8YZAek6Q7sTw7MDv0mBWv37aAiY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
packaging
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ (if isPyPy then [ cffi ] else [ cython ]);
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [ zeromq ];
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = lib.optionals isPyPy [ cffi ];
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-11-06 00:33:48 +00:00
|
|
|
pytestCheckHook
|
|
|
|
tornado
|
2023-11-16 04:20:00 +00:00
|
|
|
pytest-asyncio
|
2020-11-06 00:33:48 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "zmq" ];
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"$out/${python.sitePackages}/zmq/tests/" # Folder with tests
|
2023-11-16 04:20:00 +00:00
|
|
|
# pytest.ini is missing in pypi's sdist
|
|
|
|
# https://github.com/zeromq/pyzmq/issues/1853#issuecomment-1592731986
|
|
|
|
"--asyncio-mode auto"
|
2024-01-13 08:15:51 +00:00
|
|
|
"--ignore=$out/lib/python3.12/site-packages/zmq/tests/test_mypy.py"
|
2020-11-06 00:33:48 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Tests hang
|
|
|
|
"test_socket"
|
|
|
|
"test_monitor"
|
|
|
|
# https://github.com/zeromq/pyzmq/issues/1272
|
|
|
|
"test_cython"
|
|
|
|
# Test fails
|
|
|
|
"test_mockable"
|
|
|
|
# Issues with the sandbox
|
|
|
|
"TestFutureSocket"
|
|
|
|
"TestIOLoop"
|
|
|
|
"TestPubLog"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Some of the tests use localhost networking.
|
|
|
|
__darwinAllowLocalNetworking = true;
|
2022-06-26 10:26:21 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for ØMQ";
|
|
|
|
homepage = "https://pyzmq.readthedocs.io/";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = with licenses; [
|
|
|
|
bsd3 # or
|
|
|
|
lgpl3Only
|
|
|
|
];
|
2022-06-26 10:26:21 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|