From 8a24117280900b438b8de1a8cc4d1671feeedfaf Mon Sep 17 00:00:00 2001 From: clement Date: Sat, 4 Jan 2025 20:48:38 +0100 Subject: [PATCH] python312Packages.pygerber: init at 2.4.2 --- .../python-modules/pygerber/default.nix | 105 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 107 insertions(+) create mode 100644 pkgs/development/python-modules/pygerber/default.nix diff --git a/pkgs/development/python-modules/pygerber/default.nix b/pkgs/development/python-modules/pygerber/default.nix new file mode 100644 index 00000000000000..3c758700851f56 --- /dev/null +++ b/pkgs/development/python-modules/pygerber/default.nix @@ -0,0 +1,105 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + # build-system + poetry-core, + + # dependencies + numpy, + click, + pillow, + pydantic, + pyparsing, + typing-extensions, + + # optional dependencies + pygls, + lsprotocol, + drawsvg, + pygments, + shapely, + + # test + filelock, + dulwich, + tzlocal, + pytest-xdist, + pytest-cov, + pytest-lsp, + pytest-asyncio, + pytest-mock, + pytestCheckHook, + +}: + +buildPythonPackage rec { + pname = "pygerber"; + version = "2.4.2"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "Argmaster"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-N+9I59WiWXSXr7RrPzb7GFSqfjrd0q51AzalNFV4xEQ="; + }; + + build-system = [ poetry-core ]; + dependencies = [ + numpy + click + pillow + pydantic + pyparsing + typing-extensions + ]; + + passthru.optional-dependencies = { + language_server = [ + pygls + lsprotocol + ]; + svg = [ drawsvg ]; + pygments = [ pygments ]; + shapely = [ shapely ]; + all = [ + pygls + lsprotocol + drawsvg + pygments + shapely + ]; + }; + + nativeCheckInputs = [ + pytest-asyncio + pytest-cov + pytest-xdist + pytest-lsp + pytest-mock + pytestCheckHook + tzlocal + drawsvg + dulwich + filelock + ]; + + disabledTestPaths = [ + "test/gerberx3/test_assets.py" + "test/gerberx3/test_language_server/tests.py" + ]; + + pythonImportsCheck = [ "pygerber" ]; + + meta = { + description = "Implementation of the Gerber X3/X2 format, based on Ucamco's The Gerber Layer Format Specification"; + homepage = "https://github.com/Argmaster/pygerber"; + changelog = "https://argmaster.github.io/pygerber/stable/Changelog.html"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ clemjvdm ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5dfba3db45659d..a213f0ad897f92 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10414,6 +10414,8 @@ self: super: with self; { pygelf = callPackage ../development/python-modules/pygelf { }; + pygerber = callPackage ../development/python-modules/pygerber { }; + pygments-style-github = callPackage ../development/python-modules/pygments-style-github { }; pygnmi = callPackage ../development/python-modules/pygnmi { };