1{ lib
2, fetchPypi
3, buildPythonPackage
4, logutils
5, mako
6, webtest
7, pythonOlder
8, pytestCheckHook
9, genshi
10, gunicorn
11, jinja2
12, six
13, sqlalchemy
14, virtualenv
15}:
16
17buildPythonPackage rec {
18 pname = "pecan";
19 version = "1.4.2";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.6";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-SbJV5wHD8UYWBfWw6PVPDCGSLXhF1BTCTdZAn+aV1VA=";
27 };
28
29 propagatedBuildInputs = [
30 logutils
31 mako
32 webtest
33 six
34 ];
35
36 nativeCheckInputs = [
37 pytestCheckHook
38 genshi
39 gunicorn
40 jinja2
41 sqlalchemy
42 virtualenv
43 ];
44
45 pytestFlagsArray = [
46 "--pyargs pecan"
47 # tests fail with sqlalchemy 2.0
48 ] ++ lib.optionals (lib.versionAtLeast sqlalchemy.version "2.0") [
49 # The 'sqlalchemy.orm.mapper()' function is removed as of SQLAlchemy
50 # 2.0. Use the 'sqlalchemy.orm.registry.map_imperatively()` method
51 # of the ``sqlalchemy.orm.registry`` class to perform classical
52 # mapping.
53 # https://github.com/pecan/pecan/issues/143
54 "--deselect=pecan/tests/test_jsonify.py::TestJsonifySQLAlchemyGenericEncoder::test_result_proxy"
55 "--deselect=pecan/tests/test_jsonify.py::TestJsonifySQLAlchemyGenericEncoder::test_row_proxy"
56 "--deselect=pecan/tests/test_jsonify.py::TestJsonifySQLAlchemyGenericEncoder::test_sa_object"
57 ];
58
59 pythonImportsCheck = [
60 "pecan"
61 ];
62
63 meta = with lib; {
64 changelog = "https://pecan.readthedocs.io/en/latest/changes.html";
65 description = "WSGI object-dispatching web framework";
66 homepage = "https://www.pecanpy.org/";
67 license = licenses.bsd3;
68 maintainers = with maintainers; [ applePrincess ];
69 };
70}