Add python3 support

issue3211
review25151002
This commit is contained in:
Nicolas Évrard
2016-06-03 19:26:44 +02:00
parent 3d7640a6f8
commit 98ea3a3ee5
5 changed files with 22 additions and 9 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 sqlite,postgresql
- tox -e "{py27,py33,py34,py35}-{sqlite,postgresql}"
services:
- postgres
+1
View File
@@ -1,3 +1,4 @@
* Add Python3 support
* Switch to ldap3
Version 4.0.0 - 2016-05-02
+2 -2
View File
@@ -10,14 +10,13 @@ from trytond.config import config, parse_uri
from trytond.exceptions import LoginException
__all__ = ['User']
__metaclass__ = PoolMeta
logger = logging.getLogger(__name__)
section = 'ldap_authentication'
# Old version of urlparse doesn't parse query for ldap
# see http://bugs.python.org/issue9374
if hasattr(urlparse, 'uses_query') and 'ldap' not in urlparse.uses_query:
if 'ldap' not in urlparse.uses_query:
urlparse.uses_query.append('ldap')
@@ -48,6 +47,7 @@ def ldap_server():
class User:
__metaclass__ = PoolMeta
__name__ = 'res.user'
@classmethod
+15 -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'):
@@ -91,6 +97,11 @@ 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',
('Topic :: System :: Systems Administration '
':: Authentication/Directory :: LDAP'),
@@ -105,4 +116,5 @@ setup(name=name,
test_suite='tests',
test_loader='trytond.test_loader:Loader',
tests_require=tests_require,
use_2to3=True,
)
+2 -2
View File
@@ -1,10 +1,10 @@
[tox]
envlist = py27-{sqlite,postgresql,mysql}
envlist = {py27,py33,py34,py35}-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql}
[testenv]
commands = {envpython} setup.py test
deps =
postgresql: psycopg2 >= 2.5
{py27,py33,py34,py35}-postgresql: psycopg2 >= 2.5
mysql: MySQL-python
setenv =
sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://}