Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pkgs/development/python-modules/ipydatawidgets/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
67 changes: 67 additions & 0 deletions pkgs/development/python-modules/pythreejs/default.nix
Original file line number Diff line number Diff line change
@@ -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>="
Comment thread
flokli marked this conversation as resolved.
Outdated

# 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 ];
};
}
13 changes: 13 additions & 0 deletions pkgs/development/python-modules/pythreejs/fix-re.error.patch
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down