{ lib , buildPythonPackage , fetchPypi , python , isPy27 }: buildPythonPackage rec { pname = "regex"; version = "2021.8.28"; src = fetchPypi { inherit pname version; sha256 = "f585cbbeecb35f35609edccb95efd95a3e35824cd7752b586503f7e6087303f1"; }; # Sources for different Python releases are located in same folder checkPhase = '' rm -r ${if !isPy27 then "regex_2" else "regex_3"} ${python.interpreter} -m unittest ''; pythonImportsCheck = [ "regex" ]; meta = with lib; { description = "Alternative regular expression module, to replace re"; homepage = "https://bitbucket.org/mrabarnett/mrab-regex"; license = licenses.psfl; maintainers = with maintainers; [ abbradar ]; }; }