Add Python3 support

issue3211
review20761002
This commit is contained in:
Jonathan Levy
2016-02-26 19:50:53 +01:00
parent 7d00c24344
commit e0fb4e89b1
5 changed files with 21 additions and 8 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
image: python2.7
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
- tox -e "py27-{sqlite,postgresql}"
- tox -e "{py27,py33,py34,py35}-{sqlite,postgresql}" --skip-missing-interpreters
services:
- postgres
+1
View File
@@ -1,3 +1,4 @@
* Add Python3 support
* Add configuration for default use category's accounts and taxes
Version 3.8.0 - 2015-11-02
+3 -1
View File
@@ -11,7 +11,6 @@ from trytond.pool import PoolMeta, Pool
__all__ = ['Category', 'CategoryCustomerTax', 'CategorySupplierTax',
'Template', 'TemplateCustomerTax', 'TemplateSupplierTax', 'Product',
'MissingFunction']
__metaclass__ = PoolMeta
class MissingFunction(fields.Function):
@@ -40,6 +39,7 @@ class MissingFunction(fields.Function):
class Category:
__metaclass__ = PoolMeta
__name__ = 'product.category'
account_parent = fields.Boolean('Use Parent\'s accounts',
help='Use the accounts defined on the parent category')
@@ -185,6 +185,7 @@ class CategorySupplierTax(ModelSQL):
class Template:
__metaclass__ = PoolMeta
__name__ = 'product.template'
account_category = fields.Boolean('Use Category\'s accounts',
help='Use the accounts defined on the category')
@@ -318,6 +319,7 @@ class TemplateSupplierTax(ModelSQL):
class Product:
__metaclass__ = PoolMeta
__name__ = 'product.product'
# Avoid raise of UserError from MissingFunction
account_expense_used = fields.Function(fields.Many2One('account.account',
+13 -3
View File
@@ -5,11 +5,17 @@
from setuptools import setup
import re
import os
import ConfigParser
import io
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import ConfigParser
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
return io.open(
os.path.join(os.path.dirname(__file__), fname),
'r', encoding='utf-8').read()
def get_require_version(name):
@@ -21,7 +27,7 @@ def get_require_version(name):
major_version, minor_version + 1)
return require
config = ConfigParser.ConfigParser()
config = ConfigParser()
config.readfp(open('tryton.cfg'))
info = dict(config.items('tryton'))
for key in ('depends', 'extras_depend', 'xml'):
@@ -88,6 +94,9 @@ setup(name=name,
'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 :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Office/Business',
@@ -102,4 +111,5 @@ setup(name=name,
""",
test_suite='tests',
test_loader='trytond.test_loader:Loader',
use_2to3=True,
)
+2 -2
View File
@@ -1,10 +1,10 @@
[tox]
envlist = py27-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql}
envlist = {py27,py33,py34,py35}-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql}
[testenv]
commands = {envpython} setup.py test
deps =
py27-postgresql: psycopg2 >= 2.0
{py27,py33,py34,py35}-postgresql: psycopg2 >= 2.0
pypy-postgresql: psycopg2cffi >= 2.5
mysql: MySQL-python
setenv =