mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
python3Packages.pyparsing: enable optional testing
This commit is contained in:
parent
96a92ca512
commit
8c2df17527
1 changed files with 39 additions and 22 deletions
|
@ -1,9 +1,15 @@
|
||||||
{ buildPythonPackage
|
{ buildPythonPackage
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, lib
|
, lib
|
||||||
|
|
||||||
|
# since this is a dependency of pytest, we need to avoid
|
||||||
|
# circular dependencies
|
||||||
|
, jinja2
|
||||||
|
, railroad-diagrams
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
let
|
||||||
|
pyparsing = buildPythonPackage rec {
|
||||||
pname = "pyparsing";
|
pname = "pyparsing";
|
||||||
version = "3.0.6";
|
version = "3.0.6";
|
||||||
|
|
||||||
|
@ -14,12 +20,21 @@ buildPythonPackage rec {
|
||||||
sha256 = "0n89ky7rx5yg09ssji8liahnyxip08hz7syc2k4pmlgs4978181a";
|
sha256 = "0n89ky7rx5yg09ssji8liahnyxip08hz7syc2k4pmlgs4978181a";
|
||||||
};
|
};
|
||||||
|
|
||||||
# only do unit tests, as diagram tests require railroad, which has
|
# circular dependencies if enabled by default
|
||||||
# been unmaintained since 2015
|
doCheck = false;
|
||||||
|
checkInputs = [
|
||||||
|
jinja2
|
||||||
|
railroad-diagrams
|
||||||
|
];
|
||||||
|
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
python -m unittest -k 'not testEmptyExpressionsAreHandledProperly' tests/test_unit.py
|
python -m unittest
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru.tests = {
|
||||||
|
check = pyparsing.overridePythonAttrs (_: { doCheck = true; });
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/pyparsing/pyparsing";
|
homepage = "https://github.com/pyparsing/pyparsing";
|
||||||
description = "An alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions";
|
description = "An alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions";
|
||||||
|
@ -28,4 +43,6 @@ buildPythonPackage rec {
|
||||||
kamadorueda
|
kamadorueda
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
in
|
||||||
|
pyparsing
|
||||||
|
|
Loading…
Reference in a new issue