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,58 +1031,12 @@ (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"
(list
#:test-flags
'(list "-x" "-m"
(string-append "not slow"
" and not flaky"
" and not gpu"
@ -1101,6 +1055,7 @@ (define-public python-distributed
"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"
@ -1121,10 +1076,13 @@ (define-public python-distributed
"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"
@ -1133,6 +1091,7 @@ (define-public python-distributed
"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"
@ -1183,24 +1142,79 @@ (define-public python-distributed
;; 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"
;; There is no distributed.__git_revision__ property.
" and not test_git_revision"
;; The system monitor did not return a dictionary containing
;; "host_disk_io.read_bps".
" and not test_disk_config"
;; 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"
;; Recursion stack failure. No idea what they
;; expected to happen.
" and not test_stack_overflow"
;; These tests are rather flaky
" 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
(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))