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

python3Packages.hydra-check: init at 1.1.1 #84917

Merged
merged 1 commit into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions pkgs/development/python-modules/hydra-check/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, docopt
, requests
, beautifulsoup4
, black
, mypy
, flake8
}:
makefu marked this conversation as resolved.
Show resolved Hide resolved

buildPythonPackage rec {
pname = "hydra-check";
version = "1.1.1";
disabled = pythonOlder "3.5";

src = fetchFromGitHub {
owner = "nix-community";
repo = "hydra-check";
rev = version;
sha256 = "1dmsscsib8ckp496gsfqxmq8d35zs71n99xmziq9iprvy7n5clq2";
};

propagatedBuildInputs = [
docopt
requests
beautifulsoup4
];

checkInputs = [ mypy ];

checkPhase = ''
echo -e "\x1b[32m## run mypy\x1b[0m"
mypy hydracheck
'';
Copy link
Contributor

Choose a reason for hiding this comment

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

I would not do any of these checks inside the nix distribution: this will cause build failures when someone else goes to upgrade the version of black or flake8 or mypy, but these linting considerations are at the project src repo level, so they belong just in your CI for the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i agree with black and flake8 but mypy seems to also check type hints. It might be useful to include it in case something changes with the next python version, no?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's fair. But mypy has also know to break some APIs, although I can't think of any in particular.

Copy link
Contributor

Choose a reason for hiding this comment

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

or maybe it was that it became more strict. Either way, I've seen where a bump in mypy has caused failures


meta = with lib;{
description = "check hydra for the build status of a package";
homepage = "https://github.com/nix-community/hydra-check";
license = licenses.mit;
maintainers = with maintainers; [ makefu ];
};
}

2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12112,6 +12112,8 @@ in

hydraAntLogger = callPackage ../development/libraries/java/hydra-ant-logger { };

hydra-check = with python3.pkgs; toPythonApplication hydra-check;

hyena = callPackage ../development/libraries/hyena { };

hyperscan = callPackage ../development/libraries/hyperscan { };
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4004,6 +4004,8 @@ in {

hypothesis = callPackage ../development/python-modules/hypothesis { };

hydra-check = callPackage ../development/python-modules/hydra-check { };

colored = callPackage ../development/python-modules/colored { };

xdg = callPackage ../development/python-modules/xdg { };
Expand Down