diff --git a/pkgs/development/python-modules/contextvars/default.nix b/pkgs/development/python-modules/contextvars/default.nix new file mode 100644 index 00000000000..d8ee3b1ca9e --- /dev/null +++ b/pkgs/development/python-modules/contextvars/default.nix @@ -0,0 +1,21 @@ +{ lib, buildPythonPackage, fetchPypi, isPy36, immutables }: + +buildPythonPackage rec { + pname = "contextvars"; + version = "2.2"; + disabled = !isPy36; + + src = fetchPypi { + inherit pname version; + sha256 = "046b385nfzkjh0wqmd268p2jkgn9fg6hz40npq7j1w3c8aqzhwvx"; + }; + + propagatedBuildInputs = [ immutables ]; + + meta = { + description = "A backport of the Python 3.7 contextvars module for Python 3.6"; + homepage = https://github.com/MagicStack/contextvars; + license = with lib.licenses; [ asl20 ]; + maintainers = with lib.maintainers; [ catern ]; + }; +} diff --git a/pkgs/development/python-modules/immutables/default.nix b/pkgs/development/python-modules/immutables/default.nix new file mode 100644 index 00000000000..975353406ca --- /dev/null +++ b/pkgs/development/python-modules/immutables/default.nix @@ -0,0 +1,19 @@ +{ lib, buildPythonPackage, fetchPypi, pythonOlder }: + +buildPythonPackage rec { + pname = "immutables"; + version = "0.5"; + disabled = pythonOlder "3.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "1hba0vkqanwfnb5b3rs14bs7schsmczhan5nd93c1i6fzi17glap"; + }; + + meta = { + description = "An immutable mapping type for Python"; + homepage = https://github.com/MagicStack/immutables; + license = with lib.licenses; [ asl20 ]; + maintainers = with lib.maintainers; [ catern ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 254f76ced05..c805a8ba520 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1629,6 +1629,8 @@ in { contexter = callPackage ../development/python-modules/contexter { }; + contextvars = callPackage ../development/python-modules/contextvars {}; + contextlib2 = callPackage ../development/python-modules/contextlib2 { }; cookiecutter = callPackage ../development/python-modules/cookiecutter { }; @@ -3120,6 +3122,8 @@ in { imbalanced-learn = callPackage ../development/python-modules/imbalanced-learn { }; + immutables = callPackage ../development/python-modules/immutables {}; + imread = buildPythonPackage rec { name = "python-imread-${version}"; version = "0.6";