Remove support for Python 2.7

issue7497
review53261002
This commit is contained in:
Cédric Krier
2018-06-26 19:11:44 +02:00
parent e6d10fd4fc
commit e27ce586ad
9 changed files with 36 additions and 54 deletions
-6
View File
@@ -25,12 +25,6 @@ services:
matrix:
include:
- IMAGE: python:2.7
TOXENV: py27
DATABASE: sqlite
- IMAGE: python:2.7
TOXENV: py27
DATABASE: postgresql
- IMAGE: python:3.4
TOXENV: py34
DATABASE: sqlite
+2
View File
@@ -1,3 +1,5 @@
* Remove support for Python 2.7
Version 4.8.0 - 2018-04-23
* Bug fixes (see mercurial logs for details)
+1 -1
View File
@@ -4,7 +4,7 @@ Installing trytond_account_stock_continental
Prerequisites
-------------
* Python 2.7 or later (http://www.python.org/)
* Python 3.4 or later (http://www.python.org/)
* trytond (http://www.tryton.org/)
* trytond_account (http://www.tryton.org/)
* trytond_account_product (http://www.tryton.org/)
+3 -6
View File
@@ -12,8 +12,7 @@ stock_journal = fields.Many2One(
'account.journal', "Stock Journal", required=True)
class Configuration:
__metaclass__ = PoolMeta
class Configuration(metaclass=PoolMeta):
__name__ = 'account.configuration'
stock_journal = fields.MultiValue(stock_journal)
cost_price_counterpart_account = fields.MultiValue(fields.Many2One(
@@ -53,8 +52,7 @@ class ConfigurationCostPriceCounterpartAccount(ModelSQL, CompanyValueMixin):
depends=['company'])
class FiscalYear:
__metaclass__ = PoolMeta
class FiscalYear(metaclass=PoolMeta):
__name__ = 'account.fiscalyear'
account_stock_method = fields.Selection([
(None, 'None'),
@@ -62,8 +60,7 @@ class FiscalYear:
], 'Account Stock Method')
class AccountMove:
__metaclass__ = PoolMeta
class AccountMove(metaclass=PoolMeta):
__name__ = 'account.move'
@classmethod
+4 -8
View File
@@ -21,8 +21,7 @@ account_names = [
'account_stock_production', 'account_stock_lost_found']
class Category:
__metaclass__ = PoolMeta
class Category(metaclass=PoolMeta):
__name__ = 'product.category'
account_stock = fields.MultiValue(fields.Many2One(
'account.account', "Account Stock",
@@ -118,8 +117,7 @@ class Category:
pass
class CategoryAccount:
__metaclass__ = PoolMeta
class CategoryAccount(metaclass=PoolMeta):
__name__ = 'product.category.account'
account_stock = fields.Many2One(
'account.account', "Account Stock",
@@ -179,8 +177,7 @@ class CategoryAccount:
field_names, value_names, fields)
class Template:
__metaclass__ = PoolMeta
class Template(metaclass=PoolMeta):
__name__ = 'product.template'
@classmethod
@@ -219,8 +216,7 @@ class Template:
pass
class Product:
__metaclass__ = PoolMeta
class Product(metaclass=PoolMeta):
__name__ = 'product.product'
account_stock_used = template_property('account_stock_used')
account_stock_supplier_used = template_property(
+7 -13
View File
@@ -1,15 +1,12 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from setuptools import setup
import re
import os
import io
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import ConfigParser
import os
import re
from configparser import ConfigParser
from setuptools import setup
def read(fname):
@@ -27,6 +24,7 @@ def get_require_version(name):
major_version, minor_version + 1)
return require
config = ConfigParser()
config.readfp(open('tryton.cfg'))
info = dict(config.items('tryton'))
@@ -104,7 +102,6 @@ setup(name=name,
'Natural Language :: Slovenian',
'Natural Language :: Spanish',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
@@ -114,6 +111,7 @@ setup(name=name,
'Topic :: Office/Business :: Financial :: Accounting',
],
license='GPL-3',
python_requires='>=3.4',
install_requires=requires,
dependency_links=dependency_links,
zip_safe=False,
@@ -124,8 +122,4 @@ 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_stock_continental.rst',
],
)
+1 -2
View File
@@ -9,8 +9,7 @@ from trytond.transaction import Transaction
__all__ = ['Move']
class Move:
__metaclass__ = PoolMeta
class Move(metaclass=PoolMeta):
__name__ = 'stock.move'
def _get_account_stock_move_lines(self, type_):
+15 -15
View File
@@ -124,7 +124,7 @@ Purchase 12 products::
>>> purchase.click('confirm')
>>> purchase.click('process')
>>> purchase.state
u'processing'
'processing'
Receive 9 products::
@@ -142,7 +142,7 @@ Receive 9 products::
>>> shipment.click('receive')
>>> shipment.click('done')
>>> shipment.state
u'done'
'done'
>>> stock_supplier.reload()
>>> stock_supplier.debit
Decimal('0.00')
@@ -167,7 +167,7 @@ Open supplier invoice::
>>> invoice.invoice_date = today
>>> invoice.click('post')
>>> invoice.state
u'posted'
'posted'
>>> payable.reload()
>>> payable.debit
Decimal('0.00')
@@ -196,7 +196,7 @@ Sale 5 products::
>>> sale.click('confirm')
>>> sale.click('process')
>>> sale.state
u'processing'
'processing'
Send 5 products::
@@ -204,13 +204,13 @@ Send 5 products::
>>> shipment.click('assign_try')
True
>>> shipment.state
u'assigned'
'assigned'
>>> shipment.click('pack')
>>> shipment.state
u'packed'
'packed'
>>> shipment.click('done')
>>> shipment.state
u'done'
'done'
>>> stock_customer.reload()
>>> stock_customer.debit
Decimal('28.00')
@@ -228,7 +228,7 @@ Open customer invoice::
>>> invoice, = sale.invoices
>>> invoice.click('post')
>>> invoice.state
u'posted'
'posted'
>>> receivable.reload()
>>> receivable.debit
Decimal('50.00')
@@ -257,7 +257,7 @@ Create an Inventory::
>>> inventory_line.quantity = 1.0
>>> inventory.click('confirm')
>>> inventory.state
u'done'
'done'
>>> stock_lost_found.reload()
>>> stock_lost_found.debit
Decimal('11.00')
@@ -291,7 +291,7 @@ Create Drop Shipment Move::
>>> sale.click('confirm')
>>> sale.click('process')
>>> sale.state
u'processing'
'processing'
>>> PurchaseRequest = Model.get('purchase.request')
>>> purchase_request, = PurchaseRequest.find()
@@ -305,13 +305,13 @@ Create Drop Shipment Move::
>>> purchase.click('confirm')
>>> purchase.click('process')
>>> purchase.state
u'processing'
'processing'
>>> shipment, = sale.drop_shipments
>>> shipment.click('ship')
>>> shipment.click('done')
>>> shipment.state
u'done'
'done'
>>> stock_supplier.reload()
>>> stock_supplier.debit
@@ -343,7 +343,7 @@ Create Drop Shipment Move::
>>> sale.click('confirm')
>>> sale.click('process')
>>> sale.state
u'processing'
'processing'
>>> purchase_request, = [p for p in PurchaseRequest.find()
... if p.state == 'draft']
@@ -357,13 +357,13 @@ Create Drop Shipment Move::
>>> purchase.click('confirm')
>>> purchase.click('process')
>>> purchase.state
u'processing'
'processing'
>>> shipment, = sale.drop_shipments
>>> shipment.click('ship')
>>> shipment.click('done')
>>> shipment.state
u'done'
'done'
>>> stock_supplier.reload()
>>> stock_supplier.debit
+3 -3
View File
@@ -1,11 +1,11 @@
[tox]
envlist = {py27,py34,py35,py36}-{sqlite,postgresql},pypy-{sqlite,postgresql}
envlist = {py34,py35,py36}-{sqlite,postgresql},pypy3-{sqlite,postgresql}
[testenv]
commands = {envpython} setup.py test
deps =
{py27,py34,py35,py36}-postgresql: psycopg2 >= 2.5
pypy-postgresql: psycopg2cffi >= 2.5
{py34,py35,py36}-postgresql: psycopg2 >= 2.5
pypy3-postgresql: psycopg2cffi >= 2.5
sqlite: sqlitebck
setenv =
sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://}