Add Python3 support
issue3211 review21741002
This commit is contained in:
1 parent
aed8d36d1b
commit
a5b48bc6d1
10 files changed
+30
-12
No files matched your search
+2
-2
@@ -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,3 +1,5 @@
|
||||
* Add Python3 support
|
||||
|
||||
Version 3.8.0 - 2015-11-02
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
|
||||
|
||||
+2
-1
@@ -5,10 +5,10 @@ from trytond.pyson import Eval
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
__all__ = ['Configuration', 'Move']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
||||
class Configuration:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'account.configuration'
|
||||
asset_sequence = fields.Property(fields.Many2One('ir.sequence',
|
||||
'Asset Reference Sequence', domain=[
|
||||
@@ -19,6 +19,7 @@ class Configuration:
|
||||
|
||||
|
||||
class Move:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'account.move'
|
||||
|
||||
@classmethod
|
||||
|
||||
+1
-1
@@ -5,10 +5,10 @@ from trytond.pyson import Eval
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
|
||||
__all__ = ['InvoiceLine']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
||||
class InvoiceLine:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'account.invoice.line'
|
||||
asset = fields.Many2One('account.asset', 'Asset', domain=[
|
||||
('state', '=', 'running'),
|
||||
|
||||
+3
-1
@@ -6,10 +6,10 @@ from trytond.pool import PoolMeta
|
||||
from trytond.modules.account_product import MissingFunction
|
||||
|
||||
__all__ = ['Category', 'Template', 'Product']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
||||
class Category:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'product.category'
|
||||
account_depreciation = fields.Property(fields.Many2One('account.account',
|
||||
'Account Depreciation', domain=[
|
||||
@@ -39,6 +39,7 @@ class Category:
|
||||
|
||||
|
||||
class Template:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'product.template'
|
||||
depreciable = fields.Boolean('Depreciable', states={
|
||||
'readonly': ~Eval('active', True),
|
||||
@@ -92,6 +93,7 @@ class Template:
|
||||
|
||||
|
||||
class Product:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'product.product'
|
||||
# Avoid raise of UserError from MissingFunction
|
||||
account_depreciation_used = fields.Function(
|
||||
|
||||
+1
-1
@@ -3,10 +3,10 @@
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
__all__ = ['PurchaseLine']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
||||
class PurchaseLine:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'purchase.line'
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -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'):
|
||||
@@ -96,6 +102,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',
|
||||
@@ -112,4 +121,6 @@ setup(name=name,
|
||||
test_suite='tests',
|
||||
test_loader='trytond.test_loader:Loader',
|
||||
tests_require=tests_require,
|
||||
use_2to3=True,
|
||||
convert_2to3_doctests=['tests/scenario_account_asset.rst'],
|
||||
)
|
||||
@@ -12,7 +12,7 @@ Imports::
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart, get_accounts
|
||||
>>> from.trytond.modules.account_invoice.tests.tools import \
|
||||
>>> from trytond.modules.account_invoice.tests.tools import \
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> from trytond.modules.account_asset.tests.tools \
|
||||
... import add_asset_accounts
|
||||
|
||||
@@ -5,6 +5,7 @@ import doctest
|
||||
import trytond.tests.test_tryton
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
from trytond.tests.test_tryton import doctest_setup, doctest_teardown
|
||||
from trytond.tests.test_tryton import doctest_checker
|
||||
|
||||
|
||||
class AccountAssetTestCase(ModuleTestCase):
|
||||
@@ -18,5 +19,6 @@ def suite():
|
||||
AccountAssetTestCase))
|
||||
suite.addTests(doctest.DocFileSuite('scenario_account_asset.rst',
|
||||
setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',
|
||||
checker=doctest_checker,
|
||||
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
|
||||
return suite
|
||||
@@ -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 =
|
||||
|
||||
Reference in new issue
Block a user