Browse Source

update from remote master

Damien ACCORSI 10 years ago
parent
commit
c43dd600b2
6 changed files with 137 additions and 94 deletions
  1. 5 0
      .coveragerc
  2. 25 6
      .travis.yml
  3. 8 3
      README.md
  4. 48 41
      bin/tg2env-patch
  5. 50 43
      install/requirements.txt
  6. 1 1
      tracim/test.ini

+ 5 - 0
.coveragerc View File

@@ -0,0 +1,5 @@
1
+[report]
2
+omit =
3
+tests/*
4
+*/python?.?/*
5
+*/site-packages/nose/*

+ 25 - 6
.travis.yml View File

@@ -1,13 +1,32 @@
1 1
 language: python
2 2
 python:
3 3
   - "3.2"
4
-  - "3.3"
5
-  - "3.4"
4
+#  - "3.3"
5
+#  - "3.4"
6
+
7
+addons:
8
+  postgresql: "9.3"
9
+
6 10
 # command to install dependencies
11
+# Note: there's an echo at the end of pip install. It allows to override the default return code which is not 0
12
+# because some packages need to be ugraded to python3 (invalid python syntax because of python2 source code)
13
+#
14
+# pip install -r is run 2 times in order to really install tgapp-resetpassword (to investigate)
15
+#
7 16
 install:
8
-  - "cd tracim && python setup.py develop && cd -"
9
-  - "pip install -r install/requirements.txt"
10
-  - "./bin/tg2env-patch tg2env/"
17
+  - "cd tracim && python setup.py develop; cd -"
18
+  - "pip install -r install/requirements.txt; echo"
19
+  - "./bin/tg2env-patch 1 /home/travis/virtualenv/python3.2.5/lib/python3.2/site-packages"
20
+  - "pip install -r install/requirements.txt; echo"
21
+  - "./bin/tg2env-patch 2 /home/travis/virtualenv/python3.2.5/lib/python3.2/site-packages"
22
+  - "pip install coveralls"
11 23
   
24
+before_script:
25
+  - "psql -c 'create database tracim_test;' -U postgres"
26
+  - "cp tracim/development.ini.base tracim/development.ini"
27
+
12 28
 # command to run tests
13
-script: nosetests --with-coverage --cover-package=tracim
29
+script: "cd tracim && nosetests -v --with-coverage --cover-package=tracim --cover-erase"
30
+
31
+after_success:
32
+- coveralls

+ 8 - 3
README.md View File

@@ -1,3 +1,6 @@
1
+[![Build Status](https://travis-ci.org/tracim/tracim.svg?branch=master)](https://travis-ci.org/tracim/tracim)
2
+[![Coverage Status](https://img.shields.io/coveralls/tracim/tracim.svg)](https://coveralls.io/r/tracim/tracim)
3
+
1 4
 # Tracim - Introduction #
2 5
 
3 6
 Tracim is a collaborative software designed to allow people to share and work on various data and document types.
@@ -142,14 +145,16 @@ conflict between system-wide python installation and Tracim required ones.
142 145
     source tg2env/bin/activate
143 146
     cd tracim && python setup.py develop && cd -
144 147
     pip install -r install/requirements.txt
145
-    ./bin/tg2env-patch tg2env/
148
+    ./bin/tg2env-patch 1 tg2env/lib/python3.2/site-packages
149
+    pip install -r install/requirements.txt
150
+    ./bin/tg2env-patch 2 tg2env/lib/python3.2/site-packages
146 151
     
147 152
 Notes:
148 153
 
154
+* Patchs are applied in a two-step process because some dependencies require to be patched before other packages installation
149 155
 * Debian: you may get errors with stevedore/pbr which is not supported by python 3.2
150 156
 (debian version of python 3). This is not a real problem
151
-* Ubuntu (at least 14.04): you should remove _distribute_ and _wsgiref _
152
-  from the requirements.txt file
157
+* Ubuntu (at least 14.04): please update the site-package path with your version of python
153 158
 
154 159
 ## Database Setup ##
155 160
 

+ 48 - 41
bin/tg2env-patch View File

@@ -7,7 +7,7 @@ import sys
7 7
 
8 8
 def usage():
9 9
     print('')
10
-    print('USAGE: '+__file__+' <virtualenv_folder_path>')
10
+    print('USAGE: '+__file__+' <step_1_or2> <site_packages_folder_path> ')
11 11
     print('')
12 12
     print('')
13 13
 
@@ -30,7 +30,7 @@ def on_result_and_exit(error_code):
30 30
 #######
31 31
 
32 32
 
33
-if len(sys.argv)<=1:
33
+if len(sys.argv)<=2:
34 34
     show_help_and_exit()
35 35
 
36 36
 ########################################
@@ -39,53 +39,60 @@ if len(sys.argv)<=1:
39 39
 #
40 40
 ########################################
41 41
 
42
-tg2env_path = sys.argv[1]
42
+patch_step = sys.argv[1]
43
+sitepackages_path = sys.argv[2]
43 44
 
44 45
 print('PATCHING PYTHON CODE')
45 46
 print('--------------------')
46
-print('tg2env path:    %s'%(tg2env_path))
47
+print('site packages path:    %s'%(sitepackages_path))
47 48
 print('')
48 49
 
49
-patchable_paths = [
50
-    tg2env_path+'/lib/python3*/site-packages/tgext/pluggable',
51
-    tg2env_path+'/lib/python3*/site-packages/resetpassword',
52
-    tg2env_path+'/lib/python3*/site-packages/babel'
53
-]
50
+if patch_step=='1':
51
+
52
+    patchable_paths = [
53
+        sitepackages_path+'/tgext/pluggable',
54
+        sitepackages_path+'/resetpassword',
55
+        sitepackages_path+'/babel'
56
+    ]
57
+
58
+    for patchable_path in patchable_paths:
59
+        print('2to3 conversion for %s...' % (patchable_path))
60
+        os.system('2to3 -w %s'%(patchable_path))
61
+        print('-> done')
62
+
63
+    babel_source_code_patch_content = """--- tg2env/lib/python3.2/site-packages/babel/messages/pofile.py 2014-11-07 15:35:14.039913184 +0100
64
+    +++ tg2env/lib/python3.2/site-packages/babel/messages/pofile.py 2014-10-30 17:37:36.295091573 +0100
65
+    @@ -384,8 +384,13 @@
66
+     
67
+         def _write(text):
68
+             if isinstance(text, text_type):
69
+    -            text = text.encode(catalog.charset, 'backslashreplace')
70
+    -        fileobj.write(text)
71
+    +            pass
72
+    +            # text = text.encode(catalog.charset, 'backslashreplace')
73
+    +        try:
74
+    +            fileobj.write(text.encode('UTF-8'))
75
+    +        except Exception as e:
76
+    +            fileobj.write(text)
77
+    +        
78
+     
79
+         def _write_comment(comment, prefix=''):
80
+             # xgettext always wraps comments even if --no-wrap is passed;
81
+    """
82
+
83
+    babel_patchable_file_path = sitepackages_path+'/babel/messages/pofile.py'
84
+    print('Patching code in file %s...'%(babel_patchable_file_path))
85
+    os.system('echo "%s"|patch -p1 %s'%(babel_source_code_patch_content, babel_patchable_file_path))
86
+    print('-> done')
54 87
 
55
-for patchable_path in patchable_paths:
56
-    print('2to3 conversion for %s...' % (patchable_path))
57
-    os.system('2to3 -w %s'%(patchable_path))
88
+elif patch_step=='2':
89
+    resetpassword_patchable_file_path = sitepackages_path+'/resetpassword/lib/__init__.py'
90
+    print('Patching code in file %s...'%(resetpassword_patchable_file_path))
91
+    os.system("sed -i 's/body\.encode/body/g' %s" % (resetpassword_patchable_file_path))
58 92
     print('-> done')
59 93
 
60
-babel_source_code_patch_content = """--- tg2env/lib/python3.2/site-packages/babel/messages/pofile.py 2014-11-07 15:35:14.039913184 +0100
61
-+++ tg2env/lib/python3.2/site-packages/babel/messages/pofile.py 2014-10-30 17:37:36.295091573 +0100
62
-@@ -384,8 +384,13 @@
63
- 
64
-     def _write(text):
65
-         if isinstance(text, text_type):
66
--            text = text.encode(catalog.charset, 'backslashreplace')
67
--        fileobj.write(text)
68
-+            pass
69
-+            # text = text.encode(catalog.charset, 'backslashreplace')
70
-+        try:
71
-+            fileobj.write(text.encode('UTF-8'))
72
-+        except Exception as e:
73
-+            fileobj.write(text)
74
-+        
75
- 
76
-     def _write_comment(comment, prefix=''):
77
-         # xgettext always wraps comments even if --no-wrap is passed;
78
-"""
79
-
80
-babel_patchable_file_path = tg2env_path+'/lib/python*/site-packages/babel/messages/pofile.py'
81
-print('Patching code in file %s...'%(babel_patchable_file_path))
82
-os.system('echo "%s"|patch -p1 %s'%(babel_source_code_patch_content, babel_patchable_file_path))
83
-print('-> done')
84
-
85
-resetpassword_patchable_file_path = tg2env_path+'/lib/python*/site-packages/resetpassword/lib/__init__.py'
86
-print('Patching code in file %s...'%(resetpassword_patchable_file_path))
87
-os.system("sed -i 's/body\.encode/body/g' %s" % (resetpassword_patchable_file_path))
88
-print('-> done')
94
+else:
95
+    show_help_and_exit()
89 96
 
90 97
 print('')
91 98
 print('')

+ 50 - 43
install/requirements.txt View File

@@ -1,43 +1,50 @@
1
-Beaker
2
-FormEncode
3
-Genshi
4
-Mako
5
-MarkupSafe
6
-PasteDeploy
7
-SQLAlchemy
8
-Tempita
9
-TurboGears2
10
-WebOb
11
-WebTest
12
-alembic
13
-backlash
14
-beautifulsoup4
15
-cliff
16
-cmd2
17
-crank
18
-decorator
19
-distribute
20
-gearbox
21
-prettytable
22
-psycopg2
23
-pyparsing
24
-repoze.lru
25
-repoze.who
26
-six
27
-speaklater
28
-sprox
29
-stevedore
30
-tg.devtools
31
-tgext.admin
32
-tgext.crud
33
-transaction
34
-tw2.core
35
-tw2.forms
36
-wsgiref
37
-zope.interface
38
-zope.sqlalchemy
39
-cherrypy
40
-tgext.pluggable
41
-tgapp-resetpassword
42
-tgext.asyncjob
43
-babel
1
+Babel==1.3
2
+Beaker==1.6.4
3
+CherryPy==3.6.0
4
+FormEncode==1.3.0a1
5
+Genshi==0.7
6
+Mako==1.0.0
7
+MarkupSafe==0.15
8
+PasteDeploy==1.5.2
9
+SQLAlchemy==0.9.8
10
+Tempita==0.5.3dev
11
+TurboGears2==2.3.4
12
+WebOb==1.4
13
+WebTest==1.4.2
14
+alembic==0.6.7
15
+argparse==1.2.1
16
+backlash==0.0.6
17
+beautifulsoup4==4.3.2
18
+cliff==1.8.0
19
+cmd2==0.6.7
20
+coverage==4.0a1
21
+crank==0.7.1
22
+decorator==3.4.0
23
+gearbox==0.0.6
24
+itsdangerous==0.24
25
+nose==1.3.4
26
+pbr==0.10.0
27
+prettytable==0.7.2
28
+psycopg2==2.5.4
29
+pyparsing==2.0.3
30
+pytz==2014.7
31
+repoze.lru==0.6
32
+repoze.who==2.2
33
+six==1.8.0
34
+speaklater==1.3
35
+sprox==0.9.4
36
+stevedore==1.1.0
37
+tg.devtools==2.3.4
38
+tgext.admin==0.6.4
39
+tgext.asyncjob==0.3.1
40
+tgext.crud==0.7.3
41
+tgext.pluggable==0.5.2
42
+transaction==1.4.3
43
+tw2.core==2.2.2
44
+tw2.forms==2.2.2.1
45
+waitress==0.8.9
46
+wsgiref==0.1.2
47
+zope.interface==4.1.1
48
+zope.sqlalchemy==0.7.5
49
+tgapp-resetpassword==0.1.3
50
+

+ 1 - 1
tracim/test.ini View File

@@ -11,7 +11,7 @@ smtp_server = localhost
11 11
 error_email_from = turbogears@localhost
12 12
 
13 13
 [server:main]
14
-use = egg:gearbox#wsgiref
14
+use = egg:gearbox#cherrypy
15 15
 host = 127.0.0.1
16 16
 port = 8080
17 17