From ef77617bc02670cead8e83e9ab72bf0fd4eeade8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 17 Jan 2023 16:16:26 -0800 Subject: [PATCH 1/2] python310Packages.aspectlib: init at 2.0.0 --- .../python-modules/aspectlib/default.nix | 65 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 67 insertions(+) create mode 100644 pkgs/development/python-modules/aspectlib/default.nix diff --git a/pkgs/development/python-modules/aspectlib/default.nix b/pkgs/development/python-modules/aspectlib/default.nix new file mode 100644 index 000000000000..70fd8e8db2e2 --- /dev/null +++ b/pkgs/development/python-modules/aspectlib/default.nix @@ -0,0 +1,65 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchPypi +, fetchpatch +, setuptools +, fields +, process-tests +, pytestCheckHook +, tornado +}: + +buildPythonPackage rec { + pname = "aspectlib"; + version = "2.0.0"; + + disabled = pythonOlder "3.7"; + + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-pLRhudoLUxrry5PvzePegIpyxgIm3Y2QLEZ9E/r3zpI="; + }; + + patches = [ + # https://github.com/ionelmc/python-aspectlib/pull/25 + (fetchpatch { + name = "darwin-compat.patch"; + url = "https://github.com/ionelmc/python-aspectlib/commit/ef2c12304f08723dc8e79d1c59bc32c946d758dc.patch"; + hash = "sha256-gtPFtwDsGIMkHTyuoiLk+SAGgB2Wyx/Si9HIdoIsvI8="; + }) + ]; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + fields + ]; + + pythonImportsCheck = [ + "aspectlib" + "aspectlib.contrib" + "aspectlib.debug" + "aspectlib.test" + ]; + + checkInputs = [ + process-tests + pytestCheckHook + tornado + ]; + + __darwinAllowLocalNetworking = true; + + meta = { + changelog = "https://github.com/ionelmc/python-aspectlib/blob/v${version}/CHANGELOG.rst"; + description = "Aspect-oriented programming, monkey-patch and decorators library"; + homepage = "https://github.com/ionelmc/python-aspectlib"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ca10f5ac7fa2..eab048c633ad 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -654,6 +654,8 @@ self: super: with self; { asn1tools = callPackage ../development/python-modules/asn1tools { }; + aspectlib = callPackage ../development/python-modules/aspectlib { }; + aspell-python = callPackage ../development/python-modules/aspell-python { }; aspy-refactor-imports = callPackage ../development/python-modules/aspy-refactor-imports { }; From 26125d9fd6a5eba5854e129886021a08d1e3d117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 26 Feb 2023 08:33:23 -0800 Subject: [PATCH 2/2] python310Packages.python-olm: run tests --- .../python-modules/python-olm/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/python-olm/default.nix b/pkgs/development/python-modules/python-olm/default.nix index f430517be759..39cd201c9655 100644 --- a/pkgs/development/python-modules/python-olm/default.nix +++ b/pkgs/development/python-modules/python-olm/default.nix @@ -1,5 +1,10 @@ { lib, buildPythonPackage, isPy3k, olm -, cffi, future, typing }: +, cffi +, future +, aspectlib +, pytest-benchmark +, pytestCheckHook +}: buildPythonPackage { pname = "python-olm"; @@ -17,17 +22,20 @@ buildPythonPackage { propagatedBuildInputs = [ cffi future - typing ]; propagatedNativeBuildInputs = [ cffi ]; - # Some required libraries for testing are not packaged yet. - doCheck = false; pythonImportsCheck = [ "olm" ]; + nativeCheckInputs = [ + aspectlib + pytest-benchmark + pytestCheckHook + ]; + meta = { inherit (olm.meta) license maintainers; description = "Python bindings for Olm";