gnu: python-distributed: Update to 2023.4.1.

* gnu/packages/python-science.scm (python-distributed): Update to 2023.4.1.
[source]: Remove snippet.
[arguments]: Update build phase 'versioneer; restore 'sanity-check phase;
simplify custom 'check phase; add 'fix-pytest-config phase; use #:test-flags.
[build-system]: Use pyproject-build-system.
[native-inputs]: Add python-importlib-metadata.
This commit is contained in:
Ricardo Wurmus 2023-05-11 15:57:19 +02:00
parent aa17958ca9
commit 4557c83a7d
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -1020,7 +1020,7 @@ (define-public python-pyglm
(define-public python-distributed (define-public python-distributed
(package (package
(name "python-distributed") (name "python-distributed")
(version "2022.05.2") (version "2023.4.1")
(source (source
(origin (origin
;; The test files are not included in the archive on pypi ;; The test files are not included in the archive on pypi
@ -1031,176 +1031,190 @@ (define-public python-distributed
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"009jrlk7kmazrd3nkl217cl3x5ddg7kw9mqdgq1z9knv5h1rm8qv")) "164xp2dxac95nngmgdhlk0vwnnvbmajqliz994bdvw72xnv1ya18"))))
;; Delete bundled copy of python-versioneer.
(snippet '(delete-file "versioneer.py"))))
(build-system pyproject-build-system) (build-system pyproject-build-system)
(arguments (arguments
'(#:phases (list
(modify-phases %standard-phases #:test-flags
(add-after 'unpack 'versioneer '(list "-x" "-m"
(lambda _ (string-append "not slow"
(invoke "versioneer" "install"))) " and not flaky"
(add-after 'unpack 'fix-references " and not gpu"
(lambda* (#:key outputs #:allow-other-keys) " and not ipython"
(substitute* '("distributed/comm/tests/test_ucx_config.py" " and not avoid_ci")
"distributed/tests/test_client.py" "-k"
"distributed/tests/test_queues.py" (string-append
"distributed/tests/test_variable.py" ;; These fail because they require network access,
"distributed/cli/tests/test_tls_cli.py" ;; specifically access to 8.8.8.8.
"distributed/cli/tests/test_dask_spec.py" "not "
"distributed/cli/tests/test_dask_worker.py" (string-join
"distributed/cli/tests/test_dask_scheduler.py") (list
(("\"dask-scheduler\"") "TestClientSecurityLoader.test_security_loader"
(format #false "\"~a/bin/dask-scheduler\"" "test_BatchedSend"
(assoc-ref outputs "out"))) "test_allowed_failures_config"
(("\"dask-worker\"") "test_async_context_manager"
(format #false "\"~a/bin/dask-worker\"" "test_async_with"
(assoc-ref outputs "out")))))) "test_client_repr_closed_sync"
;; ERROR: distributed==2022.5.2 "test_client_is_quiet_cluster_close"
;; ContextualVersionConflict (locket 0.2.0 "test_close_closed"
;; (/gnu/store/...-python-locket-0.2.0/lib/python3.9/site-packages), "test_close_fast_without_active_handlers"
;; Requirement.parse('locket>=1.0.0'), {'distributed'}) "test_close_grace_period_for_handlers"
(delete 'sanity-check) "test_close_loop_sync"
(replace 'check "test_close_properly"
(lambda* (#:key tests? #:allow-other-keys) "test_close_twice"
(when tests? "test_compression"
(substitute* "setup.cfg" "test_connection_pool"
(("ignore:There is no current event loop:DeprecationWarning" m) "test_connection_pool_close_while_connecting"
(string-append m " "test_connection_pool_detects_remote_close"
ignore:clear_current is deprecated:DeprecationWarning "test_connection_pool_outside_cancellation"
ignore:make_current is deprecated.*:DeprecationWarning"))) "test_connection_pool_remove"
(setenv "DISABLE_IPV6" "1") "test_connection_pool_respects_limit"
;; The integration tests are all problematic to some "test_connection_pool_tls"
;; degree. They either require network access or some "test_counters"
;; other setup. We only run the tests in "test_dashboard_host"
;; distributed/tests. "test_dashboard_link_cluster"
(for-each (lambda (dir) "test_dashboard_link_inproc"
(delete-file-recursively "test_deserialize_error"
(string-append "distributed/" dir "/tests"))) "test_dont_override_default_get"
(list "cli" "comm" "dashboard" "deploy" "diagnostics" "test_ensure_no_new_clients"
"http" "http/scheduler" "http/worker" "test_errors"
"protocol" "shuffle")) "test_fail_to_pickle_target_2"
(invoke "python" "-m" "pytest" "-vv" "distributed" "test_failure_doesnt_crash"
"-m" "test_file_descriptors_dont_leak"
(string-append "not slow" "test_finished"
" and not flaky" "test_freeze_batched_send"
" and not gpu" "test_get_client_functions_spawn_clusters"
" and not ipython" "test_host_uses_scheduler_protocol"
" and not avoid_ci") "test_identity_inproc"
"-k" "test_identity_tcp"
(string-append "test_large_packets_inproc"
;; These fail because they require network access, "test_locked_comm_drop_in_replacement"
;; specifically access to 8.8.8.8. "test_locked_comm_intercept_read"
"not " "test_locked_comm_intercept_write"
(string-join "test_mixing_clients_different_scheduler"
(list "test_multiple_listeners"
"TestClientSecurityLoader.test_security_loader" "test_no_dangling_asyncio_tasks"
"test_BatchedSend" "test_plugin_exception"
"test_allowed_failures_config" "test_plugin_internal_exception"
"test_async_context_manager" "test_plugin_multiple_exceptions"
"test_async_with" "test_ports"
"test_client_repr_closed_sync" "test_preload_import_time"
"test_close_closed" "test_queue_in_task"
"test_close_fast_without_active_handlers" "test_quiet_client_close"
"test_close_grace_period_for_handlers" "test_rebalance_sync"
"test_close_loop_sync" "test_repr_localcluster"
"test_close_properly" "test_require_encryption"
"test_close_twice" "test_rpc_default"
"test_compression" "test_rpc_inproc"
"test_connection_pool" "test_rpc_message_lifetime_default"
"test_connection_pool_close_while_connecting" "test_rpc_message_lifetime_inproc"
"test_connection_pool_detects_remote_close" "test_rpc_message_lifetime_tcp"
"test_connection_pool_outside_cancellation" "test_rpc_serialization"
"test_connection_pool_remove" "test_rpc_tcp"
"test_connection_pool_respects_limit" "test_rpc_tls"
"test_connection_pool_tls" "test_rpc_with_many_connections_inproc"
"test_counters" "test_rpc_with_many_connections_tcp"
"test_dashboard_host" "test_scheduler_file"
"test_dashboard_link_cluster" "test_security_dict_input_no_security"
"test_dashboard_link_inproc" "test_security_loader"
"test_deserialize_error" "test_security_loader_ignored_if_explicit_security_provided"
"test_dont_override_default_get" "test_security_loader_ignored_if_returns_none"
"test_errors" "test_send_after_stream_start"
"test_fail_to_pickle_target_2" "test_send_before_close"
"test_file_descriptors_dont_leak" "test_send_before_start"
"test_finished" "test_send_recv_args"
"test_get_client_functions_spawn_clusters" "test_send_recv_cancelled"
"test_host_uses_scheduler_protocol" "test_sending_traffic_jam"
"test_identity_inproc" "test_serializers"
"test_identity_tcp" "test_server"
"test_large_packets_inproc" "test_server_comms_mark_active_handlers"
"test_locked_comm_drop_in_replacement" "test_shutdown"
"test_locked_comm_intercept_read" "test_shutdown_localcluster"
"test_locked_comm_intercept_write" "test_teardown_failure_doesnt_crash_scheduler"
"test_multiple_listeners" "test_threadpoolworkers_pick_correct_ioloop"
"test_no_dangling_asyncio_tasks" "test_tls_listen_connect"
"test_plugin_exception" "test_tls_temporary_credentials_functional"
"test_plugin_internal_exception" "test_variable_in_task"
"test_plugin_multiple_exceptions" "test_worker_preload_text"
"test_ports" "test_worker_uses_same_host_as_nanny")
"test_preload_import_time" " and not ")
"test_queue_in_task"
"test_quiet_client_close"
"test_rebalance_sync"
"test_repr_localcluster"
"test_require_encryption"
"test_rpc_default"
"test_rpc_inproc"
"test_rpc_message_lifetime_default"
"test_rpc_message_lifetime_inproc"
"test_rpc_message_lifetime_tcp"
"test_rpc_serialization"
"test_rpc_tcp"
"test_rpc_tls"
"test_rpc_with_many_connections_inproc"
"test_rpc_with_many_connections_tcp"
"test_scheduler_file"
"test_security_dict_input_no_security"
"test_security_loader"
"test_security_loader_ignored_if_explicit_security_provided"
"test_security_loader_ignored_if_returns_none"
"test_send_after_stream_start"
"test_send_before_close"
"test_send_before_start"
"test_send_recv_args"
"test_send_recv_cancelled"
"test_sending_traffic_jam"
"test_serializers"
"test_server"
"test_server_comms_mark_active_handlers"
"test_shutdown"
"test_shutdown_localcluster"
"test_teardown_failure_doesnt_crash_scheduler"
"test_threadpoolworkers_pick_correct_ioloop"
"test_tls_listen_connect"
"test_tls_temporary_credentials_functional"
"test_variable_in_task"
"test_worker_preload_text"
"test_worker_uses_same_host_as_nanny")
" and not ")
;; These fail because it doesn't find dask[distributed] ;; These fail because it doesn't find dask[distributed]
" and not test_quiet_close_process" " and not test_quiet_close_process"
;; This one fails because of a silly assert failure: ;; There is no distributed.__git_revision__ property.
;; '2022.05.2' == '2022.5.2' " and not test_git_revision"
" and not test_version"
" and not test_git_revision"
;; These fail because the exception text format ;; The system monitor did not return a dictionary containing
;; appears to have changed. ;; "host_disk_io.read_bps".
" and not test_exception_text" " and not test_disk_config"
" and not test_worker_bad_args"
" and not test_run_spec_deserialize_fail"
;; Recursion stack failure. No idea what they ;; These fail because the exception text format
;; expected to happen. ;; appears to have changed.
" and not test_stack_overflow" " and not test_exception_text"
" and not test_worker_bad_args"
;; These tests are rather flaky ;; These tests are rather flaky
" and not test_quiet_quit_when_cluster_leaves" " and not test_quiet_quit_when_cluster_leaves"
" and not multiple_clients_restart")))))))) " and not multiple_clients_restart"))
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'versioneer
(lambda _
;; Our version of versioneer needs setup.cfg. This is adapted
;; from pyproject.toml.
(with-output-to-file "setup.cfg"
(lambda ()
(display "\
[versioneer]
VCS = git
style = pep440
versionfile_source = distributed/_version.py
versionfile_build = distributed/_version.py
tag_prefix =
parentdir_prefix = distributed-
")))
(invoke "versioneer" "install")
(substitute* "setup.py"
(("versioneer.get_version\\(\\)")
(string-append "\"" #$version "\"")))))
(add-after 'unpack 'fix-pytest-config
(lambda _
;; This option is not supported by our version of pytest.
(substitute* "pyproject.toml"
(("--cov-config=pyproject.toml.*") ""))))
(add-after 'unpack 'fix-references
(lambda* (#:key outputs #:allow-other-keys)
(substitute* '("distributed/comm/tests/test_ucx_config.py"
"distributed/tests/test_client.py"
"distributed/tests/test_queues.py"
"distributed/tests/test_variable.py"
"distributed/cli/tests/test_tls_cli.py"
"distributed/cli/tests/test_dask_spec.py"
"distributed/cli/tests/test_dask_worker.py"
"distributed/cli/tests/test_dask_scheduler.py")
(("\"dask-scheduler\"")
(format #false "\"~a/bin/dask-scheduler\"" #$output))
(("\"dask-worker\"")
(format #false "\"~a/bin/dask-worker\"" #$output)))))
(add-before 'check 'pre-check
(lambda _
(setenv "DISABLE_IPV6" "1")
;; The integration tests are all problematic to some
;; degree. They either require network access or some
;; other setup. We only run the tests in
;; distributed/tests.
(for-each (lambda (dir)
(delete-file-recursively
(string-append "distributed/" dir "/tests")))
(list "cli" "comm" "dashboard" "deploy" "diagnostics"
"http" "http/scheduler" "http/worker"
"protocol" "shuffle"))))
;; We need to use "." here.
(replace 'check
(lambda* (#:key tests? test-flags #:allow-other-keys)
(when tests?
(apply invoke "python" "-m" "pytest" "." "-vv" test-flags)))))))
(propagated-inputs (propagated-inputs
(list python-click (list python-click
python-cloudpickle python-cloudpickle
@ -1217,7 +1231,8 @@ (define-public python-distributed
python-urllib3 python-urllib3
python-zict)) python-zict))
(native-inputs (native-inputs
(list python-pytest (list python-importlib-metadata
python-pytest
python-pytest-timeout python-pytest-timeout
python-flaky python-flaky
python-versioneer)) python-versioneer))