changeset fad4c8689cbd in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=fad4c8689cbd
description:
Add support for Python 3.10
and remove support for Python 3.6.
issue11048
review364451002
diffstat:
.drone.yml | 12 ++++++------
CHANGELOG | 2 ++
setup.py | 4 ++--
tox.ini | 5 ++---
trytond/console.py | 5 +----
trytond/ir/session.py | 11 +----------
6 files changed, 14 insertions(+), 25 deletions(-)
diffs (116 lines):
diff -r 970256a66ba0 -r fad4c8689cbd .drone.yml
--- a/.drone.yml Sat Dec 18 01:37:06 2021 +0100
+++ b/.drone.yml Sat Dec 18 16:34:37 2021 +0100
@@ -42,12 +42,6 @@
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 @@
- 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 -r 970256a66ba0 -r fad4c8689cbd CHANGELOG
--- a/CHANGELOG Sat Dec 18 01:37:06 2021 +0100
+++ b/CHANGELOG Sat Dec 18 16:34:37 2021 +0100
@@ -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 -r 970256a66ba0 -r fad4c8689cbd setup.py
--- a/setup.py Sat Dec 18 01:37:06 2021 +0100
+++ b/setup.py Sat Dec 18 16:34:37 2021 +0100
@@ -145,17 +145,17 @@
'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 -r 970256a66ba0 -r fad4c8689cbd tox.ini
--- a/tox.ini Sat Dec 18 01:37:06 2021 +0100
+++ b/tox.ini Sat Dec 18 16:34:37 2021 +0100
@@ -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 @@
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 -r 970256a66ba0 -r fad4c8689cbd trytond/console.py
--- a/trytond/console.py Sat Dec 18 01:37:06 2021 +0100
+++ b/trytond/console.py Sat Dec 18 16:34:37 2021 +0100
@@ -55,10 +55,7 @@
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 -r 970256a66ba0 -r fad4c8689cbd trytond/ir/session.py
--- a/trytond/ir/session.py Sat Dec 18 01:37:06 2021 +0100
+++ b/trytond/ir/session.py Sat Dec 18 16:34:37 2021 +0100
@@ -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