From ca5f9b729ea10fd4e313c84312900ac24ed8644d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 31 Jul 2012 11:46:45 +0200 Subject: [PATCH] Simplify module information with python configuration --- MANIFEST.in | 1 + README | 1 - __tryton__.py | 28 ---------------------------- setup.py | 33 ++++++++++++++++++++++----------- tryton.cfg | 7 +++++++ 5 files changed, 30 insertions(+), 40 deletions(-) delete mode 100644 __tryton__.py create mode 100644 tryton.cfg diff --git a/MANIFEST.in b/MANIFEST.in index 44a0685b39..e4632a141f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,7 @@ include TODO include COPYRIGHT include CHANGELOG include LICENSE +include tryton.cfg include *.xml include *.odt include locale/*.po diff --git a/README b/README index 5414b39a28..4608ca6a64 100644 --- a/README +++ b/README @@ -2,7 +2,6 @@ trytond_stock_split =================== The stock_split module of the Tryton application platform. -See __tryton__.py Installing ---------- diff --git a/__tryton__.py b/__tryton__.py deleted file mode 100644 index cab5e4868e..0000000000 --- a/__tryton__.py +++ /dev/null @@ -1,28 +0,0 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. -{ - 'name': 'Stock Split', - 'name_de_DE': 'Lager Aufteilung Lagerbewegung', - 'name_es_ES': 'Partición stock', - 'name_fr_FR': 'Division des mouvements de stock', - 'version': '2.5.0', - 'author': 'B2CK', - 'email': 'info@b2ck.com', - 'website': 'http://www.tryton.org/', - 'description': 'Allow to split move.', - 'description_de_DE': '''Ermöglicht die Aufteilung einer Lagerbewegung.''', - 'description_es_ES': '''Permite partir un movimiento de stock.''', - 'description_fr_FR': '''Division des mouvements de stock.''', - 'depends': [ - 'ir', - 'stock', - ], - 'xml': [ - 'stock.xml', - ], - 'translation': [ - 'locale/de_DE.po', - 'locale/es_ES.po', - 'locale/fr_FR.po', - ], -} diff --git a/setup.py b/setup.py index 0ed9f526b9..2f6069fcf1 100644 --- a/setup.py +++ b/setup.py @@ -4,8 +4,19 @@ from setuptools import setup import re +import os +import ConfigParser -info = eval(open('__tryton__.py').read()) + +def read(fname): + return open(os.path.join(os.path.dirname(__file__), fname)).read() + +config = ConfigParser.ConfigParser() +config.readfp(open('tryton.cfg')) +info = dict(config.items('tryton')) +for key in ('depends', 'extras_depend', 'xml'): + if key in info: + info[key] = info[key].strip().splitlines() major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2) major_version = int(major_version) minor_version = int(minor_version) @@ -23,21 +34,21 @@ tests_require = ['proteus >= %s.%s, < %s.%s' % setup(name='trytond_stock_split', version=info.get('version', '0.0.1'), - description=info.get('description', ''), - author=info.get('author', ''), - author_email=info.get('email', ''), - url=info.get('website', ''), + description='Tryton module to split stock move', + long_description=read('README'), + author='Tryton', + url='http://www.tryton.org/', download_url="http://downloads.tryton.org/" + \ - info.get('version', '0.0.1').rsplit('.', 1)[0] + '/', + info.get('version', '0.0.1').rsplit('.', 1)[0] + '/', package_dir={'trytond.modules.stock_split': '.'}, packages=[ 'trytond.modules.stock_split', 'trytond.modules.stock_split.tests', - ], + ], package_data={ 'trytond.modules.stock_split': info.get('xml', []) \ - + info.get('translation', []), - }, + + ['tryton.cfg', 'locale/*.po'], + }, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Plugins', @@ -59,7 +70,7 @@ setup(name='trytond_stock_split', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Office/Business', - ], + ], license='GPL-3', install_requires=requires, zip_safe=False, @@ -70,4 +81,4 @@ setup(name='trytond_stock_split', test_suite='tests', test_loader='trytond.test_loader:Loader', tests_require=tests_require, -) + ) diff --git a/tryton.cfg b/tryton.cfg new file mode 100644 index 0000000000..c236ca9c66 --- /dev/null +++ b/tryton.cfg @@ -0,0 +1,7 @@ +[tryton] +version=2.5.0 +depends: + ir + stock +xml: + stock.xml