Skip to content

Commit

Permalink
Merge pull request NixOS#65217 from marsam/fix-cherrypy-build
Browse files Browse the repository at this point in the history
pythonPackages.cherrypy: fix build
  • Loading branch information
marsam authored Jul 23, 2019
2 parents 3d84cff + d57d67e commit c248435
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
, buildPythonPackage
, fetchPypi
, setuptools_scm
, pythonOlder
, isPy3k
, pytest
}:

if !(pythonOlder "3.3") then null else buildPythonPackage rec {
buildPythonPackage rec {
pname = "backports.functools_lru_cache";
version = "1.5";

Expand All @@ -15,7 +16,15 @@ if !(pythonOlder "3.3") then null else buildPythonPackage rec {
};

buildInputs = [ setuptools_scm ];
doCheck = false; # No proper test

checkInputs = [ pytest ];

checkPhase = ''
pytest
'';

# Test fail on Python 2
doCheck = isPy3k;

meta = {
description = "Backport of functools.lru_cache";
Expand Down
35 changes: 13 additions & 22 deletions pkgs/development/python-modules/cheroot/default.nix
Original file line number Diff line number Diff line change
@@ -1,39 +1,30 @@
{ stdenv, fetchPypi, buildPythonPackage, fetchpatch
, more-itertools, six
, pytest, pytestcov, portend
, backports_unittest-mock
{ stdenv, fetchPypi, buildPythonPackage
, more-itertools, six, setuptools_scm, setuptools-scm-git-archive
, pytest, pytestcov, portend, pytest-testmon, pytest-mock
, backports_unittest-mock, pyopenssl, requests, trustme, requests-unixsocket
, backports_functools_lru_cache }:

buildPythonPackage rec {
pname = "cheroot";
version = "6.3.3";
version = "6.5.5";

src = fetchPypi {
inherit pname version;
sha256 = "8e3ac15e1efffc81425a693e99b3c09d7ea4bf947255d8d4c38e2cf76f3a4d25";
sha256 = "f6a85e005adb5bc5f3a92b998ff0e48795d4d98a0fbb7edde47a7513d4100601";
};

patches = fetchpatch {
name = "cheroot-fix-setup-python3.patch";
url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/cheroot-fix-setup-python3.patch?h=packages/python-cheroot&id=9b33cb0885b3c0d91adeacae23761a4321eb0e64";
sha256 = "1rlgz0qln536y00mfqlf0i9hz3f53id73wh47cg5q2vcsw1w2bpc";
};
nativeBuildInputs = [ setuptools_scm setuptools-scm-git-archive ];

propagatedBuildInputs = [ more-itertools six backports_functools_lru_cache ];

checkInputs = [ pytest pytestcov portend backports_unittest-mock ];

# Disable testmon, it needs pytest-testmon, which we do not currently have in nikpkgs,
# and is only used to skip some tests that are already known to work.
postPatch = ''
substituteInPlace "./pytest.ini" --replace "--testmon" ""
substituteInPlace setup.py --replace "use_scm_version=True" "version=\"${version}\"" \
--replace "'setuptools_scm>=1.15.0'," "" \
--replace "'setuptools_scm_git_archive>=1.0'," "" \
'';
checkInputs = [ pytest pytestcov portend backports_unittest-mock pytest-mock pytest-testmon pyopenssl requests trustme requests-unixsocket ];

# Disable doctest plugin because times out
# Deselect test_bind_addr_unix on darwin because times out
# Deselect test_http_over_https_error on darwin because builtin cert fails
checkPhase = ''
py.test cheroot
substituteInPlace pytest.ini --replace "--doctest-modules" ""
pytest ${stdenv.lib.optionalString stdenv.isDarwin "--deselect=cheroot/test/test_ssl.py::test_http_over_https_error --deselect=cheroot/test/test_server.py::test_bind_addr_unix"}
'';

meta = with stdenv.lib; {
Expand Down
10 changes: 5 additions & 5 deletions pkgs/development/python-modules/cherrypy/17.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{ lib, buildPythonPackage, fetchPypi
{ stdenv, buildPythonPackage, fetchPypi
, setuptools_scm
, cheroot, contextlib2, portend, routes, six, zc_lockfile
, backports_unittest-mock, objgraph, pathpy, pytest, pytestcov, backports_functools_lru_cache, requests_toolbelt
}:

buildPythonPackage rec {
pname = "cherrypy";
version = "17.4.1";
version = "17.4.2";

src = fetchPypi {
pname = "CherryPy";
inherit version;
sha256 = "1kl17anzz535jgkn9qcy0c2m0zlafph0iv7ph3bb9mfrs2bgvagv";
sha256 = "ef1619ad161f526745d4f0e4e517753d9d985814f1280e330661333d2ba05cdf";
};

propagatedBuildInputs = [
Expand All @@ -25,10 +25,10 @@ buildPythonPackage rec {
];

checkPhase = ''
pytest
pytest ${stdenv.lib.optionalString stdenv.isDarwin "--ignore=cherrypy/test/test_wsgi_unix_socket.py"}
'';

meta = with lib; {
meta = with stdenv.lib; {
homepage = https://www.cherrypy.org;
description = "A pythonic, object-oriented HTTP framework";
license = licenses.bsd3;
Expand Down
8 changes: 5 additions & 3 deletions pkgs/development/python-modules/cherrypy/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, buildPythonPackage, fetchPypi, isPy3k
{ stdenv, buildPythonPackage, fetchPypi, isPy3k
, setuptools_scm
, cheroot, portend, more-itertools, zc_lockfile, routes
, objgraph, pytest, pytestcov, pathpy, requests_toolbelt, pytest-services
Expand Down Expand Up @@ -29,11 +29,13 @@ buildPythonPackage rec {
objgraph pytest pytestcov pathpy requests_toolbelt pytest-services
];

# Disable doctest plugin because times out
checkPhase = ''
pytest
substituteInPlace pytest.ini --replace "--doctest-modules" ""
pytest --deselect=cherrypy/test/test_static.py::StaticTest::test_null_bytes ${stdenv.lib.optionalString stdenv.isDarwin "--deselect=cherrypy/test/test_bus.py::BusMethodTests::test_block"}
'';

meta = with lib; {
meta = with stdenv.lib; {
homepage = https://www.cherrypy.org;
description = "A pythonic, object-oriented HTTP framework";
license = licenses.bsd3;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/python-modules/portend/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ buildPythonPackage rec {
checkInputs = [ pytest ];

checkPhase = ''
py.test
py.test --deselect=test_portend.py::TestChecker::test_check_port_listening
'';

meta = with stdenv.lib; {
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/python-modules/pytest-testmon/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

buildPythonPackage rec {
pname = "pytest-testmon";
version = "0.9.16";
version = "0.9.18";

src = fetchPypi {
inherit pname version;
sha256 = "df00594e55f8f8f826e0e345dc23863ebac066eb749f8229c515a0373669c5bb";
sha256 = "05648f9b22aeeda9d32e61b46fa78c9ff28f217d69005b3b19ffb75d5992187e";
};

buildInputs = [ pytest ];
Expand All @@ -21,7 +21,7 @@ buildPythonPackage rec {
checkInputs = [ pytest ];

checkPhase = ''
pytest test
pytest --deselect=test/test_testmon.py::TestmonDeselect::test_dependent_testmodule
'';

meta = with lib; {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ stdenv, buildPythonPackage, fetchPypi, setuptools_scm, pytest }:

buildPythonPackage rec {
pname = "setuptools-scm-git-archive";
version = "1.1";

src = fetchPypi {
inherit version;
pname = "setuptools_scm_git_archive";
sha256 = "6026f61089b73fa1b5ee737e95314f41cb512609b393530385ed281d0b46c062";
};

nativeBuildInputs = [ setuptools_scm ];

checkInputs = [ pytest ];

meta = with stdenv.lib; {
description = "setuptools_scm plugin for git archives";
homepage = "https://github.com/Changaco/setuptools_scm_git_archive";
license = licenses.mit;
maintainers = [ maintainers.marsam ];
};
}
11 changes: 8 additions & 3 deletions pkgs/development/python-modules/tempora/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, buildPythonPackage, fetchPypi
, setuptools_scm
, setuptools_scm, pytest, freezegun, backports_unittest-mock
, six, pytz, jaraco_functools }:

buildPythonPackage rec {
Expand All @@ -11,12 +11,17 @@ buildPythonPackage rec {
sha256 = "cb60b1d2b1664104e307f8e5269d7f4acdb077c82e35cd57246ae14a3427d2d6";
};

doCheck = false;

buildInputs = [ setuptools_scm ];

propagatedBuildInputs = [ six pytz jaraco_functools ];

checkInputs = [ pytest freezegun backports_unittest-mock ];

checkPhase = ''
substituteInPlace pytest.ini --replace "--flake8" ""
pytest
'';

meta = with lib; {
description = "Objects and routines pertaining to date and time";
homepage = https://github.com/jaraco/tempora;
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4655,6 +4655,8 @@ in {

setuptools_scm = callPackage ../development/python-modules/setuptools_scm { };

setuptools-scm-git-archive = callPackage ../development/python-modules/setuptools-scm-git-archive { };

serverlessrepo = callPackage ../development/python-modules/serverlessrepo { };

shippai = callPackage ../development/python-modules/shippai {};
Expand Down

0 comments on commit c248435

Please sign in to comment.