diff --git a/pkgs/development/python-modules/outcome/default.nix b/pkgs/development/python-modules/outcome/default.nix new file mode 100644 index 000000000000..e91925c75d50 --- /dev/null +++ b/pkgs/development/python-modules/outcome/default.nix @@ -0,0 +1,27 @@ +{ lib, buildPythonPackage, fetchPypi, pythonOlder +, attrs +, pytest +}: + +buildPythonPackage rec { + pname = "outcome"; + version = "0.1.0a0"; + disabled = pythonOlder "3.4"; + + src = fetchPypi { + inherit pname version; + sha256 = "0cqwakzigw0602dxlb7c1882jwr8hn5nrxk1l8iwlmzc9whh48wn"; + }; + + checkInputs = [ pytest ]; + propagatedBuildInputs = [ attrs ]; + # Has a test dependency on trio, which depends on outcome. + doCheck = false; + + meta = { + description = "Capture the outcome of Python function calls."; + homepage = https://github.com/python-trio/outcome; + license = with lib.licenses; [ mit asl20 ]; + maintainers = with lib.maintainers; [ catern ]; + }; +} diff --git a/pkgs/development/python-modules/trio/default.nix b/pkgs/development/python-modules/trio/default.nix new file mode 100644 index 000000000000..2bd607170fd5 --- /dev/null +++ b/pkgs/development/python-modules/trio/default.nix @@ -0,0 +1,42 @@ +{ lib, buildPythonPackage, fetchPypi, pythonOlder +, attrs +, sortedcontainers +, async_generator +, idna +, outcome +, contextvars +, pytest +, pyopenssl +, trustme +}: + +buildPythonPackage rec { + pname = "trio"; + version = "0.4.0"; + disabled = pythonOlder "3.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "0ib1x47knlad9pljb64ywfiv6m3dfrqqjwka6j1b73hixmszb5h4"; + }; + + checkInputs = [ pytest pyopenssl trustme ]; + # It appears that the build sandbox doesn't include /etc/services, and these tests try to use it. + checkPhase = '' + py.test -k 'not test_getnameinfo and not test_SocketType_resolve and not test_getprotobyname' + ''; + propagatedBuildInputs = [ + attrs + sortedcontainers + async_generator + idna + outcome + ] ++ lib.optionals (pythonOlder "3.7") [ contextvars ]; + + meta = { + description = "An async/await-native I/O library for humans and snake people"; + homepage = https://github.com/python-trio/trio; + license = with lib.licenses; [ mit asl20 ]; + maintainers = with lib.maintainers; [ catern ]; + }; +} diff --git a/pkgs/development/python-modules/trustme/default.nix b/pkgs/development/python-modules/trustme/default.nix new file mode 100644 index 000000000000..0c3ccb5258e7 --- /dev/null +++ b/pkgs/development/python-modules/trustme/default.nix @@ -0,0 +1,26 @@ +{ lib, buildPythonPackage, fetchPypi, cryptography, pytest, pyopenssl, service-identity }: + +buildPythonPackage rec { + pname = "trustme"; + version = "0.4.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "1215vr6l6c0fzsv5gyay82fxd4fidvq2rd94wvjrljs6h2wajazk"; + }; + + checkInputs = [ pytest pyopenssl service-identity ]; + checkPhase = '' + py.test + ''; + propagatedBuildInputs = [ + cryptography + ]; + + meta = { + description = "#1 quality TLS certs while you wait, for the discerning tester"; + homepage = https://github.com/python-trio/trustme; + license = with lib.licenses; [ mit asl20 ]; + maintainers = with lib.maintainers; [ catern ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2e8f77d8a90e..4a4717ea6a73 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -303,6 +303,8 @@ in { oauthenticator = callPackage ../development/python-modules/oauthenticator { }; + outcome = callPackage ../development/python-modules/outcome {}; + plantuml = callPackage ../tools/misc/plantuml { }; Pmw = callPackage ../development/python-modules/Pmw { }; @@ -436,6 +438,10 @@ in { hdf5 = pkgs.hdf5.override { zlib = pkgs.zlib; }; }; + trustme = callPackage ../development/python-modules/trustme {}; + + trio = callPackage ../development/python-modules/trio {}; + tokenserver = callPackage ../development/python-modules/tokenserver {}; toml = callPackage ../development/python-modules/toml { };