From 6a90ca767f142789427b278761622215ba90871f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 26 Feb 2024 18:31:11 +0100 Subject: [PATCH 1/2] python312Packages.ws4py: refactor --- .../python-modules/ws4py/default.nix | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/ws4py/default.nix b/pkgs/development/python-modules/ws4py/default.nix index 6a1cde0a1a90..59dab76820c9 100644 --- a/pkgs/development/python-modules/ws4py/default.nix +++ b/pkgs/development/python-modules/ws4py/default.nix @@ -1,27 +1,53 @@ -{ lib, buildPythonPackage, fetchPypi, pytest, mock, git -, cherrypy, gevent, tornado }: +{ lib +, buildPythonPackage +, cherrypy +, fetchPypi +, gevent +, git +, mock +, pytestCheckHook +, pythonOlder +, setuptools +, tornado +}: buildPythonPackage rec { pname = "ws4py"; version = "0.5.1"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "29d073d7f2e006373e6a848b1d00951a1107eb81f3742952be905429dc5a5483"; + hash = "sha256-KdBz1/LgBjc+aoSLHQCVGhEH64HzdClSvpBUKdxaVIM="; }; - nativeCheckInputs = [ pytest mock git ]; - propagatedBuildInputs = [ cherrypy gevent tornado ]; + nativeBuildInputs = [ + setuptools + ]; - checkPhase = '' - pytest - ''; + propagatedBuildInputs = [ + cherrypy + gevent + tornado + ]; + + nativeCheckInputs = [ + git + mock + pytestCheckHook + ]; + + pythonImportsCheck = [ + "ws4py" + ]; meta = with lib; { - homepage = "https://ws4py.readthedocs.org"; description = "A WebSocket package for Python"; - maintainers = []; + homepage = "https://ws4py.readthedocs.org"; + changelog = "https://github.com/Lawouach/WebSocket-for-Python/blob/${version}/CHANGELOG.md"; license = licenses.bsd3; + maintainers = with maintainers; [ ]; }; } From 991d80f11ae2c1e0f9762327eec5d86e3521241f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 8 Mar 2024 10:57:00 +0100 Subject: [PATCH 2/2] python311Packages.pylxd: refactor --- .../python-modules/pylxd/default.nix | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/pylxd/default.nix b/pkgs/development/python-modules/pylxd/default.nix index ee860eb6f105..3d94d0db3599 100644 --- a/pkgs/development/python-modules/pylxd/default.nix +++ b/pkgs/development/python-modules/pylxd/default.nix @@ -1,35 +1,51 @@ { lib , buildPythonPackage -, fetchFromGitHub , cryptography -, python-dateutil -, requests -, requests-toolbelt -, requests-unixsocket -, ws4py , ddt +, fetchFromGitHub , mock-services , pytestCheckHook +, python-dateutil +, pythonOlder +, requests +, urllib3 +, pythonRelaxDepsHook +, requests-toolbelt +, requests-unixsocket +, setuptools +, ws4py }: buildPythonPackage rec { pname = "pylxd"; version = "2.3.2"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.8"; src = fetchFromGitHub { - owner = "lxc"; + owner = "canonica"; repo = "pylxd"; rev = "refs/tags/${version}"; hash = "sha256-Q4GMz7HFpJNPYlYgLhE0a7mVCwNpdbw4XVcUGQ2gUJ0="; }; + pythonRelaxDeps = [ + "urllib3" + ]; + + nativeBuildInputs = [ + pythonRelaxDepsHook + setuptools + ]; + propagatedBuildInputs = [ cryptography python-dateutil requests requests-toolbelt requests-unixsocket + urllib3 ws4py ]; @@ -44,11 +60,14 @@ buildPythonPackage rec { "migration" ]; - pythonImportsCheck = [ "pylxd" ]; + pythonImportsCheck = [ + "pylxd" + ]; meta = with lib; { - description = "A Python library for interacting with the LXD REST API"; - homepage = "https://pylxd.readthedocs.io/en/latest/"; + description = "Library for interacting with the LXD REST API"; + homepage = "https://pylxd.readthedocs.io/"; + changelog = "https://github.com/canonical/pylxd/releases/tag/${version}"; license = licenses.asl20; maintainers = with maintainers; [ ]; };