Merge pull request #100194 from SuperSandro2000/formencode

This commit is contained in:
Sandro 2020-11-26 22:57:37 +01:00 committed by GitHub
commit 039e317fe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,24 +1,28 @@
{ stdenv, buildPythonPackage, fetchPypi, dnspython, pycountry, nose }:
{ stdenv, buildPythonPackage, fetchPypi, dnspython, pycountry, nose, setuptools_scm, six, isPy27 }:
buildPythonPackage rec {
pname = "FormEncode";
version = "1.3.1";
version = "2.0.0";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "1xm77h2mds2prlaz0z4nzkx13g61rx5c2v3vpgjq9d5ij8bzb8md";
sha256 = "049pm276140h30xgzwylhpii24xcln1qfdlfmbj69sqpfhlr5szj";
};
buildInputs = [ dnspython pycountry nose ];
patchPhase = ''
# dnspython3 has been superseded, see its PyPI page
substituteInPlace setup.py --replace dnspython3 dnspython
postPatch = ''
sed -i 's/setuptools_scm_git_archive//' setup.py
sed -i 's/use_scm_version=.*,/version="${version}",/' setup.py
'';
nativeBuildInputs = [ setuptools_scm ];
propagatedBuildInputs = [ six ];
checkInputs = [ dnspython pycountry nose ];
preCheck = ''
# two tests require dns resolving
sed -i 's/test_cyrillic_email/noop/' formencode/tests/test_email.py
# requires dns resolving
sed -i 's/test_unicode_ascii_subgroup/noop/' formencode/tests/test_email.py
'';