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
gitAndTools.pre-commit: init at 1.10.4 #44239
Conversation
@@ -0,0 +1,19 @@ | |||
{ lib, buildPythonPackage, fetchPypi, 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
, list the individual requirements
@@ -0,0 +1,19 @@ | |||
{ lib, buildPythonPackage, fetchPypi, 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.
same
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 fixed these issues.
@@ -0,0 +1,30 @@ | |||
{ stdenv, pythonPackages, pew }: | |||
with pythonPackages; buildPythonApplication rec { | |||
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.
The name
attribute is added by buildPython*
and should therefore be removed.
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.
Yeah, that's not necessary. removed it
description = "A framework for managing and maintaining multi-language pre-commit hooks."; | ||
homepage = https://pre-commit.com/; | ||
license = licenses.mit; | ||
platforms = platforms.all; |
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.
drop platforms, is already set
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.
Oh, buildPythonApplication does that? I dropped it.
pkgs/top-level/python-packages.nix
Outdated
@@ -186,6 +186,8 @@ in { | |||
|
|||
asn1crypto = callPackage ../development/python-modules/asn1crypto { }; | |||
|
|||
aspy.yaml = callPackage ../development/python-modules/aspy.yaml { }; |
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.
The .
should be replaced by e.g. _
(also in the commit message).
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.
preferable even a -
, so to follow the PEP on normalized names.
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.
Yeah, I wasn't sure what to do with the period, I changed it now to -
.
9346457
to
0fe9407
Compare
propagatedBuildInputs = [ pyyaml ]; | ||
|
||
meta = with lib; { | ||
description = "A few extensions to pyyaml."; |
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 period: https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes (also for the other descriptions)
pkgs/top-level/all-packages.nix
Outdated
@@ -8420,6 +8420,8 @@ with pkgs; | |||
|
|||
pyprof2calltree = pythonPackages.callPackage ../development/tools/profiling/pyprof2calltree { }; | |||
|
|||
pre-commit = pythonPackages.callPackage ../development/tools/pre-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.
Please don't use pythonPackages
here, but as argument in the expression.
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.
Also, since pre-commit seems to support Python 3, please use that if possible.
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.
So I don't have to list individual requirements for pre-commit, just for the modules? Or am I misunderstanding something.
I'll use python3. Is the preferred method to do the following here:
pre-commit = callPackage ../development/tools/pre-commit {
pythonPackages = python3Packages;
};
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.
Ye, correctly. The advantage is that applications can override individual packages.
No, the latter is not preferred. I'd just use python3
or python3Packages
as argument.
description = "A framework for managing and maintaining multi-language pre-commit hooks."; | ||
homepage = https://pre-commit.com/; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ borisbabic ]; |
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 need to add yourself to https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix. Please do so in an additional commit.
7fac828
to
fc4a6a6
Compare
virtualenv | ||
]; | ||
|
||
doCheck = false; |
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 do you disable tests? Please add a comment.
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.
The tests fail on python3 due to a windll dependency. I will add a comment explaining, I should have done that right away 😅
fc4a6a6
to
4ce8101
Compare
There are two final things to do. Sorry that I didn't think of these earlier:
Anyway, thanks a lot for your work! |
4ce8101
to
62f7130
Compare
@GrahamcOfBorg build pre-commit |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: pre-commit Partial log (click to expand)
|
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: pre-commit Partial log (click to expand)
|
@GrahamcOfBorg build gitAndTools.pre-commit |
Success on aarch64-linux (full log) Attempted: gitAndTools.pre-commit Partial log (click to expand)
|
62f7130
to
585b0ac
Compare
Oops, I forgot to change Thanks everybody for your help and patience! |
Motivation for this change
Add pre-commit - a useful tool for managing and sharing git commit hooks.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)