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

Add pre-commit and its dependencies #49163

Closed
wants to merge 1 commit into from
Closed

Conversation

jfroche
Copy link
Contributor

@jfroche jfroche commented Oct 26, 2018

pre-commit is "a framework for managing and maintaining multi-language
pre-commit hooks". More info here: https://pre-commit.com

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

pre-commit is "a framework for managing and maintaining multi-language
pre-commit hooks". More info here: https://pre-commit.com
Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

Please split up these changes into multiple commits.

Precisely like:

  • add yourself to the maintainers list
maintainers: add name
  • one each for package initialization
pkg-name: init at version

Also preferably with its dependents preceding pre-commit.

More can be seen in CONTRIBUTING.md

buildPythonPackage rec {
pname = "importlib_metadata";
version = "0.6";
name = "importlib_metadata";
Copy link
Member

Choose a reason for hiding this comment

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

drop this line

sha256 = "074v6mq5dbbr0y697fgajm503sg83faxzvwz41jxy6h0z622rc1n";
};

pythonPath = [ recursivePthLoader ];
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed? Why don't you use propagatedBuildInputs or nativeBuildInputs?


pythonPath = [ recursivePthLoader ];

doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

Why? Add a comment.

pythonPath = [ recursivePthLoader ];

doCheck = false;
propagatedBuildInputs = [ ];
Copy link
Member

Choose a reason for hiding this comment

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

remove

buildPythonPackage rec {
pname = "importlib_resources";
version = "1.0.1";
name = "importlib_resources";
Copy link
Member

Choose a reason for hiding this comment

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

remove

'';

meta = {
description = "A framework for managing and maintaining multi-language pre-commit hooks.";
Copy link
Member

Choose a reason for hiding this comment

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

importlib-metadata = callPackage ../development/python-modules/importlib-metadata { };
importlib-resources = callPackage ../development/python-modules/importlib-resources { };
setuptools-markdown = callPackage ../development/python-modules/setuptools-markdown { };
pre-commit = callPackage ../development/python-modules/pre-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 file should be sorted alphabetically.


propagatedBuildInputs = [ pypandoc ];
pythonPath = [ recursivePthLoader ];
doCheck = false;
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

buildPythonPackage rec {
pname = "setuptools-markdown";
version = "0.2";
name = "setuptools_markdown";
Copy link
Member

Choose a reason for hiding this comment

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

drop this line

}:

buildPythonPackage rec {
pname = "setuptools-markdown";
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure that this works? Pypandoc is broken.

@dotlambda
Copy link
Member

I only found out after reviewing that this package already exists: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/version-management/git-and-tools/pre-commit/default.nix

@dotlambda dotlambda closed this Oct 27, 2018
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