1{ lib
2, buildPythonPackage
3, fetchPypi
4, python
5, isPy27
6}:
7
8buildPythonPackage rec {
9 pname = "regex";
10 version = "2021.11.10";
11
12 src = fetchPypi {
13 inherit pname version;
14 sha256 = "sha256-80HuLfCZm/33qV5EgHXv/g2yEqWTh94acGkOSssD1MY=";
15 };
16
17 # Sources for different Python releases are located in same folder
18 checkPhase = ''
19 rm -r ${if !isPy27 then "regex_2" else "regex_3"}
20 ${python.interpreter} -m unittest
21 '';
22
23 pythonImportsCheck = [ "regex" ];
24
25 meta = with lib; {
26 description = "Alternative regular expression module, to replace re";
27 homepage = "https://bitbucket.org/mrabarnett/mrab-regex";
28 license = licenses.psfl;
29 maintainers = with maintainers; [ abbradar ];
30 };
31}