python312Packages.pythreejs: init at 2.4.1 (#402804)

This commit is contained in:
Gaétan Lepage
2025-04-29 18:28:09 +02:00
committed by GitHub
4 changed files with 93 additions and 0 deletions
@@ -40,6 +40,17 @@ buildPythonPackage rec {
nbval
];
# Tests bind ports
__darwinAllowLocalNetworking = true;
pytestFlagsArray = [
# https://github.com/vidartf/ipydatawidgets/issues/62
"--deselect=ipydatawidgets/tests/test_ndarray_trait.py::test_dtype_coerce"
# https://github.com/vidartf/ipydatawidgets/issues/63
"--deselect=examples/test.ipynb::Cell\\\ 3"
];
meta = {
description = "Widgets to help facilitate reuse of large datasets across different widgets";
homepage = "https://github.com/vidartf/ipydatawidgets";
@@ -0,0 +1,67 @@
{
lib,
buildPythonPackage,
fetchPypi,
jupyterlab,
setuptools,
ipywidgets,
ipydatawidgets,
numpy,
traitlets,
}:
buildPythonPackage rec {
pname = "pythreejs";
version = "2.4.2";
pyproject = true;
# github sources need to invoke npm, but no package-lock.json present:
# https://github.com/jupyter-widgets/pythreejs/issues/419
src = fetchPypi {
inherit pname version;
hash = "sha256-pWi/3Ew3l8TCM5FYko7cfc9vpKJnsI487FEh4geLW9Y=";
};
build-system = [
jupyterlab
setuptools
];
# It seems pythonRelaxDeps doesn't work for these
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "jupyterlab~=" "jupyterlab>="
# https://github.com/jupyter-widgets/pythreejs/pull/420
substituteInPlace setupbase.py \
--replace-fail "import pipes" "" \
--replace-fail "pipes.quote" "shlex.quote"
'';
# Don't run npm install, all files are already where they should be present.
# If we would run npm install, npm would detect package-lock.json is an old format,
# and try to fetch more metadata from the registry, which cannot work in the sandbox.
setupPyBuildFlags = [ "--skip-npm" ];
dependencies = [
ipywidgets
ipydatawidgets
numpy
traitlets
];
# There are no tests
doCheck = false;
pythonImportsCheck = [ "pythreejs" ];
meta = {
description = "Interactive 3D graphics for the Jupyter Notebook and JupyterLab, using Three.js and Jupyter Widgets";
homepage = "https://github.com/jupyter-widgets/pythreejs";
changelog = "https://github.com/jupyter-widgets/pythreejs/releases/tag/${version}";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ flokli ];
};
}
@@ -0,0 +1,13 @@
diff --git a/setupbase.py b/setupbase.py
index 0ce0ac8..7762e23 100644
--- a/setupbase.py
+++ b/setupbase.py
@@ -659,7 +659,7 @@ def _translate_glob(pat):
translated_parts.append(_translate_glob_part(part))
os_sep_class = '[%s]' % re.escape(SEPARATORS)
res = _join_translated(translated_parts, os_sep_class)
- return '{res}\\Z(?ms)'.format(res=res)
+ return '(?ms){res}\\Z'.format(res=res)
def _join_translated(translated_parts, os_sep_class):
+2
View File
@@ -14363,6 +14363,8 @@ self: super: with self; {
pythran = callPackage ../development/python-modules/pythran { inherit (pkgs.llvmPackages) openmp; };
pythreejs = callPackage ../development/python-modules/pythreejs { };
pytibber = callPackage ../development/python-modules/pytibber { };
pytikz-allefeld = callPackage ../development/python-modules/pytikz-allefeld { };