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
awsebcli: init at 3.10.5 #28428
Conversation
Rebased! |
There was a problem hiding this 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 }: |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 }: |
There was a problem hiding this comment.
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 }: |
There was a problem hiding this comment.
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.
pkgs/top-level/python-packages.nix
Outdated
@@ -3093,6 +3086,17 @@ in { | |||
|
|||
colorama = callPackage ../development/python-modules/colorama { }; | |||
|
|||
# Needed by awscli and awsebcli. | |||
colorama_3_7 = self.colorama.overrideAttrs (oldAttrs: rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overridePythonAttrs
5e87a30
to
e5222d6
Compare
There was a problem hiding this 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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use oldAttrs
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; [ |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
I've split it out into more atomic commits, is this preferable? 😊 |
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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}"; |
There was a problem hiding this comment.
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*
:)
There was a problem hiding this comment.
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!
@FRidh was there something remaining to be done here? |
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.
Rebased! |
Bump. @FRidh is there something remaining to be done here? |
I've pushed modified versions of these commits, e.g. b1c4498 |
My apologies for the long delay. |
@FRidh that's OK, thank you for your time! |
Motivation for this change
I wanted to use
awsebcli
at work and it wasn't innixpkgs
yet.Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)Also:
colorama_3_7
from the awscli derivation intopython-packages
since bothawscli
andawsebcli
depend on it.fetchPypi
, which AFAICT is preferred for python packages (3to2: init at 1.1.1 #25202 (comment), 3to2: refactor to use fetchpypi #26078).pythonPackages
(package_V_V
).