Skip to content

Commit e77725e

Browse files
[IMP] improve experience on for openerp developers on windows, notes in setup.py and fix some imports
bzr revid: [email protected]
1 parent d07f7e0 commit e77725e

File tree

4 files changed

+154
-26
lines changed

4 files changed

+154
-26
lines changed

README

+9-17
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,9 @@ Customer Relationship Management software. More info at:
66

77
http://www.openerp.com
88

9-
Installation on Debian Ubuntu
9+
Installation on Debian/Ubuntu
1010
-----------------------------
1111

12-
Download the deb file and type:
13-
14-
$ sudo dpkg -i <openerp-deb-filename>
15-
$ sudo apt-get install install -f
16-
17-
Installation on Debian Ubuntu from nightly build
18-
------------------------------------------------
19-
2012
Add the the apt repository
2113

2214
deb http://nightly.openerp.com/6.1/deb/ ./
@@ -26,6 +18,11 @@ in your source.list and type:
2618
$ sudo apt-get update
2719
$ sudo apt-get install openerp
2820

21+
Or download the deb file and type:
22+
23+
$ sudo dpkg -i <openerp-deb-filename>
24+
$ sudo apt-get install install -f
25+
2926
Installation on RedHat, Fedora, CentOS
3027
--------------------------------------
3128

@@ -42,6 +39,8 @@ Install the openerp rpm
4239
Installation on Windows
4340
-----------------------
4441

42+
Check the notes in setup.py
43+
4544
Installation on MacOSX
4645
-----------------------
4746

@@ -54,14 +53,7 @@ default master password is "admin".
5453
Detailed System Requirements
5554
----------------------------
5655

57-
You need the following software installed:
58-
59-
postgresql-client, python-dateutil, python-feedparser, python-gdata,
60-
python-ldap, python-libxslt1, python-lxml, python-mako, python-openid,
61-
python-psycopg2, python-pybabel, python-pychart, python-pydot,
62-
python-pyparsing, python-reportlab, python-simplejson, python-tz,
63-
python-vatnumber, python-vobject, python-webdav, python-werkzeug, python-xlwt,
64-
python-yaml, python-zsi
56+
The dependencies are listed in setup.py
6557

6658
For Luxembourg localization, you also need:
6759

openerp/service/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import openerp.osv
3535
import openerp.tools
3636
import openerp.service.wsgi_server
37-
import openerp.service.workers
3837

3938
#.apidoc title: RPC Services
4039

@@ -119,6 +118,7 @@ def stop_services():
119118
openerp.modules.registry.RegistryManager.delete_all()
120119

121120
def start_services_workers():
121+
import openerp.service.workers
122122
openerp.multi_process = True # Nah!
123123

124124
openerp.service.workers.Multicorn(openerp.service.wsgi_server.application).run()

openerp/service/workers.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,17 @@
33
# TODO rename class: Multicorn -> Arbiter ?
44
#-----------------------------------------------------------
55
import errno
6-
try:
7-
import fcntl
8-
except ImportError:
9-
fcntl = None
6+
import fcntl
7+
import logging
8+
import os
109
import psutil
1110
import random
1211
import resource
1312
import select
14-
import socket
15-
import time
16-
import logging
17-
import os
1813
import signal
14+
import socket
1915
import sys
16+
import time
2017

2118
import werkzeug.serving
2219

setup.py

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
##############################################################################
4+
#
5+
# OpenERP, Open Source Management Solution
6+
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
7+
#
8+
# This program is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU Affero General Public License as
10+
# published by the Free Software Foundation, either version 3 of the
11+
# License, or (at your option) any later version.
12+
#
13+
# This program is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU Affero General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU Affero General Public License
19+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
#
21+
##############################################################################
22+
23+
import glob, os, re, setuptools, sys
24+
from os.path import join, isfile
25+
26+
# List all data files
27+
def data():
28+
files = []
29+
for root, dirnames, filenames in os.walk('openerp'):
30+
for filename in filenames:
31+
if not re.match(r'.*(\.pyc|\.pyo|\~)$',filename):
32+
files.append(os.path.join(root, filename))
33+
d = {}
34+
for v in files:
35+
k=os.path.dirname(v)
36+
if k in d:
37+
d[k].append(v)
38+
else:
39+
d[k]=[v]
40+
r = d.items()
41+
if os.name == 'nt':
42+
r.append(("Microsoft.VC90.CRT", glob.glob('C:\Microsoft.VC90.CRT\*.*')))
43+
44+
import babel
45+
r.append(("localedata",
46+
glob.glob(os.path.join(os.path.dirname(babel.__file__), "localedata" , '*'))))
47+
48+
return r
49+
50+
def gen_manifest():
51+
file_list="\n".join(data())
52+
open('MANIFEST','w').write(file_list)
53+
54+
if os.name == 'nt':
55+
sys.path.append("C:\Microsoft.VC90.CRT")
56+
57+
def py2exe_options():
58+
if os.name == 'nt':
59+
import py2exe
60+
return {
61+
"console" : [ { "script": "openerp-server", "icon_resources": [(1, join("install","openerp-icon.ico"))], }],
62+
'options' : {
63+
"py2exe": {
64+
"skip_archive": 1,
65+
"optimize": 2,
66+
"dist_dir": 'dist',
67+
"packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "email", "encodings", "imaplib", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber", "vobject", "xml", "xml.dom", "yaml", ],
68+
"excludes" : ["Tkconstants","Tkinter","tcl"],
69+
}
70+
}
71+
}
72+
else:
73+
return {}
74+
75+
execfile(join(os.path.dirname(__file__), 'openerp', 'release.py'))
76+
77+
# Notes for OpenERP developer on windows:
78+
#
79+
# To setup a windows developer evironement install python2.7 then pip and use
80+
# "pip install <depencey>" for every dependency listed below.
81+
#
82+
# Dependecies that requires DLLs are not installable with pip install, for
83+
# them we added comments with links where you can find the installers.
84+
#
85+
# OpenERP on windows also require the pywin32, the binary can be found at
86+
# http://pywin32.sf.net
87+
#
88+
# Both python2.7 32bits and 64bits are known to work.
89+
90+
setuptools.setup(
91+
name = 'openerp',
92+
version = version,
93+
description = description,
94+
long_description = long_desc,
95+
url = url,
96+
author = author,
97+
author_email = author_email,
98+
classifiers = filter(None, classifiers.split("\n")),
99+
license = license,
100+
scripts = ['openerp-server'],
101+
data_files = data(),
102+
packages = setuptools.find_packages(),
103+
dependency_links = ['http://download.gna.org/pychart/'],
104+
#include_package_data = True,
105+
install_requires = [
106+
'pychart', # not on pypi, use: pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz
107+
'babel',
108+
'docutils',
109+
'feedparser',
110+
'gdata',
111+
'lxml < 3', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
112+
'mako',
113+
'PIL', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
114+
'psutil', # windows binary code.google.com/p/psutil/downloads/list
115+
'psycopg2',
116+
'pydot',
117+
'python-dateutil < 2',
118+
'python-ldap', # optional
119+
'python-openid',
120+
'pytz',
121+
'pywebdav',
122+
'pyyaml',
123+
'reportlab', # windows binary pypi.python.org/pypi/reportlab
124+
'simplejson',
125+
'vatnumber',
126+
'vobject',
127+
'werkzeug',
128+
'xlwt',
129+
'zsi', # optional
130+
],
131+
extras_require = {
132+
'SSL' : ['pyopenssl'],
133+
},
134+
tests_require = ['unittest2'],
135+
**py2exe_options()
136+
)
137+
138+
139+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

0 commit comments

Comments
 (0)