diff options
| author | Antony Lesuisse <al@openerp.com> | 2011-09-26 02:54:44 +0200 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2011-09-26 02:54:44 +0200 |
| commit | d1e40a55aff988007d33fccff401e9e31caaf768 (patch) | |
| tree | 2626d04b8577a3bfd419823ca817909eb21b6713 /setup.py | |
| parent | 371366702bffa4933b817bff3d3b5b262d7429f5 (diff) | |
[IMP] directory cleanups, moved historical cruft into history
bzr revid: al@openerp.com-20110926005444-a7vqjb05vep7xbvj
Diffstat (limited to 'setup.py')
| -rwxr-xr-x | setup.py | 71 |
1 files changed, 27 insertions, 44 deletions
@@ -20,15 +20,12 @@ # ############################################################################## -import os, sys -import os +import glob, os, re, setuptools, sys from os.path import join, isfile -import glob -from setuptools import setup, find_packages +execfile(join('openerp', 'release.py')) py2exe_keywords = {} -py2exe_data_files = [] if os.name == 'nt': import py2exe py2exe_keywords['console'] = [ @@ -52,37 +49,30 @@ if os.name == 'nt': "excludes" : ["Tkconstants","Tkinter","tcl"], } } - # TODO is it still necessary now that we don't use the library.zip file? - def data_files(): - '''For Windows, we consider all the addons as data files. - It seems also that package_data below isn't honored by py2exe.''' - files = [] - os.chdir('openerp') - for (dp, dn, names) in os.walk('addons'): - files.append((join('openerp',dp), map(lambda x: join('openerp', dp, x), names))) - os.chdir('..') - files.append(('openerp', [join('openerp', 'import_xml.rng'),])) - - # copy pytz/timzeone - # TODO check if we have to also copy dateutil's timezone data. - import pytz - # Make sure the layout of pytz hasn't changed - assert (pytz.__file__.endswith('__init__.pyc') or - pytz.__file__.endswith('__init__.py')), pytz.__file__ - pytz_dir = os.path.dirname(pytz.__file__) - saved_dir = os.getcwd() - os.chdir(pytz_dir) - for dp, dn, names in os.walk('zoneinfo'): - files.append((join('pytz',dp), map(lambda x: join(pytz_dir, dp, x), names))) - os.chdir(saved_dir) +# List all data files +def data(): + files = [] + for root, dirnames, filenames in os.walk('openerp'): + for filename in filenames: + if not re.match(r'.*(\.pyc|\.pyo|\~)$',filename): + files.append(os.path.join(root, filename)) + d = {} + for v in files: + k=os.path.dirname(v) + if k in d: + d[k].append(v) + else: + d[k]=[v] + r = d.items() + return r - return files - py2exe_data_files = data_files() +def gen_manifest(): + file_list="\n".join(data()) + open('MANIFEST','w').write(file_list) -execfile(join('openerp', 'release.py')) - -setup(name = name, +setuptools.setup( + name = name, version = version, description = description, long_description = long_desc, @@ -91,18 +81,10 @@ setup(name = name, author_email = author_email, classifiers = filter(None, classifiers.split("\n")), license = license, - data_files = [ - (join('man', 'man1'), ['man/openerp-server.1']), - (join('man', 'man5'), ['man/openerp_serverrc.5']), - ('doc', filter(isfile, glob.glob('doc/*'))), - ] + py2exe_data_files, scripts = ['openerp-server'], - packages = find_packages(), - include_package_data = True, - package_data = { - '': ['*.yml', '*.xml', '*.po', '*.pot', '*.csv'], - }, - dependency_links = ['http://download.gna.org/pychart/'], + data_files = data(), + packages = setuptools.find_packages(), + #include_package_data = True, install_requires = [ # We require the same version as caldav for lxml. 'lxml==2.1.5', @@ -114,6 +96,7 @@ setup(name = name, # It is probably safe to move to PyChart 1.39 (the latest one). # (Let setup.py choose the latest one, and we should check we can remove pychart from # our tree.) + # http://download.gna.org/pychart/ 'pychart', 'pydot', 'pytz', |
