From e1eb67dc93120577a80d2bab0fbebe885cb9b140 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 16 Nov 2024 12:33:42 +0100 Subject: [PATCH 1/3] python312Packages.cement: 3.0.10 -> 3.0.12 Diff: datafolklabs/cement@refs/tags/3.0.10...3.0.12 Changelog: https://github.com/datafolklabs/cement/blob/3.0.12/CHANGELOG.md --- .../python-modules/cement/default.nix | 71 ++++++++++++++++--- 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/cement/default.nix b/pkgs/development/python-modules/cement/default.nix index a3a131c8b8af..c16e9490b42e 100644 --- a/pkgs/development/python-modules/cement/default.nix +++ b/pkgs/development/python-modules/cement/default.nix @@ -1,33 +1,82 @@ { lib, buildPythonPackage, - fetchPypi, + colorlog, + fetchFromGitHub, + jinja2, + mock, + pdm-backend, + pylibmc, + pystache, + pytest-cov-stub, + pytestCheckHook, pythonOlder, + pyyaml, + redis, + requests, + tabulate, + watchdog, }: buildPythonPackage rec { pname = "cement"; - version = "3.0.10"; - format = "setuptools"; + version = "3.0.12"; + pyproject = true; - disabled = pythonOlder "3.5"; + disabled = pythonOlder "3.8"; - src = fetchPypi { - inherit pname version; - hash = "sha256-c9EBXr+bjfE+a8mH7fDUvj8ci0Q4kh7qjWbLtVBK7hU="; + src = fetchFromGitHub { + owner = "datafolklabs"; + repo = "cement"; + rev = "refs/tags/${version}"; + hash = "sha256-weBqmNEjeSh5YQfHK48VVFW3UbZQmV4MiIQ3UPQKTTI="; }; - # Disable test tests since they depend on a memcached server running on - # 127.0.0.1:11211. - doCheck = false; + build-system = [ pdm-backend ]; + + optional-dependencies = { + colorlog = [ colorlog ]; + jinja2 = [ jinja2 ]; + mustache = [ pystache ]; + generate = [ pyyaml ]; + redis = [ redis ]; + memcached = [ pylibmc ]; + tabulate = [ tabulate ]; + watchdog = [ watchdog ]; + yaml = [ pyyaml ]; + cli = [ + jinja2 + pyyaml + ]; + }; + + nativeCheckInputs = [ + mock + pytest-cov-stub + pytestCheckHook + requests + ] ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "cement" ]; + disabledTests = [ + # Test only works with the source from PyPI + "test_get_version" + ]; + + disabledTestPaths = [ + # Tests require network access + "tests/ext/test_ext_memcached.py" + "tests/ext/test_ext_redis.py" + "tests/ext/test_ext_smtp.py" + ]; + meta = with lib; { description = "CLI Application Framework for Python"; - mainProgram = "cement"; homepage = "https://builtoncement.com/"; + changelog = "https://github.com/datafolklabs/cement/blob/${version}/CHANGELOG.md"; license = licenses.bsd3; maintainers = with maintainers; [ eqyiel ]; + mainProgram = "cement"; }; } From 508a791f9ef7583531ad8145e448047b9f2c52d5 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 16 Nov 2024 14:55:39 +0100 Subject: [PATCH 2/3] awsebcli: update override for cement --- pkgs/by-name/aw/awsebcli/package.nix | 67 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/pkgs/by-name/aw/awsebcli/package.nix b/pkgs/by-name/aw/awsebcli/package.nix index 21a20ad7dd16..c03f97d07d00 100644 --- a/pkgs/by-name/aw/awsebcli/package.nix +++ b/pkgs/by-name/aw/awsebcli/package.nix @@ -2,34 +2,31 @@ lib, python3, fetchFromGitHub, + fetchPypi, git, }: let - changeVersion = - overrideFunc: version: hash: - overrideFunc (oldAttrs: rec { - inherit version; - src = oldAttrs.src.override { - inherit version hash; - }; - }); - - localPython = python3.override { - self = localPython; + python = python3.override { packageOverrides = self: super: { - cement = - changeVersion super.cement.overridePythonAttrs "2.10.14" - "sha256-NC4n21SmYW3RiS7QuzWXoifO4z3C2FVgQm3xf8qQcFg="; + cement = super.cement.overridePythonAttrs (old: rec { + pname = "cement"; + version = "2.10.14"; + src = fetchPypi { + inherit pname version; + hash = "sha256-NC4n21SmYW3RiS7QuzWXoifO4z3C2FVgQm3xf8qQcFg="; + }; + build-system = old.build-system or [ ] ++ (with python.pkgs; [ setuptools ]); + doCheck = false; + }); }; }; - in -localPython.pkgs.buildPythonApplication rec { +python.pkgs.buildPythonApplication rec { pname = "awsebcli"; version = "3.21"; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "aws"; @@ -38,12 +35,23 @@ localPython.pkgs.buildPythonApplication rec { hash = "sha256-VU8bXvS4m4eIamjlgGmHE2qwDXWAXvWTa0QHomXR5ZE="; }; + pythonRelaxDeps = [ + "botocore" + "colorama" + "pathspec" + "PyYAML" + "six" + "termcolor" + "urllib3" + ]; + postPatch = '' # https://github.com/aws/aws-elastic-beanstalk-cli/pull/469 - substituteInPlace setup.py --replace-fail "scripts=['bin/eb']," "" + substituteInPlace setup.py \ + --replace-fail "scripts=['bin/eb']," "" ''; - propagatedBuildInputs = with localPython.pkgs; [ + dependencies = with python.pkgs; [ blessed botocore cement @@ -59,20 +67,11 @@ localPython.pkgs.buildPythonApplication rec { websocket-client ]; - pythonRelaxDeps = [ - "botocore" - "colorama" - "pathspec" - "PyYAML" - "six" - "termcolor" - ]; - - nativeCheckInputs = with localPython.pkgs; [ - pytestCheckHook - pytest-socket - mock + nativeCheckInputs = with python.pkgs; [ git + mock + pytest-socket + pytestCheckHook ]; pytestFlagsArray = [ @@ -92,11 +91,11 @@ localPython.pkgs.buildPythonApplication rec { ]; meta = with lib; { - homepage = "https://aws.amazon.com/elasticbeanstalk/"; description = "Command line interface for Elastic Beanstalk"; + homepage = "https://aws.amazon.com/elasticbeanstalk/"; changelog = "https://github.com/aws/aws-elastic-beanstalk-cli/blob/${version}/CHANGES.rst"; - maintainers = with maintainers; [ kirillrdy ]; license = licenses.asl20; + maintainers = with maintainers; [ kirillrdy ]; mainProgram = "eb"; }; } From bbd314463df3253326e0e8dc902eb76cb29b362d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 7 Dec 2024 09:15:07 +0100 Subject: [PATCH 3/3] python312Packages.cement: disable tests on Darwin --- pkgs/development/python-modules/cement/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/cement/default.nix b/pkgs/development/python-modules/cement/default.nix index c16e9490b42e..dc8e0d851efa 100644 --- a/pkgs/development/python-modules/cement/default.nix +++ b/pkgs/development/python-modules/cement/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, colorlog, fetchFromGitHub, @@ -59,6 +60,9 @@ buildPythonPackage rec { pythonImportsCheck = [ "cement" ]; + # Tests are failing on Darwin + doCheck = !stdenv.hostPlatform.isDarwin; + disabledTests = [ # Test only works with the source from PyPI "test_get_version"