Change setup.py to use a better structure
This commit is contained in:
parent
365d947ac8
commit
74e98897ec
53
setup.py
53
setup.py
|
@ -1,13 +1,21 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- encoding: utf-8 -*-
|
# encoding: utf-8
|
||||||
#This file is part account_move_party_required module for Tryton.
|
#This file is part account_move_party_required module for Tryton.
|
||||||
#The COPYRIGHT file at the top level of this repository contains
|
#The COPYRIGHT file at the top level of this repository contains
|
||||||
#the full copyright notices and license terms.
|
#the full copyright notices and license terms.
|
||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
import re
|
import re
|
||||||
|
import os
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
|
|
||||||
|
MODULE = 'account_move_party_required'
|
||||||
|
PREFIX = 'trytonspain'
|
||||||
|
MODULE2PREFIX = {}
|
||||||
|
|
||||||
|
|
||||||
|
def read(fname):
|
||||||
|
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||||
|
|
||||||
config = ConfigParser.ConfigParser()
|
config = ConfigParser.ConfigParser()
|
||||||
config.readfp(open('tryton.cfg'))
|
config.readfp(open('tryton.cfg'))
|
||||||
info = dict(config.items('tryton'))
|
info = dict(config.items('tryton'))
|
||||||
|
@ -21,27 +29,31 @@ minor_version = int(minor_version)
|
||||||
requires = []
|
requires = []
|
||||||
for dep in info.get('depends', []):
|
for dep in info.get('depends', []):
|
||||||
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
|
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
|
||||||
requires.append('trytond_%s >= %s.%s, < %s.%s' %
|
prefix = MODULE2PREFIX.get(dep, 'trytond')
|
||||||
(dep, major_version, minor_version, major_version,
|
requires.append('%s_%s >= %s.%s, < %s.%s' %
|
||||||
minor_version + 1))
|
(prefix, dep, major_version, minor_version,
|
||||||
|
major_version, minor_version + 1))
|
||||||
requires.append('trytond >= %s.%s, < %s.%s' %
|
requires.append('trytond >= %s.%s, < %s.%s' %
|
||||||
(major_version, minor_version, major_version, minor_version + 1))
|
(major_version, minor_version, major_version, minor_version + 1))
|
||||||
|
|
||||||
setup(name='trytonspain_account_move_party_required',
|
tests_require = ['proteus >= %s.%s, < %s.%s' %
|
||||||
|
(major_version, minor_version, major_version, minor_version + 1)]
|
||||||
|
|
||||||
|
setup(name='%s_%s' % (PREFIX, MODULE),
|
||||||
version=info.get('version', '0.0.1'),
|
version=info.get('version', '0.0.1'),
|
||||||
description='Account Move Party Required',
|
description='Tryton module add party required in account move ',
|
||||||
author='NaN·tic',
|
author='NaN·tic',
|
||||||
author_email='info@NaN-tic.com',
|
author_email='info@NaN-tic.com',
|
||||||
url='http://www.nan-tic.com',
|
url='http://www.nan-tic.com/',
|
||||||
download_url="https://bitbucket.org/trytonspain/trytond-account_move_party_required",
|
download_url='https://bitbucket.org/trytonspain/trytond-%s' % MODULE,
|
||||||
package_dir={'trytond.modules.account_move_party_required': '.'},
|
package_dir={'trytond.modules.%s' % MODULE: '.'},
|
||||||
packages=[
|
packages=[
|
||||||
'trytond.modules.account_move_party_required',
|
'trytond.modules.%s' % MODULE,
|
||||||
'trytond.modules.account_move_party_required.tests',
|
'trytond.modules.%s.tests' % MODULE,
|
||||||
],
|
],
|
||||||
package_data={
|
package_data={
|
||||||
'trytond.modules.account_move_party_required': info.get('xml', []) \
|
'trytond.modules.%s' % MODULE: (info.get('xml', [])
|
||||||
+ ['tryton.cfg', 'locale/*.po'],
|
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']),
|
||||||
},
|
},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 5 - Production/Stable',
|
'Development Status :: 5 - Production/Stable',
|
||||||
|
@ -51,8 +63,14 @@ setup(name='trytonspain_account_move_party_required',
|
||||||
'Intended Audience :: Financial and Insurance Industry',
|
'Intended Audience :: Financial and Insurance Industry',
|
||||||
'Intended Audience :: Legal Industry',
|
'Intended Audience :: Legal Industry',
|
||||||
'License :: OSI Approved :: GNU General Public License (GPL)',
|
'License :: OSI Approved :: GNU General Public License (GPL)',
|
||||||
'Natural Language :: English',
|
'Natural Language :: Bulgarian',
|
||||||
'Natural Language :: Catalan',
|
'Natural Language :: Catalan',
|
||||||
|
'Natural Language :: Czech',
|
||||||
|
'Natural Language :: Dutch',
|
||||||
|
'Natural Language :: English',
|
||||||
|
'Natural Language :: French',
|
||||||
|
'Natural Language :: German',
|
||||||
|
'Natural Language :: Russian',
|
||||||
'Natural Language :: Spanish',
|
'Natural Language :: Spanish',
|
||||||
'Operating System :: OS Independent',
|
'Operating System :: OS Independent',
|
||||||
'Programming Language :: Python :: 2.6',
|
'Programming Language :: Python :: 2.6',
|
||||||
|
@ -64,8 +82,9 @@ setup(name='trytonspain_account_move_party_required',
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
entry_points="""
|
entry_points="""
|
||||||
[trytond.modules]
|
[trytond.modules]
|
||||||
account_move_party_required = trytond.modules.account_move_party_required
|
%s = trytond.modules.%s
|
||||||
""",
|
""" % (MODULE, MODULE),
|
||||||
test_suite='tests',
|
test_suite='tests',
|
||||||
test_loader='trytond.test_loader:Loader',
|
test_loader='trytond.test_loader:Loader',
|
||||||
|
tests_require=tests_require,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue