diff --git a/.drone.yml b/.drone.yml index 2049d30a49..daf5886f3a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -42,12 +42,6 @@ services: matrix: include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - IMAGE: python:3.7 TOXENV: py37 DATABASE: sqlite @@ -66,3 +60,9 @@ matrix: - IMAGE: python:3.9 TOXENV: py39 DATABASE: postgresql + - IMAGE: python:3.10 + TOXENV: py310 + DATABASE: sqlite + - IMAGE: python:3.10 + TOXENV: py310 + DATABASE: postgresql diff --git a/CHANGELOG b/CHANGELOG index f5641ee566..2d84192515 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Add support for Python 3.10 +* Remove support for Python 3.6 * Add creatable attribute on tree and form views * Fill local cache of Function field instances with values * Cache Function field getter without context in readonly transactions diff --git a/setup.py b/setup.py index f04ae60012..c4f76e43bd 100755 --- a/setup.py +++ b/setup.py @@ -145,17 +145,17 @@ setup(name=name, 'Natural Language :: Turkish', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development :: Libraries :: Application Frameworks', ], platforms='any', license='GPL-3', - python_requires='>=3.6', + python_requires='>=3.7', install_requires=[ 'lxml >= 2.0', 'relatorio[fodt] >= 0.7.0', diff --git a/tox.ini b/tox.ini index 29b22ff2f0..9ea339503b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = {py36,py37,py38,py39}-{sqlite,postgresql},pypy3-{sqlite,postgresql} +envlist = {py37,py38,py39,py310}-{sqlite,postgresql},pypy3-{sqlite,postgresql} [testenv] commands = @@ -7,9 +7,8 @@ commands = coverage report --include=./trytond/* --omit=*/tests/* deps = coverage - {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 + {py37,py38,py39,py310}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 - py36-sqlite: sqlitebck setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} diff --git a/trytond/console.py b/trytond/console.py index e554dc4c01..9654adc116 100644 --- a/trytond/console.py +++ b/trytond/console.py @@ -55,10 +55,7 @@ def run(options): console = Console(local, histsize=options.histsize) banner = "Tryton %s, Python %s on %s" % ( __version__, sys.version, sys.platform) - kwargs = {} - if sys.version_info >= (3, 6): - kwargs['exitmsg'] = '' - console.interact(banner=banner, **kwargs) + console.interact(banner=banner, exitmsg='') else: console = InteractiveConsole(local) console.runcode(sys.stdin.read()) diff --git a/trytond/ir/session.py b/trytond/ir/session.py index 79199f748c..a52dd44f37 100644 --- a/trytond/ir/session.py +++ b/trytond/ir/session.py @@ -1,17 +1,8 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -import binascii import datetime import json -import os - -try: - from secrets import token_hex -except ImportError: - def token_hex(nbytes=None): - if nbytes is None: - nbytes = 32 - return binascii.hexlify(os.urandom(nbytes)).decode('ascii') +from secrets import token_hex from trytond.config import config from trytond.model import ModelSQL, fields