git.iko.soy/typeable/nixpkgs
on master help sign in
nixops: Freeze Python2 dependencies
commitd47e263f5cff65388883ead6acab93b5d95fd118 authorTim Steinbach <tim.steinbach@shopify.com> dateMon 13 Sep 2021, 15:21 (5 years ago) parent700a1fb
4 files changed+156
pkgs/development/python-modules/boto3/1_17.nix+50 pkgs/development/python-modules/botocore/1_20.nix+48 pkgs/development/python-modules/s3transfer/0_4.nix+52 pkgs/top-level/python2-packages.nix+6
pkgs/development/python-modules/boto3/1_17.nixnew file+50
@@ -0,0 +1,50 @@
1+{ lib
2+, buildPythonPackage
3+, fetchPypi
4+, botocore
5+, jmespath
6+, s3transfer
7+, futures ? null
8+, docutils
9+, nose
10+, mock
11+, isPy3k
12+}:
13+
14+buildPythonPackage rec {
15+ pname = "boto3";
16+ version = "1.17.97"; # N.B: if you change this, change botocore and awscli to a matching version
17+
18+ src = fetchPypi {
19+ inherit pname version;
20+ sha256 = "0ab5afc51461c30f27aebef944211d16f47697b98ff8d2e2f6e49e59584853bb";
21+ };
22+
23+ propagatedBuildInputs = [ botocore jmespath s3transfer ] ++ lib.optionals (!isPy3k) [ futures ];
24+ checkInputs = [ docutils nose mock ];
25+
26+ checkPhase = ''
27+ runHook preCheck
28+ # This method is not in mock. It might have appeared in some versions.
29+ sed -i 's/action.assert_called_once()/self.assertEqual(action.call_count, 1)/' \
30+ tests/unit/resources/test_factory.py
31+ nosetests -d tests/unit --verbose
32+ runHook postCheck
33+ '';
34+
35+ # Network access
36+ doCheck = false;
37+
38+ pythonImportsCheck = [ "boto3" ];
39+
40+ meta = {
41+ homepage = "https://github.com/boto/boto3";
42+ license = lib.licenses.asl20;
43+ description = "AWS SDK for Python";
44+ longDescription = ''
45+ Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for
46+ Python, which allows Python developers to write software that makes use of
47+ services like Amazon S3 and Amazon EC2.
48+ '';
49+ };
50+}
pkgs/development/python-modules/botocore/1_20.nixnew file+48
@@ -0,0 +1,48 @@
1+{ lib
2+, buildPythonPackage
3+, fetchPypi
4+, python-dateutil
5+, jmespath
6+, docutils
7+, ordereddict
8+, simplejson
9+, mock
10+, nose
11+, urllib3
12+}:
13+
14+buildPythonPackage rec {
15+ pname = "botocore";
16+ version = "1.20.97"; # N.B: if you change this, change boto3 and awscli to a matching version
17+
18+ src = fetchPypi {
19+ inherit pname version;
20+ sha256 = "f7e119cf3e0f4a36100f0e983583afa91a84fb27c479a1716820aee4f2e190ab";
21+ };
22+
23+ propagatedBuildInputs = [
24+ python-dateutil
25+ jmespath
26+ docutils
27+ ordereddict
28+ simplejson
29+ urllib3
30+ ];
31+
32+ checkInputs = [ mock nose ];
33+
34+ checkPhase = ''
35+ nosetests -v
36+ '';
37+
38+ # Network access
39+ doCheck = false;
40+
41+ pythonImportsCheck = [ "botocore" ];
42+
43+ meta = with lib; {
44+ homepage = "https://github.com/boto/botocore";
45+ license = licenses.asl20;
46+ description = "A low-level interface to a growing number of Amazon Web Services";
47+ };
48+}
pkgs/development/python-modules/s3transfer/0_4.nixnew file+52
@@ -0,0 +1,52 @@
1+{ lib
2+, fetchPypi
3+, pythonOlder
4+, buildPythonPackage
5+, docutils
6+, mock
7+, nose
8+, coverage
9+, wheel
10+, unittest2
11+, botocore
12+, futures ? null
13+}:
14+
15+buildPythonPackage rec {
16+ pname = "s3transfer";
17+ version = "0.4.2";
18+
19+ src = fetchPypi {
20+ inherit pname version;
21+ sha256 = "sha256-ywIvSxZVHt67sxo3fT8JYA262nNj2MXbeXbn9Hcy4bI=";
22+ };
23+
24+ propagatedBuildInputs =
25+ [
26+ botocore
27+ ] ++ lib.optional (pythonOlder "3") futures;
28+
29+ buildInputs = [
30+ docutils
31+ mock
32+ nose
33+ coverage
34+ wheel
35+ unittest2
36+ ];
37+
38+ checkPhase = ''
39+ pushd s3transfer/tests
40+ nosetests -v unit/ functional/
41+ popd
42+ '';
43+
44+ # version on pypi has no tests/ dir
45+ doCheck = false;
46+
47+ meta = with lib; {
48+ homepage = "https://github.com/boto/s3transfer";
49+ license = licenses.asl20;
50+ description = "A library for managing Amazon S3 transfers";
51+ };
52+}
pkgs/top-level/python2-packages.nix+6
@@ -36,6 +36,10 @@ with self; with super; {
3636
3737 box2d = callPackage ../development/python-modules/box2d { };
3838
39+ boto3 = callPackage ../development/python-modules/boto3/1_17.nix {};
40+
41+ botocore = callPackage ../development/python-modules/botocore/1_20.nix {};
42+
3943 browsermob-proxy = callPackage ../development/python-modules/browsermob-proxy { };
4044
4145 cairocffi = callPackage ../development/python-modules/cairocffi/0_9.nix { };
@@ -544,6 +548,8 @@ with self; with super; {
544548
545549 rsa = callPackage ../development/python-modules/rsa/4_0.nix { };
546550
551+ s3transfer = callPackage ../development/python-modules/s3transfer/0_4.nix { };
552+
547553 sandboxlib = callPackage ../development/python-modules/sandboxlib { };
548554
549555 scandir = callPackage ../development/python-modules/scandir { };