gnu: python-plotly: Improve package.

* gnu/packages/graph.scm (python-plotly): Simplify and improve package.
  [build-system]: Use pyproject.
  [arguments] <test-flags>: Utilize it and skip only problematic tests
  which miss some packages, requiring networking or fail abnormaly.
  <phases>: Use default 'check.
  [propagated-inputs]: Remove python-six; add python-scikit-image and
  python-vaex-core.
  [native-inputs]: Add python-setuptools and python-wheel.

Change-Id: I4fefedbbf3e9180b07b40252fb8fb89f49983dbd
This commit is contained in:
Sharlatan Hellseher 2025-07-05 22:51:36 +01:00
parent 265541b912
commit 502b3d9dd6
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -310,15 +310,55 @@ lines.")
(source (origin (source (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://github.com/plotly/plotly.py") (url "https://github.com/plotly/plotly.py")
(commit (string-append "v" version)))) (commit (string-append "v" version))))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"0i22sv8p3kl84nkldbv1253kld85rbwp2pdxivxn64wwflfpqvx6")))) "0i22sv8p3kl84nkldbv1253kld85rbwp2pdxivxn64wwflfpqvx6"))))
(build-system python-build-system) (build-system pyproject-build-system)
(arguments (arguments
(list (list
#:test-flags
;; 2658 passed, 18 skipped, 38 deselected, 574 warnings
#~(list "-k" (string-join
;; python-polars is not packaged yet.
(list "not test_build_df_from_vaex_and_polars"
"test_build_df_with_hover_data_from_vaex_and_polars"
;; ValueError
"test_bytesio"
"test_ensure_orca_ping_and_proc"
"test_kaleido_engine_to_image_returns_bytes"
"test_kaleido_fulljson"
"test_latex_fig_to_image[eps]"
"test_mimetype_combination"
"test_orca_version_number"
"test_pdf_renderer_show_override"
"test_png_renderer_mimetype"
"test_problematic_environment_variables[eps]"
"test_server_timeout_shutdown"
"test_simple_to_image[eps]"
"test_svg_renderer_show"
"test_to_image_default[eps]"
"test_topojson_fig_to_image[eps]"
"test_validate_orca"
"test_write_image_string[eps]"
"test_write_image_string_bad_extension_override"
"test_write_image_string_format_inference[eps]"
"test_write_image_writeable[eps]"
;; XXX: check why these tests fail
"test_dependencies_not_imported"
"test_external_server_url"
"test_invalid_figure_json"
"test_lazy_imports"
"test_legend_dots"
"test_linestyle"
"test_orca_executable_path"
"test_sanitize_json[auto]"
"test_sanitize_json[json]"
"test_scraper"
"test_write_image_string_bad_extension_failure")
" and not "))
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-before 'build 'skip-npm (add-before 'build 'skip-npm
@ -338,26 +378,24 @@ lines.")
(format #f "__version__ = ~s" #$version))))) (format #f "__version__ = ~s" #$version)))))
(add-after 'fix-version 'chdir (add-after 'fix-version 'chdir
(lambda _ (lambda _
(chdir "packages/python/plotly"))) (chdir "packages/python/plotly"))))))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(invoke "pytest" "-x" "plotly/tests/test_core")
(invoke "pytest" "-x" "plotly/tests/test_io")
;; FIXME: Add optional dependencies and enable their tests.
;; (invoke "pytest" "-x" "plotly/tests/test_optional")
(invoke "pytest" "_plotly_utils/tests")))))))
(native-inputs (native-inputs
(list python-ipywidgets python-pytest python-xarray)) (list python-ipywidgets
python-pytest
python-setuptools
python-wheel
python-xarray))
(propagated-inputs (propagated-inputs
(list python-ipython (list python-ipython
python-pandas python-pandas
python-pillow python-pillow
;; python-polars
python-requests python-requests
python-retrying python-retrying
python-six python-scikit-image
python-statsmodels
python-tenacity python-tenacity
python-statsmodels)) python-vaex-core))
(home-page "https://plotly.com/python/") (home-page "https://plotly.com/python/")
(synopsis "Interactive plotting library for Python") (synopsis "Interactive plotting library for Python")
(description "Plotly's Python graphing library makes interactive, (description "Plotly's Python graphing library makes interactive,