Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

awsebcli: init at 3.10.5 #28428

Closed
wants to merge 6 commits into from
Closed

awsebcli: init at 3.10.5 #28428

wants to merge 6 commits into from

Conversation

eqyiel
Copy link
Contributor

@eqyiel eqyiel commented Aug 21, 2017

Motivation for this change

I wanted to use awsebcli at work and it wasn't in nixpkgs yet.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Also:

@eqyiel
Copy link
Contributor Author

eqyiel commented Aug 28, 2017

Rebased!

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

package_V_V is indeed the way forward.

@@ -0,0 +1,21 @@
{ stdenv, fetchurl, pythonPackages }:
Copy link
Member

Choose a reason for hiding this comment

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

No pythonPackages, but parameters for each package/function.

pname = "blessed";
version = "1.14.2";

src = fetchurl {
Copy link
Member

Choose a reason for hiding this comment

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

fetchPypi

@@ -0,0 +1,94 @@
{ stdenv, fetchurl, pythonPackages }:
let
botocore = pythonPackages.botocore.overrideAttrs (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.

overridePythonAttrs (this is quite new)

Copy link
Member

Choose a reason for hiding this comment

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

Furthermore, due to the amount of overrides and the possible need of doing deep overrides, i suggest overriding the package set. E.g.

let

  mypython = python.override { 
    packageOverrides = self: super: {
      botocore = super.botocore.overridePythonAttrs (oldAttrs: {
        ...
      });  
      docker = super.docker.overridePythonAttrs( oldAttrs: {
        ...
      });
    };
  };
in ...

};
});

makePypiUrl = { pname, version }:
Copy link
Member

Choose a reason for hiding this comment

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

fetchPypi

@@ -0,0 +1,22 @@
{ stdenv, pythonPackages }:
Copy link
Member

Choose a reason for hiding this comment

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

No pythonPackages, but parameters for each package/function.

@@ -3093,6 +3086,17 @@ in {

colorama = callPackage ../development/python-modules/colorama { };

# Needed by awscli and awsebcli.
colorama_3_7 = self.colorama.overrideAttrs (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.

overridePythonAttrs

@eqyiel eqyiel force-pushed the awsebcli branch 2 times, most recently from 5e87a30 to e5222d6 Compare September 1, 2017 00:27
@eqyiel
Copy link
Contributor Author

eqyiel commented Sep 1, 2017

@FRidh thank you for the review, I've tried to address those points and updated the PR.

Overriding the package set is a lot nicer!

I also rebased onto master again.

I plan to add myself as a maintainer for the new packages and update to 3.10.6 in separate commits, is that the convention here?

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

I plan to add myself as a maintainer for the new packages and update to 3.10.6 in separate commits, is that the convention here?

Actually, the convention is one commit per expression you touch.

localPythonPackageSet = python.override {
packageOverrides = self: super: rec {
docker = super.docker.overridePythonAttrs (oldAttrs: rec {
pname = "docker-py";
Copy link
Member

Choose a reason for hiding this comment

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

you can use oldAttrs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately the name of the Pypi package changed in 2.0: https://github.com/docker/docker-py/releases/tag/2.0.0

docker-py is the name of the package prior to that but the pname from oldAttrs is docker.

Unless you're saying to use ${oldAttrs.pname}-py?

packageOverrides = self: super: rec {
docker = super.docker.overridePythonAttrs (oldAttrs: rec {
pname = "docker-py";
version = "1.7.2";
Copy link
Member

Choose a reason for hiding this comment

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

note that you will have to update name as well yourself

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

sha256 = "1g53z2flhp3navdf8lw6rgh99akf3k0ng1zkkqswvh66zswkxnwn";
};

buildInputs = with localPythonPackageSet.pkgs; [
Copy link
Member

Choose a reason for hiding this comment

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

these are likely inputs needed only for testing. The buildPython* functions supports checkInputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, i wasn't aware that was a thing

Copy link
Member

Choose a reason for hiding this comment

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

Its only used in buildPython*, and I think only exists since 17.03.

@eqyiel
Copy link
Contributor Author

eqyiel commented Sep 1, 2017

Actually, the convention is one commit per expression you touch.

I've split it out into more atomic commits, is this preferable? 😊

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

I've split it out into more atomic commits, is this preferable?

Yep, much nicer this way!

};
});

docker = super.docker.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.

am I correct that you are now using a different package for docker? That is, docker-py instead of docker?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the same package from the same repo (https://github.com/docker/docker-py) but since version 2.0.0 (the version in pkgs/development/python-modules/docker.nix is 2.5.1) they changed the name that you would use to install it with pip.

It's in the release notes here: https://github.com/docker/docker-py/releases/tag/2.0.0

The name of the pip package is now docker (was: docker-py). New versions of this library will only be published as docker from now on.

Should I create a new derivation for it?

colorama = super.colorama.overridePythonAttrs (oldAttrs: rec {
version = "0.3.7";

src = fetchPypi {
Copy link
Member

Choose a reason for hiding this comment

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

Note that fetchPypi is overridable, so you can write

src = oldAttrs.src.override { inherit version; sha256 = "..."};

No need to change it, though.

docker = super.docker.overridePythonAttrs (oldAttrs: rec {
pname = "docker-py";
version = "1.7.2";
name = "${pname}-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

This line is necessary for all the overrides since otherwise the old names will still be used.

Hopefully, after the release of 17.09, we can go further and get rid of name for buildPython* :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for letting me know!

@eqyiel
Copy link
Contributor Author

eqyiel commented Sep 5, 2017

@FRidh was there something remaining to be done here?

@eqyiel
Copy link
Contributor Author

eqyiel commented Sep 7, 2017

Rebased!

This is a dependency of awsebcli.
This is a dependency of awsebcli.
In order to make it nicer to override when a specific version is required for
Python derivations.
In order to make it nicer to override when a specific version is required for
Python derivations.
@eqyiel
Copy link
Contributor Author

eqyiel commented Sep 13, 2017

Rebased!

@eqyiel
Copy link
Contributor Author

eqyiel commented Sep 18, 2017

Bump. @FRidh is there something remaining to be done here?

@eqyiel
Copy link
Contributor Author

eqyiel commented Sep 23, 2017

@FRidh @edolstra ping

@FRidh
Copy link
Member

FRidh commented Sep 23, 2017

I've pushed modified versions of these commits, e.g. b1c4498

@FRidh FRidh closed this Sep 23, 2017
@FRidh
Copy link
Member

FRidh commented Sep 23, 2017

My apologies for the long delay.

@eqyiel
Copy link
Contributor Author

eqyiel commented Sep 24, 2017

@FRidh that's OK, thank you for your time!

@eqyiel eqyiel deleted the awsebcli branch November 3, 2020 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants