From 124f7e5fbbd7f94fa40b89f67110cb30cd113dba Mon Sep 17 00:00:00 2001 From: ?ngel ?lvarez Date: Fri, 4 May 2018 10:08:04 +0200 Subject: [PATCH] update to 4.7 --- .drone.yml | 64 +++++++++++++++++++++++---- locale/{ca_ES.po => ca.po} | 0 locale/{es_ES.po => es.po} | 0 setup.py | 59 +++++++++++++++--------- tests/scenario_commission_manager.rst | 15 ++----- tox.ini | 9 ++-- tryton.cfg | 2 +- view/manager_form.xml | 2 +- view/manager_list.xml | 2 +- 9 files changed, 103 insertions(+), 50 deletions(-) rename locale/{ca_ES.po => ca.po} (100%) rename locale/{es_ES.po => es.po} (100%) diff --git a/.drone.yml b/.drone.yml index d73450d..897fc2e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,9 +1,57 @@ -image: python:all -env: - - POSTGRESQL_URI=postgresql://postgres@127.0.0.1:5432/ - - MYSQL_URI=mysql://root@127.0.0.1:3306/ -script: - - pip install tox sqlitebck - - tox -e "{py27,py33,py34,py35}-{sqlite,postgresql}" --skip-missing-interpreters +clone: + hg: + image: plugins/hg + +pipeline: + tox: + image: ${IMAGE} + environment: + - CFLAGS=-O0 + - DB_CACHE=/cache + - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE + - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ + commands: + - pip install tox + - tox -e "${TOXENV}-${DATABASE}" + notify: + image: drillster/drone-email + from: drone@localhost + host: smtp + port: 25 + skip_verify: true + when: + status: [ changed, failure ] + services: - - postgres + postgresql: + image: postgres + when: + matrix: + DATABASE: postgresql + +matrix: + include: + - IMAGE: python:2.7 + TOXENV: py27 + DATABASE: sqlite + - IMAGE: python:2.7 + TOXENV: py27 + DATABASE: postgresql + - IMAGE: python:3.4 + TOXENV: py34 + DATABASE: sqlite + - IMAGE: python:3.4 + TOXENV: py34 + DATABASE: postgresql + - IMAGE: python:3.5 + TOXENV: py35 + DATABASE: sqlite + - IMAGE: python:3.5 + TOXENV: py35 + DATABASE: postgresql + - IMAGE: python:3.6 + TOXENV: py36 + DATABASE: sqlite + - IMAGE: python:3.6 + TOXENV: py36 + DATABASE: postgresql diff --git a/locale/ca_ES.po b/locale/ca.po similarity index 100% rename from locale/ca_ES.po rename to locale/ca.po diff --git a/locale/es_ES.po b/locale/es.po similarity index 100% rename from locale/es_ES.po rename to locale/es.po diff --git a/setup.py b/setup.py index ba55cc1..9754ba7 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,5 @@ #!/usr/bin/env python -# This file is part commission_manager module for Tryton. -# The COPYRIGHT file at the top level of this repository contains -# the full copyright notices and license terms. +# encoding: utf-8 from setuptools import setup import re @@ -12,6 +10,8 @@ try: except ImportError: from ConfigParser import ConfigParser +MODULE = 'commission_manager' +PREFIX = 'nantic' MODULE2PREFIX = {} @@ -36,12 +36,11 @@ info = dict(config.items('tryton')) for key in ('depends', 'extras_depend', 'xml'): if key in info: info[key] = info[key].strip().splitlines() + version = info.get('version', '0.0.1') major_version, minor_version, _ = version.split('.', 2) major_version = int(major_version) minor_version = int(minor_version) -name = 'nantic_commission_manager' -download_url = 'https://bitbucket.org/nantic/trytond-commission_manager' requires = [] for dep in info.get('depends', []): @@ -50,30 +49,38 @@ for dep in info.get('depends', []): requires.append(get_require_version('%s_%s' % (prefix, dep))) requires.append(get_require_version('trytond')) -tests_require = [get_require_version('proteus')] +tests_require = [ + get_require_version('proteus'), +] + +series = '%s.%s' % (major_version, minor_version) +if minor_version % 2: + branch = 'default' +else: + branch = series + dependency_links = [] + if minor_version % 2: # Add development index for testing with proteus dependency_links.append('https://trydevpi.tryton.org/') -setup(name=name, +setup(name='%s_%s' % (PREFIX, MODULE), version=version, - description='Tryton Tryton Commission Manager Module', + description='', long_description=read('README'), - author='NaN-TIC', + author='NaN·tic', author_email='info@nan-tic.com', - url='https://bitbucket.org/nantic/', - download_url=download_url, - keywords='', - package_dir={'trytond.modules.commission_manager': '.'}, + url='http://www.nan-tic.com/', + download_url="https://bitbucket.org/nantic/trytond-%s" % MODULE, + package_dir={'trytond.modules.%s' % MODULE: '.'}, packages=[ - 'trytond.modules.commission_manager', - 'trytond.modules.commission_manager.tests', + 'trytond.modules.%s' % MODULE, + 'trytond.modules.%s.tests' % MODULE, ], package_data={ - 'trytond.modules.commission_manager': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt', - 'icons/*.svg', 'tests/*.rst']), + 'trytond.modules.%s' % MODULE: (info.get('xml', []) + + ['tryton.cfg', 'locale/*.po', 'tests/*.rst']), }, classifiers=[ 'Development Status :: 5 - Production/Stable', @@ -83,14 +90,20 @@ setup(name=name, 'Intended Audience :: Financial and Insurance Industry', 'Intended Audience :: Legal Industry', 'License :: OSI Approved :: GNU General Public License (GPL)', + 'Natural Language :: Bulgarian', 'Natural Language :: Catalan', + 'Natural Language :: Czech', + 'Natural Language :: Dutch', 'Natural Language :: English', + 'Natural Language :: French', + 'Natural Language :: German', + 'Natural Language :: Russian', 'Natural Language :: Spanish', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Office/Business', @@ -101,11 +114,13 @@ setup(name=name, zip_safe=False, entry_points=""" [trytond.modules] - commission_manager = trytond.modules.commission_manager - """, + %s = trytond.modules.%s + """ % (MODULE, MODULE), test_suite='tests', test_loader='trytond.test_loader:Loader', tests_require=tests_require, use_2to3=True, - convert_2to3_doctests=['tests/scenario_commission_manager.rst'], + convert_2to3_doctests=[ + 'tests/scenario_commision_manager.rst', + ], ) diff --git a/tests/scenario_commission_manager.rst b/tests/scenario_commission_manager.rst index 9cd3b6d..9736595 100644 --- a/tests/scenario_commission_manager.rst +++ b/tests/scenario_commission_manager.rst @@ -10,23 +10,16 @@ Imports:: >>> from proteus import config, Model, Wizard >>> from trytond.modules.company.tests.tools import create_company, \ ... get_company + >>> from trytond.tests.tools import activate_modules >>> from trytond.modules.account.tests.tools import create_fiscalyear, \ - ... create_chart, get_accounts, create_tax, set_tax_code + ... create_chart, get_accounts, create_tax >>> from trytond.modules.account_invoice.tests.tools import \ ... set_fiscalyear_invoice_sequences, create_payment_term >>> today = datetime.date.today() -Create database:: +Install product_cost_plan Module:: - >>> config = config.set_trytond() - >>> config.pool.test = True - -Install commission:: - - >>> Module = Model.get('ir.module') - >>> module, = Module.find([('name', '=', 'commission_manager')]) - >>> module.click('install') - >>> Wizard('ir.module.install_upgrade').execute('upgrade') + >>> config = activate_modules('commission_manager') Create company:: diff --git a/tox.ini b/tox.ini index 08e43cf..2082ab4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,18 +1,15 @@ [tox] -envlist = {py27,py33,py34,py35}-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql} +envlist = {py27,py34,py35,py36}-{sqlite,postgresql},pypy-{sqlite,postgresql} [testenv] commands = {envpython} setup.py test deps = - {py27,py33,py34,py35}-postgresql: psycopg2 >= 2.5 + {py27,py34,py35,py36}-postgresql: psycopg2 >= 2.5 pypy-postgresql: psycopg2cffi >= 2.5 - mysql: MySQL-python sqlite: sqlitebck setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - mysql: TRYTOND_DATABASE_URI={env:MYSQL_URI:mysql://} sqlite: DB_NAME={env:SQLITE_NAME::memory:} postgresql: DB_NAME={env:POSTGRESQL_NAME:test} - mysql: DB_NAME={env:MYSQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/ {opts} {packages} +install_command = pip install --pre --process-dependency-links {opts} {packages} diff --git a/tryton.cfg b/tryton.cfg index 617f88f..9066dc3 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,5 +1,5 @@ [tryton] -version=4.0.0 +version=4.7.0 depends: ir commission diff --git a/view/manager_form.xml b/view/manager_form.xml index 8e5da12..2082859 100644 --- a/view/manager_form.xml +++ b/view/manager_form.xml @@ -1,7 +1,7 @@ -
+