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

vcstool: init at 0.1.31 #29533

Merged
merged 2 commits into from Oct 1, 2017
Merged

vcstool: init at 0.1.31 #29533

merged 2 commits into from Oct 1, 2017

Conversation

sivteck
Copy link
Contributor

@sivteck sivteck commented Sep 18, 2017

Adds vcstool application. Initial work to get ROS2 packages on
Nix

Motivation for this change
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.

sha256 = "0n2zkvy2km9ky9lljf1mq5nqyqi5qqzfy2a6sgkjg2grvsk7abxc";
};

meta = with stdenv.lib; {
Copy link
Member

Choose a reason for hiding this comment

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

A maintainer must be set, did you want to maintain this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, can I update the PR?

Copy link
Member

Choose a reason for hiding this comment

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

Yep, I see that you've already done it. 👍

name = "vcstool";
version = "0.1.31";
#no tests
doCheck = false;
Copy link
Member

@Mic92 Mic92 Sep 19, 2017

Choose a reason for hiding this comment

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

@FRidh would it not be helpful to have support for makeWrapperArgs = [] also in nixpkgs/pkgs/development/interpreters/python/wrapper.nix? This package for instance would need tools like git and svn in its PATH. And the only way to inject this I am seeing is to have to the executable wrapped twice.

Copy link
Member

Choose a reason for hiding this comment

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

Then it could look like this:

diff --git a/pkgs/development/tools/vcstool/default.nix b/pkgs/development/tools/vcstool/default.nix
index 65ce3334b8..f03db562ab 100644
--- a/pkgs/development/tools/vcstool/default.nix
+++ b/pkgs/development/tools/vcstool/default.nix
@@ -1,21 +1,35 @@
-{ stdenv, fetchurl, python35Packages }:
-
-  python35Packages.buildPythonApplication rec {
-    name = "vcstool";
-    version = "0.1.31";
-    #no tests
-    doCheck = false;
-
-    propagatedBuildInputs = with python35Packages; [ pyyaml ];
-    src = fetchurl {
-        url = "mirror://pypi/v/vcstool/${name}-${version}.tar.gz";
-        sha256 = "0n2zkvy2km9ky9lljf1mq5nqyqi5qqzfy2a6sgkjg2grvsk7abxc";
-    };
-
-    meta = with stdenv.lib; {
-        description = "Provides a command line tool to invoke vcs commands on multiple repositories";
-        homepage = "https://github.com/dirk-thomas/vcstool";
-        license = licenses.asl20;
-        maintainer = with maintainers; [ sivteck ];
-    };
+{ stdenv, fetchFromGitHub, python3Packages, makeWrapper, git }:
+
+with python3Packages;
+
+buildPythonApplication rec {
+  name = "vcstool-${version}";
+  version = "0.1.31";
+
+  src = fetchFromGitHub {
+    owner = "dirk-thomas";
+    repo = "vcstool";
+    rev = version;
+    sha256 = "0xs77frwx1kvxks57nfw90vimhiaw61dl4kyhwbmcwnjs81xzb66";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  propagatedBuildInputs = [ pyyaml git ];
+
+  makeWrapperArgs = ["--prefix" "PATH" ":" "${stdenv.lib.makeBinPath [ git ]}"];
+
+  checkInputs = [ pytest ];
+  checkPhase = ''
+    # requires pydocstyle, which is not packaged yet
+    rm test/test_flake8.py
+    py.test test
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Provides a command line tool to invoke vcs commands on multiple repositories";
+    homepage = https://github.com/dirk-thomas/vcstool;
+    license = licenses.asl20;
+    maintainer = with maintainers; [ sivteck ];
+  };
 }

Copy link
Member

Choose a reason for hiding this comment

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

How is wrapper.nix relevant here? buildPythonApplication is practically the same as buildPythonPackage.

Copy link
Member

Choose a reason for hiding this comment

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

yes

Copy link
Member

@Mic92 Mic92 Sep 19, 2017

Choose a reason for hiding this comment

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

What code is used to wrap python executables then in buildPythonApplication?

Copy link
Member

Choose a reason for hiding this comment

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

Could also just patch the references to the executables. e.g. in the case of git
https://github.com/dirk-thomas/vcstool/blob/0.1.31/vcstool/clients/git.py#L382

Copy link
Member

Choose a reason for hiding this comment

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

@Mic92 Mic92 requested a review from FRidh September 19, 2017 09:23
doCheck = false;

propagatedBuildInputs = with python35Packages; [ pyyaml ];
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

Copy link
Member

@Mic92 Mic92 Sep 19, 2017

Choose a reason for hiding this comment

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

I switched to fetchFromGithub in my patch above to download the tests.


makeWrapperArgs = ["--prefix" "PATH" ":" "${stdenv.lib.makeBinPath [ git bazaar subversion ]}"];

doCheck = false; # requires network
Copy link
Member

Choose a reason for hiding this comment

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

I had to disable the tests again unfortunately.


propagatedBuildInputs = [ pyyaml ];

makeWrapperArgs = ["--prefix" "PATH" ":" "${stdenv.lib.makeBinPath [ git bazaar subversion ]}"];
Copy link
Member

@Mic92 Mic92 Sep 19, 2017

Choose a reason for hiding this comment

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

I prefer this over patching, since we have wrappers anyway and it is less like to break in future. I don't know, why I did not work for me in the first place.

@sivteck
Copy link
Contributor Author

sivteck commented Sep 19, 2017

@Mic92 can I close this PR? can you open another with yourself as the maintainer?

@Mic92
Copy link
Member

Mic92 commented Sep 20, 2017

@sivteck I don't want to adopt it actually.

@sivteck
Copy link
Contributor Author

sivteck commented Sep 20, 2017

@Mic92 ok, can I squash the last commit?

@Mic92
Copy link
Member

Mic92 commented Sep 20, 2017

yes

Adds vcstool application. Initial work to get ROS2 packages on Nix.
@orivej orivej merged commit 5bf2970 into NixOS:master Oct 1, 2017
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

5 participants