Remove support for Python 2.7
issue7497 review53261002
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
* Remove support for Python 2.7
|
||||
|
||||
Version 4.8.0 - 2018-04-23
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Installing trytond_purchase_shipment_cost
|
||||
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_carrier (http://www.tryton.org/)
|
||||
* trytond_currency (http://www.tryton.org/)
|
||||
|
||||
+5
-5
@@ -2,13 +2,13 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.pool import Pool
|
||||
from stock import *
|
||||
from carrier import *
|
||||
from . import stock
|
||||
from . import carrier
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
ShipmentIn,
|
||||
Move,
|
||||
Carrier,
|
||||
stock.ShipmentIn,
|
||||
stock.Move,
|
||||
carrier.Carrier,
|
||||
module='purchase_shipment_cost', type_='model')
|
||||
|
||||
+1
-2
@@ -6,8 +6,7 @@ from trytond.pool import PoolMeta
|
||||
__all__ = ['Carrier']
|
||||
|
||||
|
||||
class Carrier:
|
||||
__metaclass__ = PoolMeta
|
||||
class Carrier(metaclass=PoolMeta):
|
||||
__name__ = 'carrier'
|
||||
carrier_cost_allocation_method = fields.Selection([
|
||||
('value', 'By Value'),
|
||||
|
||||
@@ -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'))
|
||||
@@ -59,7 +57,6 @@ for dep in info.get('extras_depend', []):
|
||||
extras_require[dep] = get_require_version('trytond_%s' % dep)
|
||||
|
||||
tests_require = [get_require_version('proteus'),
|
||||
'mock', # For account_stock_anglo_saxon tests tools
|
||||
get_require_version('trytond_account_stock_continental'),
|
||||
get_require_version('trytond_account_stock_anglo_saxon'),
|
||||
get_require_version('trytond_purchase')]
|
||||
@@ -111,7 +108,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',
|
||||
@@ -120,6 +116,7 @@ setup(name=name,
|
||||
'Topic :: Office/Business',
|
||||
],
|
||||
license='GPL-3',
|
||||
python_requires='>=3.4',
|
||||
install_requires=requires,
|
||||
extras_require=extras_require,
|
||||
dependency_links=dependency_links,
|
||||
@@ -131,10 +128,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_purchase_shipment_cost.rst',
|
||||
'tests/scenario_purchase_shipment_cost_with_account_stock.rst',
|
||||
'tests/scenario_purchase_shipment_cost_with_account_stock_anglo_saxon.rst',
|
||||
],
|
||||
)
|
||||
|
||||
@@ -13,8 +13,7 @@ from trytond.modules.product import price_digits
|
||||
__all__ = ['ShipmentIn', 'Move']
|
||||
|
||||
|
||||
class ShipmentIn:
|
||||
__metaclass__ = PoolMeta
|
||||
class ShipmentIn(metaclass=PoolMeta):
|
||||
__name__ = 'stock.shipment.in'
|
||||
carrier = fields.Many2One('carrier', 'Carrier', states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
@@ -139,8 +138,7 @@ class ShipmentIn:
|
||||
super(ShipmentIn, cls).receive(shipments)
|
||||
|
||||
|
||||
class Move:
|
||||
__metaclass__ = PoolMeta
|
||||
class Move(metaclass=PoolMeta):
|
||||
__name__ = 'stock.move'
|
||||
unit_shipment_cost = fields.Numeric('Unit Shipment Cost',
|
||||
digits=price_digits, readonly=True)
|
||||
|
||||
@@ -89,7 +89,7 @@ Receive a single product line::
|
||||
True
|
||||
>>> shipment.click('receive')
|
||||
>>> shipment.state
|
||||
u'received'
|
||||
'received'
|
||||
>>> move, = shipment.incoming_moves
|
||||
>>> move.unit_price
|
||||
Decimal('8.0600')
|
||||
@@ -110,7 +110,7 @@ Receive many product lines::
|
||||
Decimal('3')
|
||||
>>> shipment.click('receive')
|
||||
>>> shipment.state
|
||||
u'received'
|
||||
'received'
|
||||
>>> [move.unit_price for move in shipment.incoming_moves] == \
|
||||
... [Decimal('8.3333'), Decimal('8.3333'), Decimal('8.3334')]
|
||||
True
|
||||
@@ -136,6 +136,6 @@ Receive a two lines with no cost::
|
||||
Decimal('3')
|
||||
>>> shipment.click('receive')
|
||||
>>> shipment.state
|
||||
u'received'
|
||||
'received'
|
||||
>>> tuple(m.unit_price for m in shipment.incoming_moves)
|
||||
(Decimal('0.0600'), Decimal('0.0200'))
|
||||
|
||||
@@ -148,7 +148,7 @@ Receive a single product line::
|
||||
True
|
||||
>>> shipment.click('receive')
|
||||
>>> shipment.state
|
||||
u'received'
|
||||
'received'
|
||||
>>> move, move_average = shipment.incoming_moves
|
||||
>>> move.unit_price
|
||||
Decimal('8.0600')
|
||||
@@ -183,7 +183,7 @@ Receive many product lines::
|
||||
Decimal('3')
|
||||
>>> shipment.click('receive')
|
||||
>>> shipment.state
|
||||
u'received'
|
||||
'received'
|
||||
>>> [move.unit_price for move in shipment.incoming_moves] == \
|
||||
... [Decimal('8.3333'), Decimal('8.3333'), Decimal('8.3334')]
|
||||
True
|
||||
|
||||
@@ -142,7 +142,7 @@ Purchase 5 products::
|
||||
>>> purchase.click('confirm')
|
||||
>>> purchase.click('process')
|
||||
>>> purchase.state
|
||||
u'processing'
|
||||
'processing'
|
||||
|
||||
Receive 4 products::
|
||||
|
||||
@@ -159,13 +159,13 @@ Receive 4 products::
|
||||
True
|
||||
>>> shipment.click('receive')
|
||||
>>> shipment.state
|
||||
u'received'
|
||||
'received'
|
||||
>>> move, = shipment.incoming_moves
|
||||
>>> move.unit_price
|
||||
Decimal('5.7500')
|
||||
>>> shipment.click('done')
|
||||
>>> shipment.state
|
||||
u'done'
|
||||
'done'
|
||||
>>> stock_supplier.reload()
|
||||
>>> stock.reload()
|
||||
>>> stock_supplier.debit
|
||||
@@ -192,7 +192,7 @@ Open supplier invoice::
|
||||
>>> invoice.save()
|
||||
>>> invoice.click('post')
|
||||
>>> invoice.state
|
||||
u'posted'
|
||||
'posted'
|
||||
>>> payable.reload()
|
||||
>>> payable.debit
|
||||
Decimal('0.00')
|
||||
|
||||
@@ -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://}
|
||||
|
||||
Reference in New Issue
Block a user