From 53553b3cd71bbcbe224b6451cf03fd98e993ced2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 22 Jan 2025 15:59:27 -0800 Subject: [PATCH 1/2] python313Packages.whey: follow contributing guidelines --- .../python-modules/whey/default.nix | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/whey/default.nix b/pkgs/development/python-modules/whey/default.nix index 7c1aaec13e6c..61ef34e74ad6 100644 --- a/pkgs/development/python-modules/whey/default.nix +++ b/pkgs/development/python-modules/whey/default.nix @@ -1,30 +1,41 @@ { buildPythonPackage, - fetchPypi, + fetchFromGitHub, lib, setuptools, attrs, click, consolekit, dist-meta, + docutils, dom-toml, domdf-python-tools, + editables, handy-archives, natsort, packaging, pyproject-parser, + pytestCheckHook, shippinglabel, }: + buildPythonPackage rec { pname = "whey"; version = "0.1.1"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-l72fjczuuDXg/cDiqJ7roNVm4X+au+1u4AA8Szs1bNo="; + src = fetchFromGitHub { + owner = "repo-helper"; + repo = "whey"; + tag = "v${version}"; + hash = "sha256-s2jZmuFj0gTWVTcXWcBhcu5RBuaf/qMS/xzIpIoG1ZE="; }; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'setuptools!=61.*,<=67.1.0,>=40.6.0' setuptools + ''; + build-system = [ setuptools ]; dependencies = [ @@ -41,14 +52,29 @@ buildPythonPackage rec { shippinglabel ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail '"setuptools!=61.*,<=67.1.0,>=40.6.0"' '"setuptools"' - ''; + pythonImportsCheck = [ "whey" ]; + + optional-dependencies = { + all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies)); + editable = [ + editables + ]; + readme = [ + docutils + pyproject-parser + ] ++ pyproject-parser.optional-dependencies.readme; + }; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + # missing dependency pyproject-examples + doCheck = false; meta = { - description = "A simple Python wheel builder for simple projects."; - homepage = "https://pypi.org/project/whey"; + description = "Simple Python wheel builder for simple projects"; + homepage = "https://github.com/repo-helper/whey"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ tyberius-prime ]; }; From a0059ad85216503244ee58e07f92796efa6e7ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 22 Jan 2025 16:04:39 -0800 Subject: [PATCH 2/2] python313Packages.whey-pth: follow contributing guidelines --- .../python-modules/whey-pth/default.nix | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/whey-pth/default.nix b/pkgs/development/python-modules/whey-pth/default.nix index c40292ede641..a389860d1e2d 100644 --- a/pkgs/development/python-modules/whey-pth/default.nix +++ b/pkgs/development/python-modules/whey-pth/default.nix @@ -1,21 +1,30 @@ { buildPythonPackage, - fetchPypi, + fetchFromGitHub, lib, setuptools, dom-toml, whey, + pytestCheckHook, }: + buildPythonPackage rec { pname = "whey-pth"; version = "0.0.6"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-CIpgqzNXW3VpS+k6BCpc2DNyqwgt/Af3ms59AH/V5KM="; + src = fetchFromGitHub { + owner = "repo-helper"; + repo = "whey-pth"; + tag = "v${version}"; + hash = "sha256-A+bXB9F8FD+A1iRuETIxP12bkH/5NKcx01ERXJZAj+Q="; }; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'setuptools!=61.*,<=67.1.0,>=40.6.0' setuptools + ''; + build-system = [ setuptools ]; dependencies = [ @@ -23,14 +32,18 @@ buildPythonPackage rec { whey ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail '"setuptools!=61.*,<=67.1.0,>=40.6.0"' '"setuptools"' - ''; + pythonImportsCheck = [ "whey_pth" ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + # missing dependency coincidence + doCheck = false; meta = { - description = "Extension to whey to support .pth files."; - homepage = "https://pypi.org/project/whey-pth"; + description = "Extension to whey to support .pth files"; + homepage = "https://github.com/repo-helper/whey-pth"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ tyberius-prime ]; };