Update to 4.7

This commit is contained in:
C?dric Krier 2017-12-27 18:09:34 +01:00
parent db2904bdb1
commit 9990afb024
11 changed files with 83 additions and 37 deletions

View File

@ -1,9 +1,51 @@
image: python:all clone:
env: hg:
- POSTGRESQL_URI=postgresql://postgres@127.0.0.1:5432/ image: plugins/hg
- MYSQL_URI=mysql://root@127.0.0.1:3306/
script: pipeline:
- pip install tox tox:
- tox -e "{py27,py33,py34,py35}-{sqlite,postgresql}" --skip-missing-interpreters 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}"
volumes:
- cache:/root/.cache
services: 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

View File

@ -3,11 +3,11 @@
# the full copyright notices and license terms. # the full copyright notices and license terms.
from trytond.pool import Pool from trytond.pool import Pool
from .base_external_mapping import * from . import base_external_mapping
def register(): def register():
Pool.register( Pool.register(
BaseExternalMapping, base_external_mapping.BaseExternalMapping,
BaseExternalMappingLine, base_external_mapping.BaseExternalMappingLine,
module='base_external_mapping', type_='model') module='base_external_mapping', type_='model')

View File

@ -116,8 +116,8 @@ class BaseExternalMapping(ModelSQL, ModelView):
res.append(new_mapping) res.append(new_mapping)
return res return res
@staticmethod @classmethod
def default_state(): def default_state(cls):
return 'draft' return 'draft'
@classmethod @classmethod

View File

@ -12,6 +12,8 @@ try:
except ImportError: except ImportError:
from ConfigParser import ConfigParser from ConfigParser import ConfigParser
MODULE = 'base_external_mapping'
PREFIX = 'trytonzz'
MODULE2PREFIX = {} MODULE2PREFIX = {}
@ -20,6 +22,7 @@ def read(fname):
os.path.join(os.path.dirname(__file__), fname), os.path.join(os.path.dirname(__file__), fname),
'r', encoding='utf-8').read() 'r', encoding='utf-8').read()
def get_require_version(name): def get_require_version(name):
if minor_version % 2: if minor_version % 2:
require = '%s >= %s.%s.dev0, < %s.%s' require = '%s >= %s.%s.dev0, < %s.%s'
@ -35,14 +38,13 @@ info = dict(config.items('tryton'))
for key in ('depends', 'extras_depend', 'xml'): for key in ('depends', 'extras_depend', 'xml'):
if key in info: if key in info:
info[key] = info[key].strip().splitlines() info[key] = info[key].strip().splitlines()
version = info.get('version', '0.0.1') version = info.get('version', '0.0.1')
major_version, minor_version, _ = version.split('.', 2) major_version, minor_version, _ = version.split('.', 2)
major_version = int(major_version) major_version = int(major_version)
minor_version = int(minor_version) minor_version = int(minor_version)
name = 'trytonzz_base_external_mapping'
download_url = 'https://bitbucket.org/zikzakmedia/trytond-base_external_mapping'
requires = [] requires = ['Genshi', 'simpleeval']
for dep in info.get('depends', []): for dep in info.get('depends', []):
if not re.match(r'(ir|res)(\W|$)', dep): if not re.match(r'(ir|res)(\W|$)', dep):
prefix = MODULE2PREFIX.get(dep, 'trytond') prefix = MODULE2PREFIX.get(dep, 'trytond')
@ -55,24 +57,23 @@ if minor_version % 2:
# Add development index for testing with proteus # Add development index for testing with proteus
dependency_links.append('https://trydevpi.tryton.org/') dependency_links.append('https://trydevpi.tryton.org/')
setup(name=name, setup(name='%s_%s' % (PREFIX, MODULE),
version=version, version=version,
description='Tryton Base External Mapping Module', description='Tryton Base External Mapping Module',
long_description=read('README'), long_description=read('README'),
author='Zikzakmedia SL', author='Zikzakmedia SL',
author_email='zikzak@zikzakmedia.com', author_email='zikzak@zikzakmedia.com',
url='https://bitbucket.org/zikzakmedia/', url='https://bitbucket.org/zikzakmedia/',
download_url=download_url, download_url='https://bitbucket.org/zikzakmedia/trytond-base_external_mapping',
keywords='', keywords='',
package_dir={'trytond.modules.base_external_mapping': '.'}, package_dir={'trytond.modules.%s' % MODULE: '.'},
packages=[ packages=[
'trytond.modules.base_external_mapping', 'trytond.modules.%s' % MODULE,
'trytond.modules.base_external_mapping.tests', 'trytond.modules.%s.tests' % MODULE,
], ],
package_data={ package_data={
'trytond.modules.base_external_mapping': (info.get('xml', []) 'trytond.modules.%s' % MODULE: (info.get('xml', [])
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt', + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']),
'icons/*.svg', 'tests/*.rst']),
}, },
classifiers=[ classifiers=[
'Development Status :: 5 - Production/Stable', 'Development Status :: 5 - Production/Stable',
@ -97,9 +98,9 @@ setup(name=name,
'Natural Language :: Spanish', 'Natural Language :: Spanish',
'Operating System :: OS Independent', 'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy', 'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Office/Business', 'Topic :: Office/Business',
@ -110,8 +111,8 @@ setup(name=name,
zip_safe=False, zip_safe=False,
entry_points=""" entry_points="""
[trytond.modules] [trytond.modules]
base_external_mapping = trytond.modules.base_external_mapping %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, tests_require=tests_require,

View File

@ -1,7 +1,9 @@
# This file is part base_external_mapping module for Tryton. # This file is part base_external_mapping 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.
try:
from .test_base_external_mapping import suite from trytond.modules.base_external_mapping.tests.test_suite import suite
except ImportError:
from .test_base_external_mapping import suite
__all__ = ['suite'] __all__ = ['suite']

View File

@ -1,12 +1,13 @@
[tox] [tox]
envlist = {py27,py33,py34,py35}-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql} envlist = {py27,py34,py35,py36}-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql}
[testenv] [testenv]
commands = {envpython} setup.py test commands = {envpython} setup.py test
deps = deps =
{py27,py33,py34,py35}-postgresql: psycopg2 >= 2.5 {py27,py34,py35,py36}-postgresql: psycopg2 >= 2.5
pypy-postgresql: psycopg2cffi >= 2.5 pypy-postgresql: psycopg2cffi >= 2.5
mysql: MySQL-python mysql: MySQL-python
sqlite: sqlitebck
setenv = setenv =
sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://}
postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://}
@ -14,4 +15,4 @@ setenv =
sqlite: DB_NAME={env:SQLITE_NAME::memory:} sqlite: DB_NAME={env:SQLITE_NAME::memory:}
postgresql: DB_NAME={env:POSTGRESQL_NAME:test} postgresql: DB_NAME={env:POSTGRESQL_NAME:test}
mysql: DB_NAME={env:MYSQL_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 --find-links https://trydevpi.tryton.org/ --process-dependency-links {opts} {packages}

View File

@ -1,5 +1,5 @@
[tryton] [tryton]
version=3.9.0 version=4.7.0
depends: depends:
ir ir
res res

View File

@ -2,7 +2,7 @@
<!-- This file is part of base_external_mapping module for Tryton. <!-- This file is part of base_external_mapping module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. --> copyright notices and license terms. -->
<form string="Mapping" col="6"> <form col="6">
<label name="name"/> <label name="name"/>
<field name="name"/> <field name="name"/>
<label name="model"/> <label name="model"/>

View File

@ -2,7 +2,7 @@
<!-- This file is part of base_external_mapping module for Tryton. <!-- This file is part of base_external_mapping module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. --> copyright notices and license terms. -->
<form string="Mapping Line"> <form>
<label name="field"/> <label name="field"/>
<field name="field"/> <field name="field"/>
<label name="mapping_type"/> <label name="mapping_type"/>

View File

@ -2,7 +2,7 @@
<!-- This file is part of base_external_mapping module for Tryton. <!-- This file is part of base_external_mapping module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. --> copyright notices and license terms. -->
<tree string="Mapping Line" sequence="sequence"> <tree sequence="sequence">
<field name="sequence"/> <field name="sequence"/>
<field name="mapping"/> <field name="mapping"/>
<field name="field"/> <field name="field"/>

View File

@ -2,7 +2,7 @@
<!-- This file is part of base_external_mapping module for Tryton. <!-- This file is part of base_external_mapping module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. --> copyright notices and license terms. -->
<tree string="Mapping"> <tree>
<field name="name"/> <field name="name"/>
<field name="model"/> <field name="model"/>
<field name="state"/> <field name="state"/>