pylons: remove pylons as dependency...
marcink -
r2351:59272121 default
Not Reviewed
Show More
Add another comment
TODOs: 0 unresolved 0 Resolved
COMMENTS: 0 General 0 Inline
@@ -61,23 +61,6
61 ];
61 ];
62 });
62 });
63
63
64 celery = super.celery.override (attrs: {
65 # The current version of kombu needs some patching to work with the
66 # other libs. Should be removed once we update celery and kombu.
67 patches = [
68 ./patch-celery-dateutil.diff
69 ];
70 });
71
72 kombu = super.kombu.override (attrs: {
73 # The current version of kombu needs some patching to work with the
74 # other libs. Should be removed once we update celery and kombu.
75 patches = [
76 ./patch-kombu-py-2-7-11.diff
77 ./patch-kombu-msgpack.diff
78 ];
79 });
80
81 lxml = super.lxml.override (attrs: {
64 lxml = super.lxml.override (attrs: {
82 # johbo: On 16.09 we need this to compile on darwin, otherwise compilation
65 # johbo: On 16.09 we need this to compile on darwin, otherwise compilation
83 # fails on Darwin.
66 # fails on Darwin.
@@ -133,10 +116,6
133 };
116 };
134 });
117 });
135
118
136 Pylons = super.Pylons.override (attrs: {
137 name = "Pylons-1.0.2.rhodecode-patch1";
138 });
139
140 pyramid = super.pyramid.override (attrs: {
119 pyramid = super.pyramid.override (attrs: {
141 postFixup = ''
120 postFixup = ''
142 wrapPythonPrograms
121 wrapPythonPrograms
@@ -184,30 +184,17
184 license = [ pkgs.lib.licenses.bsdOriginal ];
184 license = [ pkgs.lib.licenses.bsdOriginal ];
185 };
185 };
186 };
186 };
187 Pylons = super.buildPythonPackage {
187 Routes = super.buildPythonPackage {
188 name = "Pylons-1.0.2.dev20171106";
188 name = "Routes-2.4.1";
189 buildInputs = with self; [];
189 buildInputs = with self; [];
190 doCheck = false;
190 doCheck = false;
191 propagatedBuildInputs = with self; [Routes WebHelpers Beaker Paste PasteDeploy PasteScript FormEncode simplejson decorator nose Mako WebError WebTest Tempita MarkupSafe WebOb];
191 propagatedBuildInputs = with self; [six repoze.lru];
192 src = fetchurl {
192 src = fetchurl {
193 url = "https://code.rhodecode.com/upstream/pylons/archive/707354ee4261b9c10450404fc9852ccea4fd667d.tar.gz?md5=f26633726fa2cd3a340316ee6a5d218f";
193 url = "https://pypi.python.org/packages/33/38/ea827837e68d9c7dde4cff7ec122a93c319f0effc08ce92a17095576603f/Routes-2.4.1.tar.gz";
194 md5 = "f26633726fa2cd3a340316ee6a5d218f";
194 md5 = "c058dff6832941dec47e0d0052548ad8";
195 };
195 };
196 meta = {
196 meta = {
197 license = [ pkgs.lib.licenses.bsdOriginal ];
197 license = [ pkgs.lib.licenses.mit ];
198 };
199 };
200 Routes = super.buildPythonPackage {
201 name = "Routes-1.13";
202 buildInputs = with self; [];
203 doCheck = false;
204 propagatedBuildInputs = with self; [repoze.lru];
205 src = fetchurl {
206 url = "https://pypi.python.org/packages/88/d3/259c3b3cde8837eb9441ab5f574a660e8a4acea8f54a078441d4d2acac1c/Routes-1.13.tar.gz";
207 md5 = "d527b0ab7dd9172b1275a41f97448783";
208 };
209 meta = {
210 license = [ pkgs.lib.licenses.bsdOriginal ];
211 };
198 };
212 };
199 };
213 SQLAlchemy = super.buildPythonPackage {
200 SQLAlchemy = super.buildPythonPackage {
@@ -340,6 +327,19
340 license = [ pkgs.lib.licenses.mit ];
327 license = [ pkgs.lib.licenses.mit ];
341 };
328 };
342 };
329 };
330 amqp = super.buildPythonPackage {
331 name = "amqp-2.2.2";
332 buildInputs = with self; [];
333 doCheck = false;
334 propagatedBuildInputs = with self; [vine];
335 src = fetchurl {
336 url = "https://pypi.python.org/packages/e0/70/9ab9ccd8247fb7d2adb717e9f6a0ed358c9e1ab2c349048b0352f9e80ee2/amqp-2.2.2.tar.gz";
337 md5 = "0971a3fd2d635ded45c349cfc17106bd";
338 };
339 meta = {
340 license = [ pkgs.lib.licenses.bsdOriginal ];
341 };
342 };
343 amqplib = super.buildPythonPackage {
343 amqplib = super.buildPythonPackage {
344 name = "amqplib-1.0.2";
344 name = "amqplib-1.0.2";
345 buildInputs = with self; [];
345 buildInputs = with self; [];
@@ -353,19 +353,6
353 license = [ { fullName = "LGPL"; } { fullName = "GNU Library or Lesser General Public License (LGPL)"; } ];
353 license = [ { fullName = "LGPL"; } { fullName = "GNU Library or Lesser General Public License (LGPL)"; } ];
354 };
354 };
355 };
355 };
356 anyjson = super.buildPythonPackage {
357 name = "anyjson-0.3.3";
358 buildInputs = with self; [];
359 doCheck = false;
360 propagatedBuildInputs = with self; [];
361 src = fetchurl {
362 url = "https://pypi.python.org/packages/c3/4d/d4089e1a3dd25b46bebdb55a992b0797cff657b4477bc32ce28038fdecbc/anyjson-0.3.3.tar.gz";
363 md5 = "2ea28d6ec311aeeebaf993cb3008b27c";
364 };
365 meta = {
366 license = [ pkgs.lib.licenses.bsdOriginal ];
367 };
368 };
369 appenlight-client = super.buildPythonPackage {
356 appenlight-client = super.buildPythonPackage {
370 name = "appenlight-client-0.6.22";
357 name = "appenlight-client-0.6.22";
371 buildInputs = with self; [];
358 buildInputs = with self; [];
@@ -418,6 +405,19
418 license = [ pkgs.lib.licenses.mit ];
405 license = [ pkgs.lib.licenses.mit ];
419 };
406 };
420 };
407 };
408 billiard = super.buildPythonPackage {
409 name = "billiard-3.5.0.3";
410 buildInputs = with self; [];
411 doCheck = false;
412 propagatedBuildInputs = with self; [];
413 src = fetchurl {
414 url = "https://pypi.python.org/packages/39/ac/f5571210cca2e4f4532e38aaff242f26c8654c5e2436bee966c230647ccc/billiard-3.5.0.3.tar.gz";
415 md5 = "113ba481e48400adbf6fbbf59a2f8554";
416 };
417 meta = {
418 license = [ pkgs.lib.licenses.bsdOriginal ];
419 };
420 };
421 bleach = super.buildPythonPackage {
421 bleach = super.buildPythonPackage {
422 name = "bleach-1.5.0";
422 name = "bleach-1.5.0";
423 buildInputs = with self; [];
423 buildInputs = with self; [];
@@ -458,13 +458,13
458 };
458 };
459 };
459 };
460 celery = super.buildPythonPackage {
460 celery = super.buildPythonPackage {
461 name = "celery-2.2.10";
461 name = "celery-4.1.0";
462 buildInputs = with self; [];
462 buildInputs = with self; [];
463 doCheck = false;
463 doCheck = false;
464 propagatedBuildInputs = with self; [python-dateutil anyjson kombu pyparsing];
464 propagatedBuildInputs = with self; [pytz billiard kombu];
465 src = fetchurl {
465 src = fetchurl {
466 url = "https://pypi.python.org/packages/b1/64/860fd50e45844c83442e7953effcddeff66b2851d90b2d784f7201c111b8/celery-2.2.10.tar.gz";
466 url = "https://pypi.python.org/packages/07/65/88a2a45fc80f487872c93121a701a53bbbc3d3d832016876fac84fc8d46a/celery-4.1.0.tar.gz";
467 md5 = "898bc87e54f278055b561316ba73e222";
467 md5 = "db91e1d26936381127f01e150fe3054a";
468 };
468 };
469 meta = {
469 meta = {
470 license = [ pkgs.lib.licenses.bsdOriginal ];
470 license = [ pkgs.lib.licenses.bsdOriginal ];
@@ -1004,13 +1004,13
1004 };
1004 };
1005 };
1005 };
1006 kombu = super.buildPythonPackage {
1006 kombu = super.buildPythonPackage {
1007 name = "kombu-1.5.1";
1007 name = "kombu-4.1.0";
1008 buildInputs = with self; [];
1008 buildInputs = with self; [];
1009 doCheck = false;
1009 doCheck = false;
1010 propagatedBuildInputs = with self; [anyjson amqplib];
1010 propagatedBuildInputs = with self; [amqp];
1011 src = fetchurl {
1011 src = fetchurl {
1012 url = "https://pypi.python.org/packages/19/53/74bf2a624644b45f0850a638752514fc10a8e1cbd738f10804951a6df3f5/kombu-1.5.1.tar.gz";
1012 url = "https://pypi.python.org/packages/03/5e/1a47d1e543d4943d65330af4e4406049f443878818fb65bfdc651bb93a96/kombu-4.1.0.tar.gz";
1013 md5 = "50662f3c7e9395b3d0721fb75d100b63";
1013 md5 = "2fb2be9fec0e6514231bba23a3779439";
1014 };
1014 };
1015 meta = {
1015 meta = {
1016 license = [ pkgs.lib.licenses.bsdOriginal ];
1016 license = [ pkgs.lib.licenses.bsdOriginal ];
@@ -1094,19 +1094,6
1094 license = [ pkgs.lib.licenses.bsdOriginal ];
1094 license = [ pkgs.lib.licenses.bsdOriginal ];
1095 };
1095 };
1096 };
1096 };
1097 nose = super.buildPythonPackage {
1098 name = "nose-1.3.6";
1099 buildInputs = with self; [];
1100 doCheck = false;
1101 propagatedBuildInputs = with self; [];
1102 src = fetchurl {
1103 url = "https://pypi.python.org/packages/70/c7/469e68148d17a0d3db5ed49150242fd70a74a8147b8f3f8b87776e028d99/nose-1.3.6.tar.gz";
1104 md5 = "0ca546d81ca8309080fc80cb389e7a16";
1105 };
1106 meta = {
1107 license = [ { fullName = "GNU Library or Lesser General Public License (LGPL)"; } { fullName = "GNU LGPL"; } ];
1108 };
1109 };
1110 objgraph = super.buildPythonPackage {
1097 objgraph = super.buildPythonPackage {
1111 name = "objgraph-3.1.1";
1098 name = "objgraph-3.1.1";
1112 buildInputs = with self; [];
1099 buildInputs = with self; [];
@@ -1173,13 +1160,13
1173 };
1160 };
1174 };
1161 };
1175 pexpect = super.buildPythonPackage {
1162 pexpect = super.buildPythonPackage {
1176 name = "pexpect-4.2.1";
1163 name = "pexpect-4.3.0";
1177 buildInputs = with self; [];
1164 buildInputs = with self; [];
1178 doCheck = false;
1165 doCheck = false;
1179 propagatedBuildInputs = with self; [ptyprocess];
1166 propagatedBuildInputs = with self; [ptyprocess];
1180 src = fetchurl {
1167 src = fetchurl {
1181 url = "https://pypi.python.org/packages/e8/13/d0b0599099d6cd23663043a2a0bb7c61e58c6ba359b2656e6fb000ef5b98/pexpect-4.2.1.tar.gz";
1168 url = "https://pypi.python.org/packages/f8/44/5466c30e49762bb92e442bbdf4472d6904608d211258eb3198a11f0309a4/pexpect-4.3.0.tar.gz";
1182 md5 = "3694410001a99dff83f0b500a1ca1c95";
1169 md5 = "047a486dcd26134b74f2e67046bb61a0";
1183 };
1170 };
1184 meta = {
1171 meta = {
1185 license = [ pkgs.lib.licenses.isc { fullName = "ISC License (ISCL)"; } ];
1172 license = [ pkgs.lib.licenses.isc { fullName = "ISC License (ISCL)"; } ];
@@ -1550,16 +1537,16
1550 };
1537 };
1551 };
1538 };
1552 python-dateutil = super.buildPythonPackage {
1539 python-dateutil = super.buildPythonPackage {
1553 name = "python-dateutil-2.1";
1540 name = "python-dateutil-2.6.1";
1554 buildInputs = with self; [];
1541 buildInputs = with self; [];
1555 doCheck = false;
1542 doCheck = false;
1556 propagatedBuildInputs = with self; [six];
1543 propagatedBuildInputs = with self; [six];
1557 src = fetchurl {
1544 src = fetchurl {
1558 url = "https://pypi.python.org/packages/65/52/9c18dac21f174ad31b65e22d24297864a954e6fe65876eba3f5773d2da43/python-dateutil-2.1.tar.gz";
1545 url = "https://pypi.python.org/packages/54/bb/f1db86504f7a49e1d9b9301531181b00a1c7325dc85a29160ee3eaa73a54/python-dateutil-2.6.1.tar.gz";
1559 md5 = "1534bb15cf311f07afaa3aacba1c028b";
1546 md5 = "db38f6b4511cefd76014745bb0cc45a4";
1560 };
1547 };
1561 meta = {
1548 meta = {
1562 license = [ { fullName = "Simplified BSD"; } ];
1549 license = [ pkgs.lib.licenses.bsdOriginal { fullName = "Simplified BSD"; } ];
1563 };
1550 };
1564 };
1551 };
1565 python-editor = super.buildPythonPackage {
1552 python-editor = super.buildPythonPackage {
@@ -1615,13 +1602,13
1615 };
1602 };
1616 };
1603 };
1617 pytz = super.buildPythonPackage {
1604 pytz = super.buildPythonPackage {
1618 name = "pytz-2015.4";
1605 name = "pytz-2017.3";
1619 buildInputs = with self; [];
1606 buildInputs = with self; [];
1620 doCheck = false;
1607 doCheck = false;
1621 propagatedBuildInputs = with self; [];
1608 propagatedBuildInputs = with self; [];
1622 src = fetchurl {
1609 src = fetchurl {
1623 url = "https://pypi.python.org/packages/7e/1a/f43b5c92df7b156822030fed151327ea096bcf417e45acc23bd1df43472f/pytz-2015.4.zip";
1610 url = "https://pypi.python.org/packages/60/88/d3152c234da4b2a1f7a989f89609ea488225eaea015bc16fbde2b3fdfefa/pytz-2017.3.zip";
1624 md5 = "233f2a2b370d03f9b5911700cc9ebf3c";
1611 md5 = "7006b56c0d68a162d9fe57d4249c3171";
1625 };
1612 };
1626 meta = {
1613 meta = {
1627 license = [ pkgs.lib.licenses.mit ];
1614 license = [ pkgs.lib.licenses.mit ];
@@ -1696,7 +1683,7
1696 name = "rhodecode-enterprise-ce-4.11.0";
1683 name = "rhodecode-enterprise-ce-4.11.0";
1697 buildInputs = with self; [pytest py pytest-cov pytest-sugar pytest-runner pytest-catchlog pytest-profiling gprof2dot pytest-timeout mock WebTest cov-core coverage configobj];
1684 buildInputs = with self; [pytest py pytest-cov pytest-sugar pytest-runner pytest-catchlog pytest-profiling gprof2dot pytest-timeout mock WebTest cov-core coverage configobj];
1698 doCheck = true;
1685 doCheck = true;
1699 propagatedBuildInputs = with self; [Babel Beaker FormEncode Mako Markdown MarkupSafe MySQL-python Paste PasteDeploy PasteScript Pygments pygments-markdown-lexer Pylons Routes SQLAlchemy Tempita URLObject WebError WebHelpers WebHelpers2 WebOb WebTest Whoosh alembic amqplib anyjson appenlight-client authomatic cssselect celery channelstream colander decorator deform docutils gevent gunicorn infrae.cache ipython iso8601 kombu lxml msgpack-python nbconvert packaging psycopg2 py-gfm pycrypto pycurl pyparsing pyramid pyramid-debugtoolbar pyramid-mako pyramid-beaker pysqlite python-dateutil python-ldap python-memcached python-pam recaptcha-client redis repoze.lru requests simplejson sshpubkeys subprocess32 waitress zope.cachedescriptors dogpile.cache dogpile.core psutil py-bcrypt];
1686 propagatedBuildInputs = with self; [setuptools-scm amqplib amqp authomatic Babel Beaker celery Chameleon channelstream click colander configobj cssselect decorator deform docutils dogpile.cache dogpile.core ecdsa FormEncode future futures gnureadline infrae.cache iso8601 itsdangerous Jinja2 billiard kombu lxml Mako Markdown MarkupSafe msgpack-python MySQL-python objgraph packaging Paste PasteDeploy PasteScript pathlib2 peppercorn psutil psycopg2 py-bcrypt pycrypto pycurl pyflakes pygments-markdown-lexer Pygments pyparsing pyramid-beaker pyramid-debugtoolbar pyramid-jinja2 pyramid-mako pyramid pysqlite python-dateutil python-ldap python-memcached python-pam pytz pyzmq py-gfm recaptcha-client redis repoze.lru requests Routes setproctitle simplejson six SQLAlchemy sshpubkeys subprocess32 Tempita translationstring trollius urllib3 URLObject venusian WebError WebHelpers2 WebHelpers WebOb Whoosh wsgiref zope.cachedescriptors zope.deprecation zope.event zope.interface nbconvert bleach nbformat jupyter-client alembic invoke bumpversion transifex-client gevent greenlet gunicorn waitress uWSGI ipdb ipython CProfileV bottle rhodecode-tools appenlight-client pytest py pytest-cov pytest-sugar pytest-runner pytest-catchlog pytest-profiling gprof2dot pytest-timeout mock WebTest cov-core coverage];
1700 src = ./.;
1687 src = ./.;
1701 meta = {
1688 meta = {
1702 license = [ { fullName = "Affero GNU General Public License v3 or later (AGPLv3+)"; } { fullName = "AGPLv3, and Commercial License"; } ];
1689 license = [ { fullName = "Affero GNU General Public License v3 or later (AGPLv3+)"; } { fullName = "AGPLv3, and Commercial License"; } ];
@@ -1755,13 +1742,13
1755 };
1742 };
1756 };
1743 };
1757 setuptools-scm = super.buildPythonPackage {
1744 setuptools-scm = super.buildPythonPackage {
1758 name = "setuptools-scm-1.15.0";
1745 name = "setuptools-scm-1.15.6";
1759 buildInputs = with self; [];
1746 buildInputs = with self; [];
1760 doCheck = false;
1747 doCheck = false;
1761 propagatedBuildInputs = with self; [];
1748 propagatedBuildInputs = with self; [];
1762 src = fetchurl {
1749 src = fetchurl {
1763 url = "https://pypi.python.org/packages/80/b7/31b6ae5fcb188e37f7e31abe75f9be90490a5456a72860fa6e643f8a3cbc/setuptools_scm-1.15.0.tar.gz";
1750 url = "https://pypi.python.org/packages/03/6d/aafdd01edd227ee879b691455bf19895091872af7e48192bea1758c82032/setuptools_scm-1.15.6.tar.gz";
1764 md5 = "b6916c78ed6253d6602444fad4279c5b";
1751 md5 = "f17493d53f0d842bb0152f214775640b";
1765 };
1752 };
1766 meta = {
1753 meta = {
1767 license = [ pkgs.lib.licenses.mit ];
1754 license = [ pkgs.lib.licenses.mit ];
@@ -1949,6 +1936,19
1949 license = [ { fullName = "BSD-derived (http://www.repoze.org/LICENSE.txt)"; } ];
1936 license = [ { fullName = "BSD-derived (http://www.repoze.org/LICENSE.txt)"; } ];
1950 };
1937 };
1951 };
1938 };
1939 vine = super.buildPythonPackage {
1940 name = "vine-1.1.4";
1941 buildInputs = with self; [];
1942 doCheck = false;
1943 propagatedBuildInputs = with self; [];
1944 src = fetchurl {
1945 url = "https://pypi.python.org/packages/32/23/36284986e011f3c130d802c3c66abd8f1aef371eae110ddf80c5ae22e1ff/vine-1.1.4.tar.gz";
1946 md5 = "9fdb971e7fd15b181b84f3bfcf20d11c";
1947 };
1948 meta = {
1949 license = [ pkgs.lib.licenses.bsdOriginal ];
1950 };
1951 };
1952 waitress = super.buildPythonPackage {
1952 waitress = super.buildPythonPackage {
1953 name = "waitress-1.1.0";
1953 name = "waitress-1.1.0";
1954 buildInputs = with self; [];
1954 buildInputs = with self; [];
@@ -1,13 +1,13
1 ## core
1 ## core
2 setuptools==30.1.0
2 setuptools==30.1.0
3 setuptools-scm==1.15.0
3 setuptools-scm==1.15.6
4
4
5 amqplib==1.0.2
5 amqplib==1.0.2
6 anyjson==0.3.3
6 amqp==2.2.2
7 authomatic==0.1.0.post1
7 authomatic==0.1.0.post1
8 Babel==1.3
8 Babel==1.3
9 Beaker==1.9.0
9 Beaker==1.9.0
10 celery==2.2.10
10 celery==4.1.0
11 Chameleon==2.24
11 Chameleon==2.24
12 channelstream==0.5.2
12 channelstream==0.5.2
13 click==6.6
13 click==6.6
@@ -28,7 +28,8
28 iso8601==0.1.12
28 iso8601==0.1.12
29 itsdangerous==0.24
29 itsdangerous==0.24
30 Jinja2==2.9.6
30 Jinja2==2.9.6
31 kombu==1.5.1
31 billiard==3.5.0.3
32 kombu==4.1.0
32 lxml==3.7.3
33 lxml==3.7.3
33 Mako==1.0.7
34 Mako==1.0.7
34 Markdown==2.6.9
35 Markdown==2.6.9
@@ -57,18 +58,18
57 pyramid-mako==1.0.2
58 pyramid-mako==1.0.2
58 pyramid==1.9.1
59 pyramid==1.9.1
59 pysqlite==2.8.3
60 pysqlite==2.8.3
60 python-dateutil==2.1
61 python-dateutil
61 python-ldap==2.4.45
62 python-ldap==2.4.45
62 python-memcached==1.58
63 python-memcached==1.58
63 python-pam==1.8.2
64 python-pam==1.8.2
64 pytz==2015.4
65 pytz==2017.3
65 pyzmq==14.6.0
66 pyzmq==14.6.0
66 py-gfm==0.1.3
67 py-gfm==0.1.3
67 recaptcha-client==1.0.6
68 recaptcha-client==1.0.6
68 redis==2.10.6
69 redis==2.10.6
69 repoze.lru==0.7
70 repoze.lru==0.7
70 requests==2.9.1
71 requests==2.9.1
71 Routes==1.13
72 Routes==2.4.1
72 setproctitle==1.1.10
73 setproctitle==1.1.10
73 simplejson==3.11.1
74 simplejson==3.11.1
74 six==1.11.0
75 six==1.11.0
@@ -92,10 +93,6
92 zope.event==4.0.3
93 zope.event==4.0.3
93 zope.interface==4.1.3
94 zope.interface==4.1.3
94
95
95 ## customized/patched libs
96 # our patched version of Pylons==1.0.2
97 https://code.rhodecode.com/upstream/pylons/archive/707354ee4261b9c10450404fc9852ccea4fd667d.tar.gz?md5=f26633726fa2cd3a340316ee6a5d218f#egg=Pylons==1.0.2.rhodecode-patch-1
98
99
96
100 # IPYTHON RENDERING
97 # IPYTHON RENDERING
101 # entrypoints backport, pypi version doesn't support egg installs
98 # entrypoints backport, pypi version doesn't support egg installs
@@ -27,7 +27,7
27
27
28
28
29 @pytest.fixture(scope="class")
29 @pytest.fixture(scope="class")
30 def testuser_api(request, pylonsapp):
30 def testuser_api(request, baseapp):
31 cls = request.cls
31 cls = request.cls
32
32
33 # ADMIN USER
33 # ADMIN USER
@@ -159,32 +159,14
159
159
160 return c
160 return c
161
161
162 def _register_global_c(self, tmpl_args):
162 def _get_template_context(self, tmpl_args, **kwargs):
163 """
164 Registers attributes to pylons global `c`
165 """
166
167 # TODO(marcink): remove once pyramid migration is finished
168 from pylons import tmpl_context as c
169 try:
170 for k, v in tmpl_args.items():
171 setattr(c, k, v)
172 except TypeError:
173 log.exception('Failed to register pylons C')
174 pass
175
176 def _get_template_context(self, tmpl_args):
177 self._register_global_c(tmpl_args)
178
163
179 local_tmpl_args = {
164 local_tmpl_args = {
180 'defaults': {},
165 'defaults': {},
181 'errors': {},
166 'errors': {},
182 # register a fake 'c' to be used in templates instead of global
167 'c': tmpl_args
183 # pylons c, after migration to pyramid we should rename it to 'c'
184 # make sure we replace usage of _c in templates too
185 '_c': tmpl_args
186 }
168 }
187 local_tmpl_args.update(tmpl_args)
169 local_tmpl_args.update(kwargs)
188 return local_tmpl_args
170 return local_tmpl_args
189
171
190 def load_default_context(self):
172 def load_default_context(self):
@@ -194,7 +176,7
194 def load_default_context(self):
176 def load_default_context(self):
195 c = self._get_local_tmpl_context()
177 c = self._get_local_tmpl_context()
196 c.custom_var = 'foobar'
178 c.custom_var = 'foobar'
197 self._register_global_c(c)
179
198 return c
180 return c
199 """
181 """
200 raise NotImplementedError('Needs implementation in view class')
182 raise NotImplementedError('Needs implementation in view class')
@@ -213,7 +195,7
213 'Requirements are missing for repository %s: %s',
195 'Requirements are missing for repository %s: %s',
214 self.db_repo_name, error.message)
196 self.db_repo_name, error.message)
215
197
216 def _get_local_tmpl_context(self, include_app_defaults=False):
198 def _get_local_tmpl_context(self, include_app_defaults=True):
217 _ = self.request.translate
199 _ = self.request.translate
218 c = super(RepoAppView, self)._get_local_tmpl_context(
200 c = super(RepoAppView, self)._get_local_tmpl_context(
219 include_app_defaults=include_app_defaults)
201 include_app_defaults=include_app_defaults)
@@ -336,7 +318,7
336 def load_default_context(self):
318 def load_default_context(self):
337 c = self._get_local_tmpl_context()
319 c = self._get_local_tmpl_context()
338
320
339 self._register_global_c(c)
321
340 return c
322 return c
341
323
342 def load_refs_context(self, ref_items, partials_template):
324 def load_refs_context(self, ref_items, partials_template):
@@ -25,7 +25,6
25 from zope.interface import implementer
25 from zope.interface import implementer
26
26
27 from rhodecode.apps.admin.interfaces import IAdminNavigationRegistry
27 from rhodecode.apps.admin.interfaces import IAdminNavigationRegistry
28 from rhodecode.lib.utils import get_registry
29 from rhodecode.lib.utils2 import str2bool
28 from rhodecode.lib.utils2 import str2bool
30 from rhodecode.translation import _
29 from rhodecode.translation import _
31
30
@@ -116,7 +115,7
116 """
115 """
117 Helper that returns the admin navigation registry.
116 Helper that returns the admin navigation registry.
118 """
117 """
119 pyramid_registry = registry or get_registry(request)
118 pyramid_registry = registry or request.registry
120 nav_registry = pyramid_registry.queryUtility(IAdminNavigationRegistry)
119 nav_registry = pyramid_registry.queryUtility(IAdminNavigationRegistry)
121 return nav_registry
120 return nav_registry
122
121
@@ -46,10 +46,11
46 return base_url
46 return base_url
47
47
48
48
49 class TestAdminController(TestController):
49 @pytest.mark.usefixtures('app')
50 class TestAdminController(object):
50
51
51 @pytest.fixture(scope='class', autouse=True)
52 @pytest.fixture(scope='class', autouse=True)
52 def prepare(self, request, pylonsapp):
53 def prepare(self, request, baseapp):
53 UserLog.query().delete()
54 UserLog.query().delete()
54 Session().commit()
55 Session().commit()
55
56
@@ -84,104 +85,87
84 UserLog.query().delete()
85 UserLog.query().delete()
85 Session().commit()
86 Session().commit()
86
87
87 def test_index(self):
88 def test_index(self, autologin_user):
88 self.log_user()
89 response = self.app.get(route_path('admin_audit_logs'))
89 response = self.app.get(route_path('admin_audit_logs'))
90 response.mustcontain('Admin audit logs')
90 response.mustcontain('Admin audit logs')
91
91
92 def test_filter_all_entries(self):
92 def test_filter_all_entries(self, autologin_user):
93 self.log_user()
94 response = self.app.get(route_path('admin_audit_logs'))
93 response = self.app.get(route_path('admin_audit_logs'))
95 all_count = UserLog.query().count()
94 all_count = UserLog.query().count()
96 response.mustcontain('%s entries' % all_count)
95 response.mustcontain('%s entries' % all_count)
97
96
98 def test_filter_journal_filter_exact_match_on_repository(self):
97 def test_filter_journal_filter_exact_match_on_repository(self, autologin_user):
99 self.log_user()
100 response = self.app.get(route_path('admin_audit_logs',
98 response = self.app.get(route_path('admin_audit_logs',
101 params=dict(filter='repository:rhodecode')))
99 params=dict(filter='repository:rhodecode')))
102 response.mustcontain('3 entries')
100 response.mustcontain('3 entries')
103
101
104 def test_filter_journal_filter_exact_match_on_repository_CamelCase(self):
102 def test_filter_journal_filter_exact_match_on_repository_CamelCase(self, autologin_user):
105 self.log_user()
106 response = self.app.get(route_path('admin_audit_logs',
103 response = self.app.get(route_path('admin_audit_logs',
107 params=dict(filter='repository:RhodeCode')))
104 params=dict(filter='repository:RhodeCode')))
108 response.mustcontain('3 entries')
105 response.mustcontain('3 entries')
109
106
110 def test_filter_journal_filter_wildcard_on_repository(self):
107 def test_filter_journal_filter_wildcard_on_repository(self, autologin_user):
111 self.log_user()
112 response = self.app.get(route_path('admin_audit_logs',
108 response = self.app.get(route_path('admin_audit_logs',
113 params=dict(filter='repository:*test*')))
109 params=dict(filter='repository:*test*')))
114 response.mustcontain('862 entries')
110 response.mustcontain('862 entries')
115
111
116 def test_filter_journal_filter_prefix_on_repository(self):
112 def test_filter_journal_filter_prefix_on_repository(self, autologin_user):
117 self.log_user()
118 response = self.app.get(route_path('admin_audit_logs',
113 response = self.app.get(route_path('admin_audit_logs',
119 params=dict(filter='repository:test*')))
114 params=dict(filter='repository:test*')))
120 response.mustcontain('257 entries')
115 response.mustcontain('257 entries')
121
116
122 def test_filter_journal_filter_prefix_on_repository_CamelCase(self):
117 def test_filter_journal_filter_prefix_on_repository_CamelCase(self, autologin_user):
123 self.log_user()
124 response = self.app.get(route_path('admin_audit_logs',
118 response = self.app.get(route_path('admin_audit_logs',
125 params=dict(filter='repository:Test*')))
119 params=dict(filter='repository:Test*')))
126 response.mustcontain('257 entries')
120 response.mustcontain('257 entries')
127
121
128 def test_filter_journal_filter_prefix_on_repository_and_user(self):
122 def test_filter_journal_filter_prefix_on_repository_and_user(self, autologin_user):
129 self.log_user()
130 response = self.app.get(route_path('admin_audit_logs',
123 response = self.app.get(route_path('admin_audit_logs',
131 params=dict(filter='repository:test* AND username:demo')))
124 params=dict(filter='repository:test* AND username:demo')))
132 response.mustcontain('130 entries')
125 response.mustcontain('130 entries')
133
126
134 def test_filter_journal_filter_prefix_on_repository_or_target_repo(self):
127 def test_filter_journal_filter_prefix_on_repository_or_target_repo(self, autologin_user):
135 self.log_user()
136 response = self.app.get(route_path('admin_audit_logs',
128 response = self.app.get(route_path('admin_audit_logs',
137 params=dict(filter='repository:test* OR repository:rhodecode')))
129 params=dict(filter='repository:test* OR repository:rhodecode')))
138 response.mustcontain('260 entries') # 257 + 3
130 response.mustcontain('260 entries') # 257 + 3
139
131
140 def test_filter_journal_filter_exact_match_on_username(self):
132 def test_filter_journal_filter_exact_match_on_username(self, autologin_user):
141 self.log_user()
142 response = self.app.get(route_path('admin_audit_logs',
133 response = self.app.get(route_path('admin_audit_logs',
143 params=dict(filter='username:demo')))
134 params=dict(filter='username:demo')))
144 response.mustcontain('1087 entries')
135 response.mustcontain('1087 entries')
145
136
146 def test_filter_journal_filter_exact_match_on_username_camelCase(self):
137 def test_filter_journal_filter_exact_match_on_username_camelCase(self, autologin_user):
147 self.log_user()
148 response = self.app.get(route_path('admin_audit_logs',
138 response = self.app.get(route_path('admin_audit_logs',
149 params=dict(filter='username:DemO')))
139 params=dict(filter='username:DemO')))
150 response.mustcontain('1087 entries')
140 response.mustcontain('1087 entries')
151
141
152 def test_filter_journal_filter_wildcard_on_username(self):
142 def test_filter_journal_filter_wildcard_on_username(self, autologin_user):
153 self.log_user()
154 response = self.app.get(route_path('admin_audit_logs',
143 response = self.app.get(route_path('admin_audit_logs',
155 params=dict(filter='username:*test*')))
144 params=dict(filter='username:*test*')))
156 entries_count = UserLog.query().filter(UserLog.username.ilike('%test%')).count()
145 entries_count = UserLog.query().filter(UserLog.username.ilike('%test%')).count()
157 response.mustcontain('{} entries'.format(entries_count))
146 response.mustcontain('{} entries'.format(entries_count))
158
147
159 def test_filter_journal_filter_prefix_on_username(self):
148 def test_filter_journal_filter_prefix_on_username(self, autologin_user):
160 self.log_user()
161 response = self.app.get(route_path('admin_audit_logs',
149 response = self.app.get(route_path('admin_audit_logs',
162 params=dict(filter='username:demo*')))
150 params=dict(filter='username:demo*')))
163 response.mustcontain('1101 entries')
151 response.mustcontain('1101 entries')
164
152
165 def test_filter_journal_filter_prefix_on_user_or_other_user(self):
153 def test_filter_journal_filter_prefix_on_user_or_other_user(self, autologin_user):
166 self.log_user()
167 response = self.app.get(route_path('admin_audit_logs',
154 response = self.app.get(route_path('admin_audit_logs',
168 params=dict(filter='username:demo OR username:volcan')))
155 params=dict(filter='username:demo OR username:volcan')))
169 response.mustcontain('1095 entries') # 1087 + 8
156 response.mustcontain('1095 entries') # 1087 + 8
170
157
171 def test_filter_journal_filter_wildcard_on_action(self):
158 def test_filter_journal_filter_wildcard_on_action(self, autologin_user):
172 self.log_user()
173 response = self.app.get(route_path('admin_audit_logs',
159 response = self.app.get(route_path('admin_audit_logs',
174 params=dict(filter='action:*pull_request*')))
160 params=dict(filter='action:*pull_request*')))
175 response.mustcontain('187 entries')
161 response.mustcontain('187 entries')
176
162
177 def test_filter_journal_filter_on_date(self):
163 def test_filter_journal_filter_on_date(self, autologin_user):
178 self.log_user()
179 response = self.app.get(route_path('admin_audit_logs',
164 response = self.app.get(route_path('admin_audit_logs',
180 params=dict(filter='date:20121010')))
165 params=dict(filter='date:20121010')))
181 response.mustcontain('47 entries')
166 response.mustcontain('47 entries')
182
167
183 def test_filter_journal_filter_on_date_2(self):
168 def test_filter_journal_filter_on_date_2(self, autologin_user):
184 self.log_user()
185 response = self.app.get(route_path('admin_audit_logs',
169 response = self.app.get(route_path('admin_audit_logs',
186 params=dict(filter='date:20121020')))
170 params=dict(filter='date:20121020')))
187 response.mustcontain('17 entries')
171 response.mustcontain('17 entries')
@@ -429,7 +429,7
429 # TODO: johbo: What we really want is to checkpoint before a test run and
429 # TODO: johbo: What we really want is to checkpoint before a test run and
430 # reset the session afterwards.
430 # reset the session afterwards.
431 @pytest.fixture(scope='class', autouse=True)
431 @pytest.fixture(scope='class', autouse=True)
432 def cleanup_settings(self, request, pylonsapp):
432 def cleanup_settings(self, request, baseapp):
433 ui_id = RhodeCodeUi.ui_id
433 ui_id = RhodeCodeUi.ui_id
434 original_ids = list(
434 original_ids = list(
435 r.ui_id for r in RhodeCodeUi.query().values(ui_id))
435 r.ui_id for r in RhodeCodeUi.query().values(ui_id))
@@ -23,7 +23,6
23
23
24 from rhodecode.lib import auth
24 from rhodecode.lib import auth
25 from rhodecode.lib import helpers as h
25 from rhodecode.lib import helpers as h
26 from rhodecode.model import validators
27 from rhodecode.model.db import User, UserApiKeys, UserEmailMap, Repository
26 from rhodecode.model.db import User, UserApiKeys, UserEmailMap, Repository
28 from rhodecode.model.meta import Session
27 from rhodecode.model.meta import Session
29 from rhodecode.model.user import UserModel
28 from rhodecode.model.user import UserModel
@@ -386,8 +385,7
386 'csrf_token': self.csrf_token,
385 'csrf_token': self.csrf_token,
387 })
386 })
388
387
389 msg = validators.ValidUsername(
388 msg = '???'
390 False, {})._messages['system_invalid_username']
391 msg = h.html_escape(msg % {'username': 'new_user'})
389 msg = h.html_escape(msg % {'username': 'new_user'})
392 response.mustcontain('<span class="error-message">%s</span>' % msg)
390 response.mustcontain('<span class="error-message">%s</span>' % msg)
393 response.mustcontain(
391 response.mustcontain(