fix tox.ini and setup.py

This commit is contained in:
?ngel ?lvarez 2019-09-13 14:18:15 +02:00
parent 97fc320c6c
commit 5bf559d5d5
3 changed files with 42 additions and 45 deletions

View File

@ -1,18 +1,17 @@
#!/usr/bin/env python
# This file is part sale_rule 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
import os
import io
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import ConfigParser
from configparser import ConfigParser
MODULE2PREFIX = {}
MODULE = 'sale_rule'
PREFIX = 'trytonzz'
MODULE2PREFIX = {
'sale_shop': 'trytonzz',
}
def read(fname):
@ -20,6 +19,7 @@ def read(fname):
os.path.join(os.path.dirname(__file__), fname),
'r', encoding='utf-8').read()
def get_require_version(name):
if minor_version % 2:
require = '%s >= %s.%s.dev0, < %s.%s'
@ -35,12 +35,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 = 'trytonzz_sale_rule'
download_url = 'https://bitbucket.org/zikzakmedia/trytond-sale_rule'
requires = []
for dep in info.get('depends', []):
@ -49,30 +48,40 @@ for dep in info.get('depends', []):
requires.append(get_require_version('%s_%s' % (prefix, dep)))
requires.append(get_require_version('trytond'))
tests_require = []
dependency_links = []
tests_require = [get_require_version('proteus')]
series = '%s.%s' % (major_version, minor_version)
if minor_version % 2:
branch = 'default'
else:
branch = series
dependency_links = [
('hg+https://hg@bitbucket.org/zikzakmedia/'
'trytond-sale_shop@%(branch)s'
'#egg=trytonzz-sale_shop-%(series)s' % {
'branch': branch,
'series': series,
}),
]
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 Sale Rule Module',
long_description=read('README'),
description='Tryton module to add wizard in template mails',
author='Zikzakmedia SL',
author_email='zikzak@zikzakmedia.com',
url='https://bitbucket.org/zikzakmedia/',
download_url=download_url,
keywords='',
package_dir={'trytond.modules.sale_rule': '.'},
url='http://www.zikzakmedia.com',
download_url="https://bitbucket.org/zikzakmedia/trytond-" + MODULE,
package_dir={'trytond.modules.%s' % MODULE: '.'},
packages=[
'trytond.modules.sale_rule',
'trytond.modules.sale_rule.tests',
'trytond.modules.%s' % MODULE,
'trytond.modules.%s.tests' % MODULE,
],
package_data={
'trytond.modules.sale_rule': (info.get('xml', [])
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt',
'icons/*.svg', 'tests/*.rst']),
'trytond.modules.%s' % MODULE: (info.get('xml', [])
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po']),
},
classifiers=[
'Development Status :: 5 - Production/Stable',
@ -81,25 +90,15 @@ setup(name=name,
'Intended Audience :: Developers',
'Intended Audience :: Financial and Insurance Industry',
'Intended Audience :: Legal Industry',
'Intended Audience :: Manufacturing',
'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 :: Hungarian',
'Natural Language :: Italian',
'Natural Language :: Portuguese (Brazilian)',
'Natural Language :: Russian',
'Natural Language :: Slovenian',
'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',
@ -110,8 +109,8 @@ setup(name=name,
zip_safe=False,
entry_points="""
[trytond.modules]
sale_rule = trytond.modules.sale_rule
""",
%s = trytond.modules.%s
""" % (MODULE, MODULE),
test_suite='tests',
test_loader='trytond.test_loader:Loader',
tests_require=tests_require,

10
tox.ini
View File

@ -1,17 +1,15 @@
[tox]
envlist = {py27,py33,py34,py35}-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql}
envlist = {py35,py36,py37}-{sqlite,postgresql},pypy3-{sqlite,postgresql}
[testenv]
commands = {envpython} setup.py test
deps =
{py27,py33,py34,py35}-postgresql: psycopg2 >= 2.5
pypy-postgresql: psycopg2cffi >= 2.5
mysql: MySQL-python
{py35,py36,py37}-postgresql: psycopg2 >= 2.5
pypy3-postgresql: psycopg2cffi >= 2.5
{py35,py36}-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}

View File

@ -1,5 +1,5 @@
[tryton]
version=5.1.0
version=5.2.0
depends:
ir
res