From 9679d5c14347614319a0df444398ae4baa7afe17 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Sat, 18 Oct 2025 10:49:13 -0400 Subject: [PATCH] python313Packages.pygls_2: init at 2.0.0 --- .../pygls/{default.nix => 1.nix} | 15 ++-- pkgs/development/python-modules/pygls/2.nix | 72 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 10 ++- 3 files changed, 85 insertions(+), 12 deletions(-) rename pkgs/development/python-modules/pygls/{default.nix => 1.nix} (82%) create mode 100644 pkgs/development/python-modules/pygls/2.nix diff --git a/pkgs/development/python-modules/pygls/default.nix b/pkgs/development/python-modules/pygls/1.nix similarity index 82% rename from pkgs/development/python-modules/pygls/default.nix rename to pkgs/development/python-modules/pygls/1.nix index 935a373cd9b5..830f177f81f1 100644 --- a/pkgs/development/python-modules/pygls/default.nix +++ b/pkgs/development/python-modules/pygls/1.nix @@ -10,7 +10,6 @@ pythonOlder, typeguard, websockets, - nix-update-script, }: buildPythonPackage rec { @@ -60,19 +59,13 @@ buildPythonPackage rec { pythonImportsCheck = [ "pygls" ]; - passthru.updateScript = nix-update-script { - extraArgs = [ - # Skips pre-releases - "--version-regex" - "^v([0-9.]+)$" - ]; - }; + passthru.skipBulkUpdate = true; - meta = with lib; { + meta = { description = "Pythonic generic implementation of the Language Server Protocol"; homepage = "https://github.com/openlawlibrary/pygls"; changelog = "https://github.com/openlawlibrary/pygls/blob/${version}/CHANGELOG.md"; - license = licenses.asl20; - maintainers = with maintainers; [ kira-bruneau ]; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ kira-bruneau ]; }; } diff --git a/pkgs/development/python-modules/pygls/2.nix b/pkgs/development/python-modules/pygls/2.nix new file mode 100644 index 000000000000..7cde9005c746 --- /dev/null +++ b/pkgs/development/python-modules/pygls/2.nix @@ -0,0 +1,72 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + attrs, + cattrs, + lsprotocol, + websockets, + pytest-asyncio, + pytestCheckHook, + nix-update-script, +}: + +buildPythonPackage rec { + pname = "pygls"; + version = "2.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "openlawlibrary"; + repo = "pygls"; + tag = "v${version}"; + hash = "sha256-dQLK18EACiN+DpWp81Vgaan0mwtifhrmH4xwkqttKvg="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + attrs + cattrs + lsprotocol + ]; + + optional-dependencies = { + ws = [ websockets ]; + }; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + # Fixes hanging tests on Darwin + __darwinAllowLocalNetworking = true; + + preCheck = lib.optionalString stdenv.hostPlatform.isDarwin '' + # Darwin issue: OSError: [Errno 24] Too many open files + ulimit -n 1024 + ''; + + pythonImportsCheck = [ "pygls" ]; + + passthru.updateScript = nix-update-script { + extraArgs = [ + # Skips pre-releases + "--version-regex" + "^v([0-9.]+)$" + ]; + }; + + meta = { + description = "Pythonic generic implementation of the Language Server Protocol"; + homepage = "https://github.com/openlawlibrary/pygls"; + changelog = "https://github.com/openlawlibrary/pygls/blob/${version}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ kira-bruneau ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 99a8ce5fcd78..d05e8fd820b7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13130,7 +13130,15 @@ self: super: with self; { pyglossary = callPackage ../development/python-modules/pyglossary { }; - pygls = callPackage ../development/python-modules/pygls { }; + pygls = pygls_1; + + pygls_1 = callPackage ../development/python-modules/pygls/1.nix { + lsprotocol = lsprotocol_2023; + }; + + pygls_2 = callPackage ../development/python-modules/pygls/2.nix { + lsprotocol = lsprotocol_2025; + }; pygltflib = callPackage ../development/python-modules/pygltflib { };