diff --git a/pkgs/development/python-modules/gdsfactory/default.nix b/pkgs/development/python-modules/gdsfactory/default.nix new file mode 100644 index 000000000000..b2282a04a1c0 --- /dev/null +++ b/pkgs/development/python-modules/gdsfactory/default.nix @@ -0,0 +1,108 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pytestCheckHook, + flit-core, + jinja2, + loguru, + matplotlib, + numpy, + orjson, + pandas, + pydantic, + pydantic-settings, + pydantic-extra-types, + pyyaml, + qrcode, + rectpack, + rich, + scipy, + shapely, + toolz, + types-pyyaml, + typer, + kfactory, + watchdog, + freetype-py, + mapbox-earcut, + networkx, + scikit-image, + trimesh, + ipykernel, + attrs, + graphviz, + # tests + jsondiff, + jsonschema, + pytest-regressions, +}: +buildPythonPackage rec { + pname = "gdsfactory"; + version = "8.18.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "gdsfactory"; + repo = "gdsfactory"; + rev = "v${version}"; + hash = "sha256-wDz8QpRgu40FB8+otnGsHVn2e6/SWXIZgA1aeMqMhPQ="; + }; + + build-system = [ flit-core ]; + + dependencies = [ + jinja2 + loguru + matplotlib + numpy + orjson + pandas + pydantic + pydantic-settings + pydantic-extra-types + pyyaml + qrcode + rectpack + rich + scipy + shapely + toolz + types-pyyaml + typer + kfactory + watchdog + freetype-py + mapbox-earcut + networkx + scikit-image + trimesh + ipykernel + attrs + graphviz + ]; + + nativeCheckInputs = [ + jsondiff + jsonschema + pytestCheckHook + pytest-regressions + ]; + + pythonRelaxDeps = [ + "pydantic" + "trimesh" + ]; + + # tests require >32GB of RAM + doCheck = false; + + pythonImportsCheck = [ "gdsfactory" ]; + + meta = with lib; { + description = "Python library to generate GDS layouts"; + homepage = "https://github.com/gdsfactory/gdsfactory"; + license = licenses.mit; + maintainers = with maintainers; [ fbeffa ]; + }; +} diff --git a/pkgs/development/python-modules/kfactory/default.nix b/pkgs/development/python-modules/kfactory/default.nix new file mode 100644 index 000000000000..3652d517d048 --- /dev/null +++ b/pkgs/development/python-modules/kfactory/default.nix @@ -0,0 +1,77 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pytestCheckHook, + setuptools, + setuptools-scm, + klayout, + aenum, + cachetools, + gitpython, + loguru, + pydantic, + pydantic-settings, + rectangle-packer, + requests, + ruamel-yaml-string, + scipy, + tomli, + toolz, + typer, + numpy, + ruamel-yaml, +}: + +buildPythonPackage rec { + pname = "kfactory"; + version = "0.21.7"; + pyproject = true; + + src = fetchFromGitHub { + owner = "gdsfactory"; + repo = "kfactory"; + rev = "v${version}"; + sha256 = "sha256-VLhAJ5rOBKEO1FDCnlaseA+SmrMSoyS+BaEzjdHm59Y="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ + aenum + cachetools + gitpython + klayout + loguru + numpy + pydantic + pydantic-settings + rectangle-packer + requests + ruamel-yaml + ruamel-yaml-string + scipy + tomli + toolz + typer + ]; + + pythonImportsCheck = [ "kfactory" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + # https://github.com/gdsfactory/kfactory/issues/511 + disabledTestPaths = [ + "tests/test_pdk.py" + ]; + + meta = with lib; { + description = "KLayout API implementation of gdsfactory"; + homepage = "https://github.com/gdsfactory/kfactory"; + license = licenses.mit; + maintainers = with maintainers; [ fbeffa ]; + }; +} diff --git a/pkgs/development/python-modules/klayout/default.nix b/pkgs/development/python-modules/klayout/default.nix new file mode 100644 index 000000000000..a70f384459f6 --- /dev/null +++ b/pkgs/development/python-modules/klayout/default.nix @@ -0,0 +1,42 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + curl, + cython, + expat, + libpng, + setuptools, +}: + +buildPythonPackage rec { + pname = "klayout"; + version = "0.29.8"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-21EPhFb/JMZdyuHDXIxhnLTpHUPxKU24cnodH9oX2q8="; + }; + + build-system = [ + cython + setuptools + ]; + + buildInputs = [ + curl + expat + libpng + ]; + + pythonImportsCheck = [ "klayout" ]; + + meta = with lib; { + description = "KLayout’s Python API"; + homepage = "https://github.com/KLayout/klayout"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ fbeffa ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/development/python-modules/rectangle-packer/default.nix b/pkgs/development/python-modules/rectangle-packer/default.nix new file mode 100644 index 000000000000..53a58f1246b6 --- /dev/null +++ b/pkgs/development/python-modules/rectangle-packer/default.nix @@ -0,0 +1,46 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + cython, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "rectangle-packer"; + version = "2.0.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "Penlect"; + repo = "rectangle-packer"; + rev = version; + hash = "sha256-YsMLB9jfAC5yB8TnlY9j6ybXM2ILireOgQ8m8wYo4ts="; + }; + + build-system = [ + cython + setuptools + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace-fail 'Cython<3.0.0' 'Cython' + ''; + + pythonImportsCheck = [ "rpack" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + preCheck = '' + rm -r rpack + ''; + + meta = with lib; { + description = "Pack a set of rectangles into a bounding box with minimum area"; + homepage = "https://github.com/Penlect/rectangle-packer"; + license = licenses.mit; + maintainers = with maintainers; [ fbeffa ]; + }; +} diff --git a/pkgs/development/python-modules/rectpack/default.nix b/pkgs/development/python-modules/rectpack/default.nix new file mode 100644 index 000000000000..d469d7021ef3 --- /dev/null +++ b/pkgs/development/python-modules/rectpack/default.nix @@ -0,0 +1,33 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, +}: + +buildPythonPackage rec { + pname = "rectpack"; + version = "0.2.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "secnot"; + repo = "rectpack"; + rev = version; + hash = "sha256-kU0TT3wiudcLXrT+lYPYHYRtf7aNj/IKpnYKb/H91ng="; + }; + + build-system = [ setuptools ]; + + # tests are base on nose + doCheck = false; + + pythonImportsCheck = [ "rectpack" ]; + + meta = with lib; { + description = "Collection of algorithms for solving the 2D knapsack problem"; + homepage = "https://github.com/secnot/rectpack"; + license = licenses.asl20; + maintainers = with maintainers; [ fbeffa ]; + }; +} diff --git a/pkgs/development/python-modules/ruamel-yaml-string/default.nix b/pkgs/development/python-modules/ruamel-yaml-string/default.nix new file mode 100644 index 000000000000..0634359f6511 --- /dev/null +++ b/pkgs/development/python-modules/ruamel-yaml-string/default.nix @@ -0,0 +1,32 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, + ruamel-yaml, +}: + +buildPythonPackage rec { + pname = "ruamel-yaml-string"; + version = "0.1.1"; + pyproject = true; + + src = fetchPypi { + inherit version; + pname = "ruamel.yaml.string"; + hash = "sha256-enrtzAVdRcAE04t1b1hHTr77EGhR9M5WzlhBVwl4Q1A="; + }; + + build-system = [ setuptools ]; + + dependencies = [ ruamel-yaml ]; + + pythonImportsCheck = [ "ruamel.yaml" ]; + + meta = with lib; { + description = "Add dump_to_string/dumps method that returns YAML document as string"; + homepage = "https://sourceforge.net/projects/ruamel-yaml-string/"; + license = licenses.mit; + maintainers = with maintainers; [ fbeffa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index eb83597b8053..3a2387ea6454 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5207,6 +5207,8 @@ self: super: with self; { gdown = callPackage ../development/python-modules/gdown { }; + gdsfactory = callPackage ../development/python-modules/gdsfactory { }; + ge25519 = callPackage ../development/python-modules/ge25519 { }; geant4 = toPythonModule (pkgs.geant4.override { @@ -7138,6 +7140,8 @@ self: super: with self; { inherit (pkgs) keyutils; }; + kfactory = callPackage ../development/python-modules/kfactory { }; + khanaa = callPackage ../development/python-modules/khanaa {}; kicad = toPythonModule (pkgs.kicad.override { @@ -7162,6 +7166,8 @@ self: super: with self; { klaus = callPackage ../development/python-modules/klaus { }; + klayout = callPackage ../development/python-modules/klayout { }; + klein = callPackage ../development/python-modules/klein { }; kmapper = callPackage ../development/python-modules/kmapper { }; @@ -14258,6 +14264,10 @@ self: super: with self; { recordlinkage = callPackage ../development/python-modules/recordlinkage { }; + rectpack = callPackage ../development/python-modules/rectpack { }; + + rectangle-packer = callPackage ../development/python-modules/rectangle-packer { }; + recurring-ical-events = callPackage ../development/python-modules/recurring-ical-events { }; recursive-pth-loader = toPythonModule (callPackage ../development/python-modules/recursive-pth-loader { }); @@ -14684,6 +14694,8 @@ self: super: with self; { ruamel-yaml-clib = callPackage ../development/python-modules/ruamel-yaml-clib { }; + ruamel-yaml-string = callPackage ../development/python-modules/ruamel-yaml-string { }; + rubicon-objc = callPackage ../development/python-modules/rubicon-objc { }; rubymarshal = callPackage ../development/python-modules/rubymarshal { };