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
(package
(name "python-distributed")
(version "2022.05.2")
(version "2023.4.1")
(source
(origin
;; 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))
(sha256
(base32
"009jrlk7kmazrd3nkl217cl3x5ddg7kw9mqdgq1z9knv5h1rm8qv"))
;; Delete bundled copy of python-versioneer.
(snippet '(delete-file "versioneer.py"))))
"164xp2dxac95nngmgdhlk0vwnnvbmajqliz994bdvw72xnv1ya18"))))
(build-system pyproject-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'versioneer
(lambda _
(invoke "versioneer" "install")))
(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\""
(assoc-ref outputs "out")))
(("\"dask-worker\"")
(format #false "\"~a/bin/dask-worker\""
(assoc-ref outputs "out"))))))
;; ERROR: distributed==2022.5.2
;; ContextualVersionConflict (locket 0.2.0
;; (/gnu/store/...-python-locket-0.2.0/lib/python3.9/site-packages),
;; Requirement.parse('locket>=1.0.0'), {'distributed'})
(delete 'sanity-check)
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(substitute* "setup.cfg"
(("ignore:There is no current event loop:DeprecationWarning" m)
(string-append m "
ignore:clear_current is deprecated:DeprecationWarning
ignore:make_current is deprecated.*:DeprecationWarning")))
(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"))
(invoke "python" "-m" "pytest" "-vv" "distributed"
"-m"
(string-append "not slow"
" and not flaky"
" and not gpu"
" and not ipython"
" and not avoid_ci")
"-k"
(string-append
;; These fail because they require network access,
;; specifically access to 8.8.8.8.
"not "
(string-join
(list
"TestClientSecurityLoader.test_security_loader"
"test_BatchedSend"
"test_allowed_failures_config"
"test_async_context_manager"
"test_async_with"
"test_client_repr_closed_sync"
"test_close_closed"
"test_close_fast_without_active_handlers"
"test_close_grace_period_for_handlers"
"test_close_loop_sync"
"test_close_properly"
"test_close_twice"
"test_compression"
"test_connection_pool"
"test_connection_pool_close_while_connecting"
"test_connection_pool_detects_remote_close"
"test_connection_pool_outside_cancellation"
"test_connection_pool_remove"
"test_connection_pool_respects_limit"
"test_connection_pool_tls"
"test_counters"
"test_dashboard_host"
"test_dashboard_link_cluster"
"test_dashboard_link_inproc"
"test_deserialize_error"
"test_dont_override_default_get"
"test_errors"
"test_fail_to_pickle_target_2"
"test_file_descriptors_dont_leak"
"test_finished"
"test_get_client_functions_spawn_clusters"
"test_host_uses_scheduler_protocol"
"test_identity_inproc"
"test_identity_tcp"
"test_large_packets_inproc"
"test_locked_comm_drop_in_replacement"
"test_locked_comm_intercept_read"
"test_locked_comm_intercept_write"
"test_multiple_listeners"
"test_no_dangling_asyncio_tasks"
"test_plugin_exception"
"test_plugin_internal_exception"
"test_plugin_multiple_exceptions"
"test_ports"
"test_preload_import_time"
"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 ")
(list
#:test-flags
'(list "-x" "-m"
(string-append "not slow"
" and not flaky"
" and not gpu"
" and not ipython"
" and not avoid_ci")
"-k"
(string-append
;; These fail because they require network access,
;; specifically access to 8.8.8.8.
"not "
(string-join
(list
"TestClientSecurityLoader.test_security_loader"
"test_BatchedSend"
"test_allowed_failures_config"
"test_async_context_manager"
"test_async_with"
"test_client_repr_closed_sync"
"test_client_is_quiet_cluster_close"
"test_close_closed"
"test_close_fast_without_active_handlers"
"test_close_grace_period_for_handlers"
"test_close_loop_sync"
"test_close_properly"
"test_close_twice"
"test_compression"
"test_connection_pool"
"test_connection_pool_close_while_connecting"
"test_connection_pool_detects_remote_close"
"test_connection_pool_outside_cancellation"
"test_connection_pool_remove"
"test_connection_pool_respects_limit"
"test_connection_pool_tls"
"test_counters"
"test_dashboard_host"
"test_dashboard_link_cluster"
"test_dashboard_link_inproc"
"test_deserialize_error"
"test_dont_override_default_get"
"test_ensure_no_new_clients"
"test_errors"
"test_fail_to_pickle_target_2"
"test_failure_doesnt_crash"
"test_file_descriptors_dont_leak"
"test_finished"
"test_freeze_batched_send"
"test_get_client_functions_spawn_clusters"
"test_host_uses_scheduler_protocol"
"test_identity_inproc"
"test_identity_tcp"
"test_large_packets_inproc"
"test_locked_comm_drop_in_replacement"
"test_locked_comm_intercept_read"
"test_locked_comm_intercept_write"
"test_mixing_clients_different_scheduler"
"test_multiple_listeners"
"test_no_dangling_asyncio_tasks"
"test_plugin_exception"
"test_plugin_internal_exception"
"test_plugin_multiple_exceptions"
"test_ports"
"test_preload_import_time"
"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]
" and not test_quiet_close_process"
;; These fail because it doesn't find dask[distributed]
" and not test_quiet_close_process"
;; This one fails because of a silly assert failure:
;; '2022.05.2' == '2022.5.2'
" and not test_version"
" and not test_git_revision"
;; There is no distributed.__git_revision__ property.
" and not test_git_revision"
;; These fail because the exception text format
;; appears to have changed.
" and not test_exception_text"
" and not test_worker_bad_args"
" and not test_run_spec_deserialize_fail"
;; The system monitor did not return a dictionary containing
;; "host_disk_io.read_bps".
" and not test_disk_config"
;; Recursion stack failure. No idea what they
;; expected to happen.
" and not test_stack_overflow"
;; These fail because the exception text format
;; appears to have changed.
" and not test_exception_text"
" and not test_worker_bad_args"
;; These tests are rather flaky
" and not test_quiet_quit_when_cluster_leaves"
" and not multiple_clients_restart"))))))))
;; These tests are rather flaky
" and not test_quiet_quit_when_cluster_leaves"
" 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
(list python-click
python-cloudpickle
@ -1217,7 +1231,8 @@ (define-public python-distributed
python-urllib3
python-zict))
(native-inputs
(list python-pytest
(list python-importlib-metadata
python-pytest
python-pytest-timeout
python-flaky
python-versioneer))