python3Packages.dateparser: run tests

This commit is contained in:
Robert Schütz 2021-03-10 14:49:50 +01:00 committed by Frederik Rietdijk
parent d6c9bf042f
commit b06174986c

View file

@ -1,19 +1,17 @@
{ lib, fetchPypi, buildPythonPackage
, nose
, parameterized
, mock
, flake8
, glibcLocales
, six
, jdatetime
, dateutil
, umalqurra
, pytz
, tzlocal
, regex
, ruamel_yaml
, python
{ lib
, buildPythonPackage
, isPy3k
, fetchFromGitHub
, dateutil
, pytz
, regex
, tzlocal
, hijri-converter
, convertdate
, parameterized
, pytestCheckHook
, GitPython
, ruamel_yaml
}:
buildPythonPackage rec {
@ -22,42 +20,36 @@ buildPythonPackage rec {
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "159cc4e01a593706a15cd4e269a0b3345edf3aef8bf9278a57dac8adf5bf1e4a";
src = fetchFromGitHub {
owner = "scrapinghub";
repo = "dateparser";
rev = "v${version}";
sha256 = "0i6ci14lqfsqrmaif57dyilrjbxzmbl98hps1b565gkiy1xqmjhl";
};
checkInputs = [
flake8
nose
mock
parameterized
six
glibcLocales
];
preCheck =''
# skip because of missing convertdate module, which is an extra requirement
rm tests/test_jalali.py
'';
checkPhase = ''
${python.interpreter} -m unittest discover -s tests
'';
# Strange
# AttributeError: 'module' object has no attribute 'config'
doCheck = false;
propagatedBuildInputs = [
# install_requires
dateutil pytz regex tzlocal
# extra_requires
jdatetime ruamel_yaml umalqurra
hijri-converter convertdate
];
checkInputs = [
parameterized
pytestCheckHook
GitPython
ruamel_yaml
];
# Upstream only runs the tests in tests/ in CI, others use git clone
pytestFlagsArray = [ "tests" ];
pythonImportsCheck = [ "dateparser" ];
meta = with lib; {
description = "Date parsing library designed to parse dates from HTML pages";
homepage = "https://github.com/scrapinghub/dateparser";
license = licenses.bsd3;
maintainers = with maintainers; [ dotlambda ];
};
}