diff options
-rw-r--r-- | pkgs/development/python-modules/construct/2.10.54.nix | 29 | ||||
-rw-r--r-- | pkgs/development/python-modules/convertdate/2.2.x.nix | 36 | ||||
-rw-r--r-- | pkgs/development/python-modules/convertdate/default.nix | 3 | ||||
-rw-r--r-- | pkgs/development/python-modules/dateparser/0.x.nix | 55 | ||||
-rw-r--r-- | pkgs/development/python-modules/vcrpy/3.nix | 48 | ||||
-rw-r--r-- | pkgs/development/python-modules/vcrpy/default.nix | 3 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 20 |
7 files changed, 190 insertions, 4 deletions
diff --git a/pkgs/development/python-modules/construct/2.10.54.nix b/pkgs/development/python-modules/construct/2.10.54.nix new file mode 100644 index 0000000000000..6bb279490ab29 --- /dev/null +++ b/pkgs/development/python-modules/construct/2.10.54.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, buildPythonPackage, fetchFromGitHub, pythonOlder +, six, pytestCheckHook, pytest-benchmark, enum34, numpy, arrow, ruamel_yaml +}: + +buildPythonPackage rec { + pname = "construct"; + version = "2.10.54"; + + # no tests in PyPI tarball + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v${version}"; + sha256 = "1mqspsn6bf3ibvih1zna2glkg8iw7vy5zg9gzg0d1m8zcndk2c48"; + }; + + checkInputs = [ pytestCheckHook pytest-benchmark enum34 numpy arrow ruamel_yaml ]; + + disabledTests = lib.optionals stdenv.isDarwin [ "test_multiprocessing" ]; + + pytestFlagsArray = [ "--benchmark-disable" ]; + + meta = with lib; { + description = "Powerful declarative parser (and builder) for binary data"; + homepage = "https://construct.readthedocs.org/"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/convertdate/2.2.x.nix b/pkgs/development/python-modules/convertdate/2.2.x.nix new file mode 100644 index 0000000000000..d67f4c5a3449d --- /dev/null +++ b/pkgs/development/python-modules/convertdate/2.2.x.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pymeeus +, pytz +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "convertdate"; + version = "2.2.2"; + + # Tests are not available in the PyPI tarball so use GitHub instead. + src = fetchFromGitHub { + owner = "fitnr"; + repo = pname; + rev = "v${version}"; + sha256 = "1xgi7x9b9kxm0q51bqnmwdm5lp8vwhx5yk4d1b23r37spz9dbhw5"; + }; + + propagatedBuildInputs = [ + pymeeus + pytz + ]; + + checkInputs = [ + pytestCheckHook + ]; + + meta = with lib; { + homepage = "https://github.com/fitnr/convertdate"; + description = "Utils for converting between date formats and calculating holidays"; + license = licenses.mit; + maintainers = with maintainers; [ jluttine ]; + }; +} diff --git a/pkgs/development/python-modules/convertdate/default.nix b/pkgs/development/python-modules/convertdate/default.nix index f285a74e5449a..0dee95541b082 100644 --- a/pkgs/development/python-modules/convertdate/default.nix +++ b/pkgs/development/python-modules/convertdate/default.nix @@ -1,5 +1,6 @@ { lib , buildPythonPackage +, isPy27 , fetchFromGitHub , pymeeus , pytz @@ -10,6 +11,8 @@ buildPythonPackage rec { pname = "convertdate"; version = "2.3.0"; + disabled = isPy27; + # Tests are not available in the PyPI tarball so use GitHub instead. src = fetchFromGitHub { owner = "fitnr"; diff --git a/pkgs/development/python-modules/dateparser/0.x.nix b/pkgs/development/python-modules/dateparser/0.x.nix new file mode 100644 index 0000000000000..49e2d1f2796eb --- /dev/null +++ b/pkgs/development/python-modules/dateparser/0.x.nix @@ -0,0 +1,55 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, mock +, parameterized +, pytestCheckHook +, dateutil +, pytz +, regex +, tzlocal +, convertdate +, umalqurra +, jdatetime +, ruamel_yaml +}: + +buildPythonPackage rec { + pname = "dateparser"; + version = "0.7.6"; + + src = fetchFromGitHub { + owner = "scrapinghub"; + repo = "dateparser"; + rev = "v${version}"; + sha256 = "0j3sm4hlx7z0ci5fnjq5n9i02vvlfz0wxa889ydryfknjhy5apqw"; + }; + + checkInputs = [ + mock + parameterized + pytestCheckHook + ]; + + pytestFlagsArray = [ "tests" ]; + + disabledTestPaths = [ + "tests/test_dateparser_data_integrity.py" # ImportError: No module named ruamel.yaml + ]; + + propagatedBuildInputs = [ + # install_requires + dateutil pytz regex tzlocal + # extra_requires + convertdate umalqurra jdatetime ruamel_yaml + ]; + + 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 ]; + }; +} diff --git a/pkgs/development/python-modules/vcrpy/3.nix b/pkgs/development/python-modules/vcrpy/3.nix new file mode 100644 index 0000000000000..ddd4015aad1e7 --- /dev/null +++ b/pkgs/development/python-modules/vcrpy/3.nix @@ -0,0 +1,48 @@ +{ buildPythonPackage +, lib +, six +, fetchPypi +, pyyaml +, mock +, contextlib2 +, wrapt +, pytest +, pytest-httpbin +, yarl +, pythonOlder +, pythonAtLeast +}: + +buildPythonPackage rec { + pname = "vcrpy"; + version = "3.0.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "21168d5ae14263a833d4b71acfd8278d8841114f24be1b4ab4a5719d0c7f07bc"; + }; + + checkInputs = [ + pytest + pytest-httpbin + ]; + + propagatedBuildInputs = [ + pyyaml + wrapt + six + ] + ++ lib.optionals (pythonOlder "3.3") [ contextlib2 mock ] + ++ lib.optionals (pythonAtLeast "3.4") [ yarl ]; + + checkPhase = '' + py.test --ignore=tests/integration -k "not TestVCRConnection" + ''; + + meta = with lib; { + description = "Automatically mock your HTTP interactions to simplify and speed up testing"; + homepage = "https://github.com/kevin1024/vcrpy"; + license = licenses.mit; + }; +} + diff --git a/pkgs/development/python-modules/vcrpy/default.nix b/pkgs/development/python-modules/vcrpy/default.nix index e67bbc59e9329..7766e75ba05ee 100644 --- a/pkgs/development/python-modules/vcrpy/default.nix +++ b/pkgs/development/python-modules/vcrpy/default.nix @@ -1,5 +1,6 @@ { buildPythonPackage , lib +, isPy27 , six , fetchPypi , pyyaml @@ -17,6 +18,8 @@ buildPythonPackage rec { pname = "vcrpy"; version = "4.1.1"; + disabled = isPy27; + src = fetchPypi { inherit pname version; sha256 = "57095bf22fc0a2d99ee9674cdafebed0f3ba763018582450706f7d3a74fff599"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 13243ecb18173..45877d3c2e0a7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1462,7 +1462,10 @@ in { constantly = callPackage ../development/python-modules/constantly { }; - construct = callPackage ../development/python-modules/construct { }; + construct = if isPy27 then + callPackage ../development/python-modules/construct/2.10.54.nix { } + else + callPackage ../development/python-modules/construct { }; consul = callPackage ../development/python-modules/consul { }; @@ -1472,7 +1475,10 @@ in { contextvars = callPackage ../development/python-modules/contextvars { }; - convertdate = callPackage ../development/python-modules/convertdate { }; + convertdate = if isPy27 then + callPackage ../development/python-modules/convertdate/2.2.x.nix { } + else + callPackage ../development/python-modules/convertdate { }; cookiecutter = callPackage ../development/python-modules/cookiecutter { }; @@ -1666,7 +1672,10 @@ in { inherit (pkgs.llvmPackages) libcxx; }; - dateparser = callPackage ../development/python-modules/dateparser { }; + dateparser = if isPy27 then + callPackage ../development/python-modules/dateparser/0.x.nix { } + else + callPackage ../development/python-modules/dateparser { }; datrie = callPackage ../development/python-modules/datrie { }; @@ -8357,7 +8366,10 @@ in { varint = callPackage ../development/python-modules/varint { }; - vcrpy = callPackage ../development/python-modules/vcrpy { }; + vcrpy = if isPy27 then + callPackage ../development/python-modules/vcrpy/3.nix { } + else + callPackage ../development/python-modules/vcrpy { }; vcver = callPackage ../development/python-modules/vcver { }; |