Use setuptools

This commit is contained in:
Cédric Krier
2008-10-03 15:17:49 +02:00
parent fe51727282
commit 8184911249
2 changed files with 23 additions and 23 deletions
+3
View File
@@ -0,0 +1,3 @@
include *.xml
include *.odt
include *.csv
+20 -23
View File
@@ -2,27 +2,22 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from distutils.core import setup
from distutils.command import sdist
class mysdist(sdist.sdist):
def add_defaults(self):
sdist.sdist.add_defaults(self)
if self.distribution.has_pure_modules():
build_py = self.get_finalized_command('build_py')
data = []
for package in build_py.packages:
src_dir = build_py.get_package_dir(package)
data.extend(build_py.find_data_files(package, src_dir))
self.filelist.extend(data)
from setuptools import setup, find_packages
import re
info = eval(file('__tryton__.py').read())
requires = ['trytond'] + ['trytond-' + x for x in info.get('depends', [])]
requires = []
for dep in info.get('depends', []):
match = re.compile(
'(ir|res|workflow|webdav)((\s|$|<|>|<=|>=|==|!=).*?$)').match(dep)
if match:
dep = 'trytond' + match.group(2)
else:
dep = 'trytond_' + dep
requires.append(dep)
setup(name='trytond-' + info['name'].lower(),
setup(name='trytond_' + info['name'].lower(),
version=info.get('version', '0'),
description=info.get('description', ''),
author=info.get('author', ''),
@@ -33,8 +28,11 @@ setup(name='trytond-' + info['name'].lower(),
'trytond.modules.' + info['name'].lower(),
],
package_data={
'trytond.modules.' + info['name'].lower(): info.get('xml', []) + \
['general_journal.odt', 'general_ledger.odt', 'trial_balance.odt'],
'trytond.modules.' + info['name'].lower(): info.get('xml', []) \
+ info.get('translation', []) \
+ ['aged_balance.odt', 'general_journal.odt',
'general_ledger.odt', 'third_party_balance.odt',
'trial_balance.odt'],
},
classifiers=[
'Development Status :: 5 - Production/Stable',
@@ -44,14 +42,13 @@ setup(name='trytond-' + info['name'].lower(),
'Intended Audience :: Legal Industry',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Natural Language :: English',
'Natural Language :: French',
'Natural Language :: German',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Office/Business',
'Topic :: Office/Business :: Financial :: Accounting',
],
license='GPL-3',
#requires=requires,
cmdclass={
'sdist': mysdist,
},
install_requires=requires,
)