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
Pip tools #23801
Pip tools #23801
Conversation
pkgs/top-level/python-packages.nix
Outdated
@@ -29044,6 +29044,24 @@ EOF | |||
}; | |||
}; | |||
|
|||
first = buildPythonPackage 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.
We have a new policy for python to put python packages into a separate file and only reference them here:
See also:
$ chromium "file://$(nix-build --no-out-link doc)//share/doc/nixpkgs/manual.html#contributing-guidelines"
pkgs/top-level/python-packages.nix
Outdated
name = "${pname}-${version}"; | ||
|
||
src = pkgs.fetchurl { | ||
url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz"; |
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.
Does fetchPypi
works here?
pkgs/top-level/python-packages.nix
Outdated
@@ -18874,6 +18874,26 @@ in { | |||
}; | |||
}; | |||
|
|||
pip-tools = buildPythonPackage 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.
same as above
pkgs/top-level/python-packages.nix
Outdated
version = "1.8.1rc3"; | ||
name = "${pname}-${version}"; | ||
|
||
src = pkgs.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.
Does fetchPypi
works here?
0ad5e5f
to
e41b15f
Compare
Thanks for the review @Mic92 ! |
pkgs/development/tools/pip-tools.nix
Outdated
@@ -0,0 +1,20 @@ | |||
{ stdenv, buildPythonPackage, pythonPackages }: | |||
buildPythonPackage 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.
I moved it out of pythonPackages, since it is not a library.
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.
Actually, it did belong there because, while it is an application, users need it for the specific environment they're using it with. Therefore it has to be in python-packages.nix
. It's the same as the pip
package or pytest
.
|
||
meta = with stdenv.lib; { | ||
description = "The function you always missed in Python"; | ||
homepage = https://github.com/hynek/first/; |
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.
Somebody did all this work to publish a function as trivial as first
? Wow.
Why would you want to use this instead of toolz.first
along with `filter?
Anyway, doCheck = false;
is missing because the tests aren't included in the archive.
pkgs/development/tools/pip-tools.nix
Outdated
@@ -0,0 +1,20 @@ | |||
{ stdenv, buildPythonPackage, pythonPackages }: | |||
buildPythonPackage 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.
Actually, it did belong there because, while it is an application, users need it for the specific environment they're using it with. Therefore it has to be in python-packages.nix
. It's the same as the pip
package or pytest
.
pkgs/top-level/python-packages.nix
Outdated
@@ -29044,6 +29044,8 @@ EOF | |||
}; | |||
}; | |||
|
|||
first = callPackage ../development/python-modules/first.nix {}; |
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.
python-modules/first/default.nix
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.
is this necessary?
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.
My opinion is that, while we diverge on certain matters from the general guidelines in Nixpkgs, we should try and stick to them as much of possible.
pkgs/development/tools/pip-tools.nix
Outdated
owner = "jazzband"; | ||
repo = "pip-tools"; | ||
rev = version; | ||
sha256 = "09rbgzj71bfp1x1jfr1zx3vax4qjbw5l6vcd3fqvshsdvg9lcnpx"; |
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.
Why not use the official archive from pypi?
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.
likely because the archive does not contain the tests. See the title of the commit.
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 was the reason.
Motivation for this change
Pip tools allow to produce better frozen requirements.txt. Hopefully also usable by nix because it contains hashes.
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/
)