From 1d8203ff1eb17b73f9b8d0c47082eabc63392e64 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Thu, 3 Nov 2022 12:53:22 +0000 Subject: [PATCH 1/2] python3.pkgs.icontract: remove plain text files from package --- .../python-modules/icontract/default.nix | 41 ++++++++----------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/pkgs/development/python-modules/icontract/default.nix b/pkgs/development/python-modules/icontract/default.nix index 41bd796372d1..192a6db039ad 100644 --- a/pkgs/development/python-modules/icontract/default.nix +++ b/pkgs/development/python-modules/icontract/default.nix @@ -2,20 +2,14 @@ , buildPythonPackage , pythonOlder , fetchFromGitHub -, asttokens -, typing-extensions -, pytestCheckHook -, yapf -, docutils -, pygments -, dpcontracts -, tabulate -, py-cpuinfo -, typeguard , astor -, numpy +, asttokens , asyncstdlib , deal +, dpcontracts +, numpy +, pytestCheckHook +, typing-extensions }: buildPythonPackage rec { @@ -38,40 +32,39 @@ buildPythonPackage rec { export ICONTRACT_SLOW=1 ''; - propagatedBuildInputs = [ asttokens typing-extensions ]; checkInputs = [ - pytestCheckHook - yapf - docutils - pygments - dpcontracts - tabulate - py-cpuinfo - typeguard astor - numpy asyncstdlib deal + dpcontracts + numpy + pytestCheckHook ]; disabledTestPaths = [ - # mypy decorator checks don't pass. For some reaseon mypy + # mypy decorator checks don't pass. For some reason mypy # doesn't check the python file provided in the test. "tests/test_mypy_decorators.py" ]; + # Upstream adds some plain text files direct to the package's root directory + # https://github.com/Parquery/icontract/blob/master/setup.py#L63 + postInstall = '' + rm -f $out/{LICENSE.txt,README.rst,requirements.txt} + ''; + pythonImportsCheck = [ "icontract" ]; meta = with lib; { description = "Provide design-by-contract with informative violation messages"; homepage = "https://github.com/Parquery/icontract"; - changelog = "https://github.com/Parquery/icontract/blob/master/CHANGELOG.rst"; + changelog = "https://github.com/Parquery/icontract/blob/v${version}/CHANGELOG.rst"; license = licenses.mit; - maintainers = with maintainers; [ gador ]; + maintainers = with maintainers; [ gador thiagokokada ]; }; } From 23d146426bac06a81fc17f189250a25ba0947652 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Thu, 3 Nov 2022 12:54:23 +0000 Subject: [PATCH 2/2] python3.pkgs.pylddwrap: init at 1.2.2 --- .../python-modules/pylddwrap/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/pylddwrap/default.nix diff --git a/pkgs/development/python-modules/pylddwrap/default.nix b/pkgs/development/python-modules/pylddwrap/default.nix new file mode 100644 index 000000000000..27bac5c1e3a0 --- /dev/null +++ b/pkgs/development/python-modules/pylddwrap/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildPythonPackage +, coreutils +, fetchFromGitHub +, icontract +, pytestCheckHook +, pythonOlder +, typing-extensions +}: + +buildPythonPackage rec { + pname = "pylddwrap"; + version = "1.2.2"; + format = "setuptools"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "Parquery"; + repo = pname; + rev = "v${version}"; + hash = "sha256-Gm82VRu8GP52BohQzpMUJfh6q2tiUA2GJWOcG7ymGgg="; + }; + + postPatch = '' + substituteInPlace lddwrap/__init__.py \ + --replace '/usr/bin/env' '${coreutils}/bin/env' + ''; + + # Upstream adds some plain text files direct to the package's root directory + # https://github.com/Parquery/pylddwrap/blob/master/setup.py#L71 + postInstall = '' + rm -f $out/{LICENSE,README.rst,requirements.txt} + ''; + + propagatedBuildInputs = [ + icontract + typing-extensions + ]; + + checkInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "lddwrap" ]; + + meta = with lib; { + description = "Python wrapper around ldd *nix utility to determine shared libraries of a program"; + homepage = "https://github.com/Parquery/pylddwrap"; + changelog = "https://github.com/Parquery/pylddwrap/blob/v${version}/CHANGELOG.rst"; + license = licenses.mit; + maintainers = with maintainers; [ thiagokokada ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c4714ffe9a52..001b4c8b636c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6947,6 +6947,8 @@ self: super: with self; { pykrakenapi = callPackage ../development/python-modules/pykrakenapi { }; + pylddwrap = callPackage ../development/python-modules/pylddwrap { }; + pynndescent = callPackage ../development/python-modules/pynndescent { }; pynobo = callPackage ../development/python-modules/pynobo { };