From 47403cf3866c1bb5498b7fe9f1758f379d9d58ab Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 26 Apr 2017 19:02:17 +0200 Subject: [PATCH 01/11] pytest-httpbin: init at 0.2.3 --- .../python-modules/pytest-httpbin/default.nix | 30 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-httpbin/default.nix diff --git a/pkgs/development/python-modules/pytest-httpbin/default.nix b/pkgs/development/python-modules/pytest-httpbin/default.nix new file mode 100644 index 000000000000..8818fd04fa17 --- /dev/null +++ b/pkgs/development/python-modules/pytest-httpbin/default.nix @@ -0,0 +1,30 @@ +{ buildPythonPackage +, lib +, fetchurl +, pythonPackages +}: + +let + pname = "pytest-httpbin"; + version = "0.2.3"; +in buildPythonPackage rec { + name = "${pname}-${version}"; + + src = fetchurl { + url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz"; + sha256 = "1y0v2v7xpzpyd4djwp7ad8ifnlxp8r1y6dfbxg5ckzvllkgridn5"; + }; + + buildInputs = with pythonPackages; [ pytest httpbin ]; + propagatedBuildInputs = []; + + # Tests in neither the archive nor the repo + doCheck = false; + + meta = { + description = "py.test plugin to store test expectations and mark tests based on them"; + homepage = https://github.com/gsnedders/pytest-expect; + license = lib.licenses.mit; + }; +} + diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 756351110493..4ab2229ab7e7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5191,6 +5191,8 @@ in { }; }; + pytest-httpbin = callPackage ../development/python-modules/pytest-httpbin { }; + pytestcache = buildPythonPackage rec { name = "pytest-cache-1.0"; src = pkgs.fetchurl { From 87ce1e73a5e032b1b6874266fb4086f9809a97b9 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 26 Apr 2017 19:35:22 +0200 Subject: [PATCH 02/11] pythonPackages.coveralls: init at 1.1 --- .../python-modules/coveralls/default.nix | 35 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/development/python-modules/coveralls/default.nix diff --git a/pkgs/development/python-modules/coveralls/default.nix b/pkgs/development/python-modules/coveralls/default.nix new file mode 100644 index 000000000000..d2c621de43cf --- /dev/null +++ b/pkgs/development/python-modules/coveralls/default.nix @@ -0,0 +1,35 @@ +{ buildPythonPackage +, lib +, fetchurl +, pythonPackages +}: + +let + pname = "coveralls"; + version = "1.1"; +in buildPythonPackage rec { + name = "${pname}-${version}"; + + src = fetchurl { + url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz"; + sha256 = "0238hgdwbvriqxrj22zwh0rbxnhh9c6hh75i39ll631vq62h65il"; + }; + + buildInputs = with pythonPackages; [ + coverage + docopt + requests + ]; + propagatedBuildInputs = []; + + # Tests in neither the archive nor the repo + doCheck = false; + + meta = { + description = "py.test plugin to store test expectations and mark tests based on them"; + homepage = https://github.com/gsnedders/pytest-expect; + license = lib.licenses.mit; + }; +} + + diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4ab2229ab7e7..c9a3da94894b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4388,6 +4388,8 @@ in { }; }; + coveralls = callPackage ../development/python-modules/coveralls { }; + coverage = buildPythonPackage rec { name = "coverage-4.0.1"; From 7735348d77a004e752bb26100117d5c4920f31d0 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 25 Apr 2017 12:41:28 +0200 Subject: [PATCH 03/11] pythonPackages.vcrpy: init at 1.10.5 --- .../python-modules/vcrpy/default.nix | 28 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 8 ++++-- 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/python-modules/vcrpy/default.nix diff --git a/pkgs/development/python-modules/vcrpy/default.nix b/pkgs/development/python-modules/vcrpy/default.nix new file mode 100644 index 000000000000..a5a17cb7dd93 --- /dev/null +++ b/pkgs/development/python-modules/vcrpy/default.nix @@ -0,0 +1,28 @@ +{ lib, pkgs, pythonPackages }: + +pythonPackages.buildPythonPackage rec { + version = "1.10.5"; + name = "vcrpy-${version}"; + + src = pkgs.fetchurl { + url = "mirror://pypi/v/vcrpy/vcrpy-${version}.tar.gz"; + sha256 = "12kncg6jyvj15mi8ca74514f2x1ih753nhyz769nwvh39r468167"; + }; + + buildInputs = with pythonPackages; [ + pyyaml + mock + contextlib2 + wrapt + pytest_27 + httpbin + pytest-httpbin + ]; + + 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/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c9a3da94894b..f09dd8a67bf1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10231,6 +10231,8 @@ in { }; }; + vcrpy = callPackage ../development/python-modules/vcrpy { }; + venusian = buildPythonPackage rec { name = "venusian-1.0"; @@ -13200,9 +13202,9 @@ in { license = with licenses; [ lgpl21 ]; }; }; - + iso-639 = callPackage ../development/python-modules/iso-639 {}; - + iso3166 = callPackage ../development/python-modules/iso3166 {}; iso8601 = buildPythonPackage rec { @@ -15612,7 +15614,7 @@ in { patches = [ (pkgs.fetchpatch { - url = https://github.com/drkjam/netaddr/commit/2ab73f10be7069c9412e853d2d0caf29bd624012.patch; + url = https://github.com/drkjam/netaddr/commit/2ab73f10be7069c9412e853d2d0caf29bd624012.patch; sha256 = "08rn1s3w9424jhandy4j9sksy852ny00088zh15nirw5ajqg1dn7"; }) ]; From 7213b3bbdf5f9c5a1c5708787074ed12f51999ad Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 25 Apr 2017 12:41:51 +0200 Subject: [PATCH 04/11] rtv: 1.14.1 -> 1.15.1 --- pkgs/applications/misc/rtv/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/rtv/default.nix b/pkgs/applications/misc/rtv/default.nix index 20f8df8da482..289dedf35aad 100644 --- a/pkgs/applications/misc/rtv/default.nix +++ b/pkgs/applications/misc/rtv/default.nix @@ -1,14 +1,14 @@ { stdenv, fetchFromGitHub, pkgs, lib, python, pythonPackages }: pythonPackages.buildPythonApplication rec { - version = "1.14.1"; + version = "1.15.1"; name = "rtv-${version}"; src = fetchFromGitHub { owner = "michael-lazar"; repo = "rtv"; rev = "v${version}"; - sha256 = "03106sdsvj4zjjaqqg7qvm3n959plvy08a6n28ir1yf67kwzsx8a"; + sha256 = "037dhds1prxj7vsq15dr46wk3pfk3ixr0d60m3h796b6nbc1spya"; }; propagatedBuildInputs = with pythonPackages; [ @@ -20,6 +20,15 @@ pythonPackages.buildPythonApplication rec { praw kitchen praw + vcrpy + pylint + coverage + pytest + coveralls + contextlib2 + backports_functools_lru_cache + pyyaml + docopt ] ++ lib.optional (!pythonPackages.isPy3k) futures; meta = with lib; { From 268e88830c06846a2aa614697593bc018c1d1dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 27 Apr 2017 07:39:32 +0200 Subject: [PATCH 05/11] rtv: enable tests; split of test dependencies --- pkgs/applications/misc/rtv/default.nix | 44 ++++++++++++++++---------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/misc/rtv/default.nix b/pkgs/applications/misc/rtv/default.nix index 289dedf35aad..e8b3eeda01ad 100644 --- a/pkgs/applications/misc/rtv/default.nix +++ b/pkgs/applications/misc/rtv/default.nix @@ -1,6 +1,7 @@ -{ stdenv, fetchFromGitHub, pkgs, lib, python, pythonPackages }: +{ stdenv, fetchFromGitHub, pkgs, pythonPackages }: -pythonPackages.buildPythonApplication rec { +with pythonPackages; +buildPythonApplication rec { version = "1.15.1"; name = "rtv-${version}"; @@ -11,27 +12,36 @@ pythonPackages.buildPythonApplication rec { sha256 = "037dhds1prxj7vsq15dr46wk3pfk3ixr0d60m3h796b6nbc1spya"; }; - propagatedBuildInputs = with pythonPackages; [ + checkPhase = '' + py.test + ''; + + buildInputs = [ + coverage + coveralls + docopt + mock + pylint + pytest + vcrpy + ]; + + propagatedBuildInputs = [ + backports_functools_lru_cache beautifulsoup4 + configparser + contextlib2 + decorator + kitchen mailcap-fix - tornado + mccabe requests2 six - praw - kitchen - praw - vcrpy - pylint - coverage - pytest - coveralls - contextlib2 - backports_functools_lru_cache + tornado pyyaml - docopt - ] ++ lib.optional (!pythonPackages.isPy3k) futures; + ]; - meta = with lib; { + meta = with stdenv.lib; { homepage = https://github.com/michael-lazar/rtv; description = "Browse Reddit from your Terminal"; license = licenses.mit; From dbed1169894285790fed68cbab16e2bf852ecf2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 27 Apr 2017 07:40:38 +0200 Subject: [PATCH 06/11] pythonPackages.kitchen: 1.1.1 -> 1.2.4 --- .../python-modules/kitchen/default.nix | 17 +++++++++++++++++ pkgs/top-level/python-packages.nix | 12 +----------- 2 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 pkgs/development/python-modules/kitchen/default.nix diff --git a/pkgs/development/python-modules/kitchen/default.nix b/pkgs/development/python-modules/kitchen/default.nix new file mode 100644 index 000000000000..6464696ff8f0 --- /dev/null +++ b/pkgs/development/python-modules/kitchen/default.nix @@ -0,0 +1,17 @@ +{ stdenv, buildPythonPackage, fetchPypi }: +buildPythonPackage rec { + pname = "kitchen"; + version = "1.2.4"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "0ggv3p4x8jvmmzhp0xm00h6pvh1g0gmycw71rjwagnrj8n23vxrq"; + }; + + meta = with stdenv.lib; { + description = "Kitchen contains a cornucopia of useful code"; + license = license.lgpl; + maintainers = with maintainers; [ mornfall ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f09dd8a67bf1..5ce435683647 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13593,17 +13593,7 @@ in { }; }; - kitchen = buildPythonPackage (rec { - name = "kitchen-1.1.1"; - disabled = isPy3k; - - meta.maintainers = with maintainers; [ mornfall ]; - - src = pkgs.fetchurl { - url = "mirror://pypi/k/kitchen/kitchen-1.1.1.tar.gz"; - sha256 = "0ki840hjk1q19w6icv0dj2jxb00966nwy9b1jib0dgdspj00yrr5"; - }; - }); + kitchen = callPackage ../development/python-modules/kitchen/default.nix { }; pylast = buildPythonPackage rec { name = "pylast-${version}"; From e66c9221d6ebea2e79c9a3a27643dc32429f2c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 27 Apr 2017 08:24:07 +0200 Subject: [PATCH 07/11] pythonPackages.httpbin: 0.2.0 -> 0.5.0 --- .../python-modules/httpbin/default.nix | 27 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 18 +------------ 2 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 pkgs/development/python-modules/httpbin/default.nix diff --git a/pkgs/development/python-modules/httpbin/default.nix b/pkgs/development/python-modules/httpbin/default.nix new file mode 100644 index 000000000000..72917fdd771b --- /dev/null +++ b/pkgs/development/python-modules/httpbin/default.nix @@ -0,0 +1,27 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, flask +, markupsafe +, decorator +, itsdangerous +, six }: + +buildPythonPackage rec { + pname = "httpbin"; + version = "0.5.0"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "6b57f563900ecfe126015223a259463848daafbdc2687442317c0992773b9054"; + }; + + propagatedBuildInputs = [ flask markupsafe decorator itsdangerous six ]; + + meta = with stdenv.lib; { + homepage = https://github.com/kennethreitz/httpbin; + description = "HTTP Request & Response Service"; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5ce435683647..6406606e38da 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12721,23 +12721,7 @@ in { }; }); - httpbin = buildPythonPackage rec { - name = "httpbin-0.2.0"; - - src = pkgs.fetchurl { - url = "mirror://pypi/h/httpbin/${name}.tar.gz"; - sha256 = "6b57f563900ecfe126015223a259463848daafbdc2687442317c0992773b9054"; - }; - - propagatedBuildInputs = with self; [ flask markupsafe decorator itsdangerous six ]; - - meta = { - homepage = https://github.com/kennethreitz/httpbin; - description = "HTTP Request & Response Service"; - license = licenses.mit; - }; - - }; + httpbin = callPackage ../development/python-modules/httpbin { }; httplib2 = buildPythonPackage rec { name = "httplib2-0.9.2"; From c7975509573a75e579a09bf6460a8a7e98217ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 27 Apr 2017 08:24:55 +0200 Subject: [PATCH 08/11] pythonPackages.pytest-httpbin: correct `meta`; tests --- .../python-modules/pytest-httpbin/default.nix | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/pytest-httpbin/default.nix b/pkgs/development/python-modules/pytest-httpbin/default.nix index 8818fd04fa17..a31c9ba35bbe 100644 --- a/pkgs/development/python-modules/pytest-httpbin/default.nix +++ b/pkgs/development/python-modules/pytest-httpbin/default.nix @@ -1,29 +1,35 @@ { buildPythonPackage , lib -, fetchurl -, pythonPackages +, fetchFromGitHub +, pytest +, flask +, decorator +, httpbin +, six +, requests2 }: -let - pname = "pytest-httpbin"; +buildPythonPackage rec { + name = "pytest-httpbin-${version}"; version = "0.2.3"; -in buildPythonPackage rec { - name = "${pname}-${version}"; - src = fetchurl { - url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz"; - sha256 = "1y0v2v7xpzpyd4djwp7ad8ifnlxp8r1y6dfbxg5ckzvllkgridn5"; + src = fetchFromGitHub { + owner = "kevin1024"; + repo = "pytest-httpbin"; + rev = "v${version}"; + sha256 = "0j3n12jjy8cm0va8859wqra6abfyajrgh2qj8bhcngf3a72zl9ks"; }; - buildInputs = with pythonPackages; [ pytest httpbin ]; - propagatedBuildInputs = []; + checkPhase = '' + py.test -k "not test_chunked_encoding" + ''; - # Tests in neither the archive nor the repo - doCheck = false; + buildInputs = [ pytest ]; + propagatedBuildInputs = [ flask decorator httpbin six requests2 ]; meta = { - description = "py.test plugin to store test expectations and mark tests based on them"; - homepage = https://github.com/gsnedders/pytest-expect; + description = "Easily test your HTTP library against a local copy of httpbin.org"; + homepage = https://github.com/kevin1024/pytest-httpbin; license = lib.licenses.mit; }; } From 237d61939de60d114356d3fa7fc61019dc0ce1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 27 Apr 2017 08:29:59 +0200 Subject: [PATCH 09/11] pythonPackages.vcrpy: enable tests --- .../python-modules/vcrpy/default.nix | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/vcrpy/default.nix b/pkgs/development/python-modules/vcrpy/default.nix index a5a17cb7dd93..c925649b8b2b 100644 --- a/pkgs/development/python-modules/vcrpy/default.nix +++ b/pkgs/development/python-modules/vcrpy/default.nix @@ -1,6 +1,17 @@ -{ lib, pkgs, pythonPackages }: +{ buildPythonPackage +, lib +, pkgs +, pyyaml +, mock +, contextlib2 +, wrapt +, pytest_27 +, httpbin +, pytest-httpbin +, yarl +}: -pythonPackages.buildPythonPackage rec { +buildPythonPackage rec { version = "1.10.5"; name = "vcrpy-${version}"; @@ -9,7 +20,7 @@ pythonPackages.buildPythonPackage rec { sha256 = "12kncg6jyvj15mi8ca74514f2x1ih753nhyz769nwvh39r468167"; }; - buildInputs = with pythonPackages; [ + buildInputs = [ pyyaml mock contextlib2 @@ -17,8 +28,13 @@ pythonPackages.buildPythonPackage rec { pytest_27 httpbin pytest-httpbin + yarl ]; + checkPhase = '' + py.test --ignore=tests/integration -k "TestVCRConnection.testing_connect" + ''; + meta = with lib; { description = "Automatically mock your HTTP interactions to simplify and speed up testing"; homepage = https://github.com/kevin1024/vcrpy; From 3d10db7bc80e2ebd985b0bc0046dd264a42c45b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 27 Apr 2017 09:01:58 +0200 Subject: [PATCH 10/11] pythonPackages.coveralls: correct description --- .../python-modules/coveralls/default.nix | 46 +++++++++++++------ 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/coveralls/default.nix b/pkgs/development/python-modules/coveralls/default.nix index d2c621de43cf..59f66f36d876 100644 --- a/pkgs/development/python-modules/coveralls/default.nix +++ b/pkgs/development/python-modules/coveralls/default.nix @@ -1,33 +1,49 @@ { buildPythonPackage , lib -, fetchurl -, pythonPackages +, fetchPypi +, mock +, pytest_27 +, sh +, coverage +, docopt +, requests2 +, git }: -let +buildPythonPackage rec { pname = "coveralls"; + name = "${pname}-python-${version}"; version = "1.1"; -in buildPythonPackage rec { - name = "${pname}-${version}"; - src = fetchurl { - url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz"; + # wanted by tests + src = fetchPypi { + inherit pname version; sha256 = "0238hgdwbvriqxrj22zwh0rbxnhh9c6hh75i39ll631vq62h65il"; }; - buildInputs = with pythonPackages; [ - coverage - docopt - requests + buildInputs = [ + mock + sh + pytest_27 + git ]; - propagatedBuildInputs = []; - # Tests in neither the archive nor the repo + # FIXME: tests requires .git directory to be present doCheck = false; + checkPhase = '' + python setup.py test + ''; + + propagatedBuildInputs = [ + coverage + docopt + requests2 + ]; + meta = { - description = "py.test plugin to store test expectations and mark tests based on them"; - homepage = https://github.com/gsnedders/pytest-expect; + description = "Show coverage stats online via coveralls.io"; + homepage = https://github.com/coveralls-clients/coveralls-python; license = lib.licenses.mit; }; } From 9079676fe1dda3624b77536200653fb25b541cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 27 Apr 2017 09:07:38 +0200 Subject: [PATCH 11/11] pythonPackages.kitchen: fix evaluation error --- pkgs/development/python-modules/kitchen/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/kitchen/default.nix b/pkgs/development/python-modules/kitchen/default.nix index 6464696ff8f0..895cdedcb6e8 100644 --- a/pkgs/development/python-modules/kitchen/default.nix +++ b/pkgs/development/python-modules/kitchen/default.nix @@ -11,7 +11,7 @@ buildPythonPackage rec { meta = with stdenv.lib; { description = "Kitchen contains a cornucopia of useful code"; - license = license.lgpl; + license = licenses.lgpl2; maintainers = with maintainers; [ mornfall ]; }; }