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

Pip tools #23801

Merged
merged 2 commits into from Mar 13, 2017
Merged

Pip tools #23801

merged 2 commits into from Mar 13, 2017

Conversation

zimbatm
Copy link
Member

@zimbatm zimbatm commented Mar 12, 2017

Motivation for this change

Pip tools allow to produce better frozen requirements.txt. Hopefully also usable by nix because it contains hashes.

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 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.

@mention-bot
Copy link

@zimbatm, thanks for your PR! By analyzing the history of the files in this pull request, we identified @FRidh to be a potential reviewer.

@@ -29044,6 +29044,24 @@ EOF
};
};

first = buildPythonPackage rec {
Copy link
Member

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"

name = "${pname}-${version}";

src = pkgs.fetchurl {
url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz";
Copy link
Member

@Mic92 Mic92 Mar 12, 2017

Choose a reason for hiding this comment

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

Does fetchPypi works here?

@@ -18874,6 +18874,26 @@ in {
};
};

pip-tools = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

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

same as above

version = "1.8.1rc3";
name = "${pname}-${version}";

src = pkgs.fetchurl {
Copy link
Member

@Mic92 Mic92 Mar 12, 2017

Choose a reason for hiding this comment

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

Does fetchPypi works here?

@zimbatm zimbatm force-pushed the pip-tools branch 3 times, most recently from 0ad5e5f to e41b15f Compare March 12, 2017 21:58
@zimbatm
Copy link
Member Author

zimbatm commented Mar 12, 2017

Thanks for the review @Mic92 !

@@ -0,0 +1,20 @@
{ stdenv, buildPythonPackage, pythonPackages }:
buildPythonPackage rec {
Copy link
Member

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.

Copy link
Member

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/;
Copy link
Member

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.

@@ -0,0 +1,20 @@
{ stdenv, buildPythonPackage, pythonPackages }:
buildPythonPackage rec {
Copy link
Member

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.

@@ -29044,6 +29044,8 @@ EOF
};
};

first = callPackage ../development/python-modules/first.nix {};
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

is this necessary?

Copy link
Member

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.

owner = "jazzband";
repo = "pip-tools";
rev = version;
sha256 = "09rbgzj71bfp1x1jfr1zx3vax4qjbw5l6vcd3fqvshsdvg9lcnpx";
Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

this was the reason.

@Mic92 Mic92 merged commit 065c05e into NixOS:master Mar 13, 2017
@zimbatm zimbatm deleted the pip-tools branch March 13, 2017 22:12
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

4 participants