Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

buildPythonPackage rec {
pname = "aws-lambda-builders";
version = "0.2.1";
version = "0.3.0";

# No tests available in PyPI tarball
src = fetchFromGitHub {
owner = "awslabs";
repo = "aws-lambda-builders";
rev = "v${version}";
sha256 = "1pbi6572q1nqs2wd7jx9d5vgf3rqdsqlaz4v8fqvl23wfb2c4vpd";
sha256 = "1c3r3iz29s68mlmdsxbl65x5zqx25b89d40rir6729ck4gll4dyd";
};

# Package is not compatible with Python 3.5
Expand Down
25 changes: 18 additions & 7 deletions pkgs/development/python-modules/serverlessrepo/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
{ lib
, buildPythonPackage
, fetchPypi
, pytest
, boto3
, six
, pyyaml
, mock
, python
}:

let
py = python.override {
packageOverrides = self: super: {
pyyaml = super.pyyaml.overridePythonAttrs (oldAttrs: rec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overriding a Python library inside python-packages.nix is going to cause trouble when composing an env consisting of the original version and the overridden version

Copy link
Member Author

@dhl dhl May 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FRidh understood. I'll get a fix in ASAP.

serverlessrepo has a dependency on pyyaml declared as 'pyyaml~=3.12'.

What's the best way to deal with this? Should I fix up the version in setup.py, or package an older version of pyyaml?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a) check (yourself/with upstream) whether it actually does work with the version we use, and if so patch it
b) if it does not work, then the module is unfortunately broken. Even so, an application can choose to perform the override as is done here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @FRidh. The tests are passing for python 2.7 after patching. Will make another PR after the tests also pass for 3.5, 3.6 and 3.7.

Apologies for the trouble.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch, I actually knew about this, but totally missed that the change is done to a library, sorry! :/

@dhl do you need assistance to fix that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ma27 I've fixed this in #62051

version = "3.12";
src = oldAttrs.src.override {
inherit version;
sha256 = "592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab";
};
});
};
};

in

with py.pkgs;

buildPythonPackage rec {
pname = "serverlessrepo";
version = "0.1.8";
Expand Down
32 changes: 11 additions & 21 deletions pkgs/development/tools/aws-sam-cli/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib
, python
, fetchFromGitHub
}:

let
Expand All @@ -13,27 +14,11 @@ let
};
});

requests = super.requests.overridePythonAttrs (oldAttrs: rec {
version = "2.20.1";
aws-sam-translator = super.aws-sam-translator.overridePythonAttrs (oldAttrs: rec {
version = "1.10.0";
src = oldAttrs.src.override {
inherit version;
sha256 = "ea881206e59f41dbd0bd445437d792e43906703fff75ca8ff43ccdb11f33f263";
};
});

idna = super.idna.overridePythonAttrs (oldAttrs: rec {
version = "2.7";
src = oldAttrs.src.override {
inherit version;
sha256 = "684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16";
};
});

six = super.six.overridePythonAttrs (oldAttrs: rec {
version = "1.11";
src = oldAttrs.src.override {
inherit version;
sha256 = "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9";
sha256 = "0e1fa094c6791b233f5e73f2f0803ec6e0622f2320ec5a969f0986855221b92b";
};
});
};
Expand All @@ -45,11 +30,11 @@ with py.pkgs;

buildPythonApplication rec {
pname = "aws-sam-cli";
version = "0.14.2";
version = "0.16.1";

src = fetchPypi {
inherit pname version;
sha256 = "b7f80838d57c1096a9a03ed703a91a8a5775a6ead33df8f31765ecf39b3a956f";
sha256 = "2dd68800723c76f52980141ba704e105d77469b6ba465781fbc9120e8121e76c";
};

# Tests are not included in the PyPI package
Expand All @@ -71,6 +56,11 @@ buildPythonApplication rec {
six
];

postPatch = ''
substituteInPlace requirements/base.txt --replace "requests==2.20.1" "requests==2.21.0"
substituteInPlace requirements/base.txt --replace "six~=1.11.0" "six~=1.12.0"
'';

meta = with lib; {
homepage = https://github.com/awslabs/aws-sam-cli;
description = "CLI tool for local development and testing of Serverless applications";
Expand Down