Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
nix: execute pytests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Jun 8, 2024
1 parent 406929c commit 8e6dbd6
Showing 1 changed file with 37 additions and 8 deletions.
45 changes: 37 additions & 8 deletions derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ let
version = "1.0.12";
format = "pyproject";

src = pkgs.fetchPypi {
inherit pname version;
hash = "sha256-vg14uOhPltsvxn0XlV0W9gy9dq3+vZpi/h3Hytmyc9k=";
src = pkgs.fetchFromGitHub {
owner = "job";
repo = pname;
rev = version;
hash = "sha256-tBo9LSmEu/0KPSeg17dlh7ngUvP9GyW6b01qqpr5Bx0=";
};

postPatch = ''
Expand All @@ -20,6 +22,7 @@ let
];

nativeCheckInputs = with pkgs.python3Packages; [
pytest
mock
coverage
nose
Expand All @@ -29,7 +32,14 @@ let
py-radix-sr
];

# TODO: execute tests
checkPhase = ''
runHook preCheck
pytest -vs -x tests
runHook postCheck
'';

doCheck = true;
};
in
Expand All @@ -38,9 +48,12 @@ pkgs.python3Packages.buildPythonPackage rec {
version = "1.22.1";
format = "pyproject";

src = pkgs.fetchPypi {
inherit pname version;
hash = "sha256-/s+y1KsUouH+kx+c44LjWh7PuuA1goPhEKvVaIoET2c=";
src = pkgs.fetchFromGitHub {
#inherit pname version;
owner = "pierky";
repo = pname;
rev = "v${version}";
hash = "sha256-8xYfTjtsMoLuDpJ8oLnDRP2oIcZvzlMESlREc2S1DmU=";
};

postPatch = ''
Expand All @@ -55,6 +68,14 @@ pkgs.python3Packages.buildPythonPackage rec {
bgpq4
];

nativeCheckInputs = with pkgs.python3Packages;[
pytest
];

checkInputs = with pkgs.python3Packages; [
requests-mock
];

propagatedBuildInputs = with pkgs.python3Packages; [
aggregate6
jinja2
Expand All @@ -66,6 +87,14 @@ pkgs.python3Packages.buildPythonPackage rec {
setuptools
];

doCheck = false;
checkPhase = ''
runHook preCheck
pytest -vs -x tests/static/
runHook postCheck
'';

doCheck = true;
}

0 comments on commit 8e6dbd6

Please sign in to comment.