nixops: Freeze Python2 dependencies

This commit is contained in:
Tim Steinbach 2021-09-13 15:21:06 -04:00
parent 700a1fbbe7
commit d47e263f5c
No known key found for this signature in database
GPG key ID: 3F563A8A6F0D693F
4 changed files with 156 additions and 0 deletions

View file

@ -0,0 +1,50 @@
{ lib
, buildPythonPackage
, fetchPypi
, botocore
, jmespath
, s3transfer
, futures ? null
, docutils
, nose
, mock
, isPy3k
}:
buildPythonPackage rec {
pname = "boto3";
version = "1.17.97"; # N.B: if you change this, change botocore and awscli to a matching version
src = fetchPypi {
inherit pname version;
sha256 = "0ab5afc51461c30f27aebef944211d16f47697b98ff8d2e2f6e49e59584853bb";
};
propagatedBuildInputs = [ botocore jmespath s3transfer ] ++ lib.optionals (!isPy3k) [ futures ];
checkInputs = [ docutils nose mock ];
checkPhase = ''
runHook preCheck
# This method is not in mock. It might have appeared in some versions.
sed -i 's/action.assert_called_once()/self.assertEqual(action.call_count, 1)/' \
tests/unit/resources/test_factory.py
nosetests -d tests/unit --verbose
runHook postCheck
'';
# Network access
doCheck = false;
pythonImportsCheck = [ "boto3" ];
meta = {
homepage = "https://github.com/boto/boto3";
license = lib.licenses.asl20;
description = "AWS SDK for Python";
longDescription = ''
Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for
Python, which allows Python developers to write software that makes use of
services like Amazon S3 and Amazon EC2.
'';
};
}

View file

@ -0,0 +1,48 @@
{ lib
, buildPythonPackage
, fetchPypi
, python-dateutil
, jmespath
, docutils
, ordereddict
, simplejson
, mock
, nose
, urllib3
}:
buildPythonPackage rec {
pname = "botocore";
version = "1.20.97"; # N.B: if you change this, change boto3 and awscli to a matching version
src = fetchPypi {
inherit pname version;
sha256 = "f7e119cf3e0f4a36100f0e983583afa91a84fb27c479a1716820aee4f2e190ab";
};
propagatedBuildInputs = [
python-dateutil
jmespath
docutils
ordereddict
simplejson
urllib3
];
checkInputs = [ mock nose ];
checkPhase = ''
nosetests -v
'';
# Network access
doCheck = false;
pythonImportsCheck = [ "botocore" ];
meta = with lib; {
homepage = "https://github.com/boto/botocore";
license = licenses.asl20;
description = "A low-level interface to a growing number of Amazon Web Services";
};
}

View file

@ -0,0 +1,52 @@
{ lib
, fetchPypi
, pythonOlder
, buildPythonPackage
, docutils
, mock
, nose
, coverage
, wheel
, unittest2
, botocore
, futures ? null
}:
buildPythonPackage rec {
pname = "s3transfer";
version = "0.4.2";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-ywIvSxZVHt67sxo3fT8JYA262nNj2MXbeXbn9Hcy4bI=";
};
propagatedBuildInputs =
[
botocore
] ++ lib.optional (pythonOlder "3") futures;
buildInputs = [
docutils
mock
nose
coverage
wheel
unittest2
];
checkPhase = ''
pushd s3transfer/tests
nosetests -v unit/ functional/
popd
'';
# version on pypi has no tests/ dir
doCheck = false;
meta = with lib; {
homepage = "https://github.com/boto/s3transfer";
license = licenses.asl20;
description = "A library for managing Amazon S3 transfers";
};
}

View file

@ -36,6 +36,10 @@ with self; with super; {
box2d = callPackage ../development/python-modules/box2d { };
boto3 = callPackage ../development/python-modules/boto3/1_17.nix {};
botocore = callPackage ../development/python-modules/botocore/1_20.nix {};
browsermob-proxy = callPackage ../development/python-modules/browsermob-proxy { };
cairocffi = callPackage ../development/python-modules/cairocffi/0_9.nix { };
@ -544,6 +548,8 @@ with self; with super; {
rsa = callPackage ../development/python-modules/rsa/4_0.nix { };
s3transfer = callPackage ../development/python-modules/s3transfer/0_4.nix { };
sandboxlib = callPackage ../development/python-modules/sandboxlib { };
scandir = callPackage ../development/python-modules/scandir { };