1
0
mirror of https://github.com/bigchaindb/bigchaindb.git synced 2024-12-29 08:07:52 +01:00

Problem: there are no f-strings in python 3.5 (#2185)

Solution: change f-strings to a compatible format for Python 3.5
This commit is contained in:
codegeschrei 2018-04-09 17:02:59 +02:00 committed by vrde
parent d4934b9525
commit 6f69f39ff4
8 changed files with 23 additions and 5 deletions

View File

@ -6,6 +6,9 @@ pip install --upgrade pip
if [[ -n ${TOXENV} ]]; then if [[ -n ${TOXENV} ]]; then
pip install --upgrade tox pip install --upgrade tox
elif [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then
docker-compose build --build-arg python_version=3.5 --no-cache bigchaindb
pip install --upgrade codecov
else else
docker-compose build --no-cache bigchaindb docker-compose build --no-cache bigchaindb
pip install --upgrade codecov pip install --upgrade codecov

View File

@ -9,6 +9,7 @@ language: python
cache: pip cache: pip
python: python:
- 3.5
- 3.6 - 3.6
env: env:
@ -21,7 +22,18 @@ env:
matrix: matrix:
fast_finish: true fast_finish: true
exclude:
- python: 3.5
env: TOXENV=flake8
- python: 3.5
env: TOXENV=docsroot
- python: 3.5
env: TOXENV=docsserver
include: include:
- python: 3.5
env:
- BIGCHAINDB_DATABASE_BACKEND=localmongodb
- BIGCHAINDB_DATABASE_SSL=
- python: 3.6 - python: 3.6
env: env:
- BIGCHAINDB_DATABASE_BACKEND=localmongodb - BIGCHAINDB_DATABASE_BACKEND=localmongodb

View File

@ -1,4 +1,5 @@
FROM python:3.6 ARG python_version=3.6
FROM python:${python_version}
LABEL maintainer "dev@bigchaindb.com" LABEL maintainer "dev@bigchaindb.com"
RUN apt-get update \ RUN apt-get update \

View File

@ -13,7 +13,7 @@ from bigchaindb.tendermint.utils import decode_transaction_base64
HOST = getenv('BIGCHAINDB_TENDERMINT_HOST', 'localhost') HOST = getenv('BIGCHAINDB_TENDERMINT_HOST', 'localhost')
PORT = int(getenv('BIGCHAINDB_TENDERMINT_PORT', 46657)) PORT = int(getenv('BIGCHAINDB_TENDERMINT_PORT', 46657))
URL = f'ws://{HOST}:{PORT}/websocket' URL = 'ws://{}:{}/websocket'.format(HOST, PORT)
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@ -162,7 +162,7 @@ class BigchainDB(Bigchain):
# See common/transactions.py for details. # See common/transactions.py for details.
hashes = [ hashes = [
sha3_256( sha3_256(
f'''{utxo['transaction_id']}{utxo['output_index']}'''.encode() '{}{}'.format(utxo['transaction_id'], utxo['output_index']).encode()
).digest() for utxo in utxoset ).digest() for utxo in utxoset
] ]
# TODO Notice the sorted call! # TODO Notice the sorted call!
@ -333,7 +333,7 @@ class BigchainDB(Bigchain):
def get_validators(self): def get_validators(self):
try: try:
resp = requests.get(f'{ENDPOINT}validators') resp = requests.get('{}validators'.format(ENDPOINT))
validators = resp.json()['result']['validators'] validators = resp.json()['result']['validators']
for v in validators: for v in validators:
v.pop('accum') v.pop('accum')

View File

@ -117,6 +117,7 @@ setup(
'Natural Language :: English', 'Natural Language :: English',
'License :: OSI Approved :: Apache Software License', 'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
'Operating System :: MacOS :: MacOS X', 'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux', 'Operating System :: POSIX :: Linux',

View File

@ -529,7 +529,7 @@ def tendermint_port():
@pytest.fixture @pytest.fixture
def tendermint_ws_url(tendermint_host, tendermint_port): def tendermint_ws_url(tendermint_host, tendermint_port):
return f'ws://{tendermint_host}:{tendermint_port}/websocket' return 'ws://{}:{}/websocket'.format(tendermint_host, tendermint_port)
@pytest.fixture @pytest.fixture

View File

@ -68,6 +68,7 @@ def test_process_unknown_event():
assert event_queue.empty() assert event_queue.empty()
@pytest.mark.skip('This test will be an integration test.')
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_subscribe_events(tendermint_ws_url): async def test_subscribe_events(tendermint_ws_url):
from bigchaindb.tendermint.event_stream import subscribe_events from bigchaindb.tendermint.event_stream import subscribe_events