From abf8e30e85fd37c6c58bc88a6c66efeb38da8b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 8 Jun 2012 19:34:31 +0200 Subject: [PATCH] Simplify module information with python configuration review363001 --- MANIFEST.in | 1 + README | 1 - __tryton__.py | 71 --------------------------------------------------- setup.py | 34 +++++++++++++++--------- tryton.cfg | 9 +++++++ 5 files changed, 32 insertions(+), 84 deletions(-) delete mode 100644 __tryton__.py create mode 100644 tryton.cfg diff --git a/MANIFEST.in b/MANIFEST.in index 32879dffb2..97a95966de 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 6c471d737f..a9469f4be8 100644 --- a/README +++ b/README @@ -2,7 +2,6 @@ trytond_stock_product_location ============================== The stock_product_location module of the Tryton application platform. -See __tryton__.py Installing ---------- diff --git a/__tryton__.py b/__tryton__.py deleted file mode 100644 index 63cea93b94..0000000000 --- a/__tryton__.py +++ /dev/null @@ -1,71 +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 Product Location", - "name_bg_BG": "Местонахождение на наличност на продукт", - 'name_ca_ES': 'Ubicació d''estoc de producte', - "name_de_DE": "Lagerverwaltung Artikel Lagerort", - "name_es_AR": "Ubicación de existencias de producto", - "name_es_CO": "Ubicación de existencias de producto", - "name_es_ES": "Ubicación de stock de producto", - "name_fr_FR": "Emplacement de produit", - "version": "2.5.0", - "author": "B2CK", - 'email': 'info@b2ck.com', - 'website': 'http://www.tryton.org/', - "description": '''Define default storage location by warehouse on product. -Theses locations will be used by the supplier shipment for generating -inventory moves. -''', - "description_bg_BG": '''Задаване на местонахождение по подрабиране на - на продукт по склад. Тези местонахождения ще бъдат използвани при пратки - от доставчик за генериране на движения за инвентаризация. -''', - 'description_ca_ES': '''Defineix la ubicació interna predeterminada per -magatzem i producte. Aquestes ubicacions s'utilitzaran en l'enviament de proveïdor -per generar moviments d'inventari. -''', - "description_de_DE": '''Standardlagerorte für Artikel - - Ermöglicht die Definition von Standardlagerorten für Artikel in einem Warenlager - - Diese Lagerorte werden von Lieferposten von Lieferanten für die - Lagerbewegungen benutzt -''', - "description_es_AR": '''Define la ubicación del almacén predeterminado por -depósito y producto. -Estas ubicaciones se utilizarán en el envio de proveedor para generar movimientos -de inventario. -''', - "description_es_CO": '''Define la ubicación de almacenamiento predeterminada -por depósito y producto. -Esta ubicación la utilizará el envío del proveedor para generar movimientos -de inventaio. -''', - "description_es_ES": '''Define la ubicación interna predeterminada por almacén y producto. -Estas ubicaciones se utilizarán en el envío de proveedor para generar movimientos de inventario. -''', - "description_fr_FR": '''Defini un emplacement de rangement par défaut par produit. -Ces emplacements seront utilisés par les colisages fournisseurs pour -générer les mouvements internes. -''', - "depends": [ - "ir", - "product", - "stock", - ], - "xml": [ - "location.xml", - "product.xml", - ], - 'translation': [ - 'locale/cs_CZ.po', - 'locale/bg_BG.po', - 'locale/ca_ES.po', - 'locale/de_DE.po', - 'locale/es_AR.po', - 'locale/es_CO.po', - 'locale/es_ES.po', - 'locale/fr_FR.po', - 'locale/nl_NL.po', - 'locale/ru_RU.po', - ], -} diff --git a/setup.py b/setup.py index 4864a28d76..db87a9d1f2 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) @@ -21,22 +32,21 @@ requires.append('trytond >= %s.%s, < %s.%s' % setup(name='trytond_stock_product_location', 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 add default location on product', + 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_product_location': '.'}, packages=[ 'trytond.modules.stock_product_location', 'trytond.modules.stock_product_location.tests', - ], + ], package_data={ 'trytond.modules.stock_product_location': info.get('xml', []) \ - + info.get('translation', []) \ - + ['label.odt'], - }, + + ['tryton.cfg', 'locale/*.po', 'label.odt'], + }, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Plugins', @@ -57,7 +67,7 @@ setup(name='trytond_stock_product_location', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Office/Business', - ], + ], license='GPL-3', install_requires=requires, zip_safe=False, @@ -67,4 +77,4 @@ setup(name='trytond_stock_product_location', """, test_suite='tests', test_loader='trytond.test_loader:Loader', -) + ) diff --git a/tryton.cfg b/tryton.cfg new file mode 100644 index 0000000000..4e3d58b2b9 --- /dev/null +++ b/tryton.cfg @@ -0,0 +1,9 @@ +[tryton] +version=2.5.0 +depends: + ir + product + stock +xml: + location.xml + product.xml