Skip to content

Commit

Permalink
Removed setup.py version test. Version is now read directly from source
Browse files Browse the repository at this point in the history
  • Loading branch information
jamespeterschinner committed Dec 22, 2017
1 parent 067c42e commit 077495e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 21 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,10 @@ Added attributes to TradeSummary:
- Model.dict argument `datetime` is now `datetime_format`. Argument behaviour now
specifies the representation of times. Either `RFC3339` or `UNIX`. Corresponding `json` argument
changes the representation of UNIX times to either a `str` or `numpy.int64`
- *Response* .json() accepts `datetime_format` argument string
- *Response* .json() accepts `datetime_format` argument string

5.0.1b0
=======

- OandaClient.datetime_format is read only
- OandaClient._instruments is no longer a protected attribute. It is now OandaClient.instruments
3 changes: 3 additions & 0 deletions async_v20/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from async_v20.client import OandaClient
from async_v20.definitions import *
from async_v20.endpoints.annotations import *
from async_v20.client import __version__

__version__ = __version__
2 changes: 1 addition & 1 deletion async_v20/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def sleep(s=0.0):
await asyncio.sleep(s)


__version__ = '5.0.0b0'
__version__ = '5.0.1b0'


class OandaClient(AccountInterface, InstrumentInterface, OrderInterface, PositionInterface,
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
# built documents.
#
# The short X.Y version.
version = '5.0.0b0'
version = '5.0.1b0'
# The full version, including alpha/beta/rc tags.
release = '5.0.0b0'
release = '5.0.1b0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import os

from setuptools import setup, find_packages

version = '5.0.0b0'
from async_v20 import __version__


def read(f):
return open(os.path.join(os.path.dirname(__file__), f)).read().strip()


setup(name='async_v20',
version=version,
version=__version__,
description="Asynchronous wrapper for OANDA's v20 REST API",
long_description=read('README.rst') + '\n\n' + read('CHANGELOG.rst'),
author='James Peter Schinner',
Expand Down
15 changes: 1 addition & 14 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from itertools import chain

import pytest

import async_v20
from async_v20 import AccountID
from async_v20.client import OandaClient
from async_v20.definitions.types import Account
Expand All @@ -25,19 +25,6 @@
all_trades_open_closed = all_trades_open_closed


def test_oanda_client_has_correct_version(client):
try:
path = r'C:\Users\James\PycharmProjects\async_v20\setup.py'
print(path)
with open(path, 'r') as f:
setup = f.read()
except FileNotFoundError as e:
print(e)
else:
setup_version = re.findall(r"(?<=version\s=\s').*?(?='\n)", setup)[0]
assert setup_version == client.version


def test_oanda_client_finds_token():
os.environ['OANDA_TOKEN'] = 'test_environ_token'
client = OandaClient()
Expand Down

0 comments on commit 077495e

Please sign in to comment.