diff --git a/bfxapi/__init__.py b/bfxapi/__init__.py index 304bc34..b583248 100644 --- a/bfxapi/__init__.py +++ b/bfxapi/__init__.py @@ -3,4 +3,4 @@ from .client import Client from .urls import REST_HOST, PUB_REST_HOST, \ WSS_HOST, PUB_WSS_HOST -NAME = "bfxapi" +from .version import __version__ diff --git a/bfxapi/rest/__init__.py b/bfxapi/rest/__init__.py index 4f17f62..e18526e 100644 --- a/bfxapi/rest/__init__.py +++ b/bfxapi/rest/__init__.py @@ -1,4 +1,2 @@ from .endpoints import BfxRestInterface, RestPublicEndpoints, RestAuthenticatedEndpoints, \ RestMerchantEndpoints - -NAME = "rest" diff --git a/bfxapi/rest/endpoints/__init__.py b/bfxapi/rest/endpoints/__init__.py index ef82b97..2775e2e 100644 --- a/bfxapi/rest/endpoints/__init__.py +++ b/bfxapi/rest/endpoints/__init__.py @@ -3,5 +3,3 @@ from .bfx_rest_interface import BfxRestInterface from .rest_public_endpoints import RestPublicEndpoints from .rest_authenticated_endpoints import RestAuthenticatedEndpoints from .rest_merchant_endpoints import RestMerchantEndpoints - -NAME = "endpoints" diff --git a/bfxapi/rest/endpoints/rest_public_endpoints.py b/bfxapi/rest/endpoints/rest_public_endpoints.py index 6f6d772..c80d86b 100644 --- a/bfxapi/rest/endpoints/rest_public_endpoints.py +++ b/bfxapi/rest/endpoints/rest_public_endpoints.py @@ -242,7 +242,10 @@ class RestPublicEndpoints(Middleware): def get_pulse_profile_details(self, nickname: str) -> PulseProfile: return serializers.PulseProfile.parse(*self._get(f"pulse/profile/{nickname}")) - def get_pulse_message_history(self, *, end: Optional[str] = None, limit: Optional[int] = None) -> List[PulseMessage]: + def get_pulse_message_history(self, + *, + end: Optional[str] = None, + limit: Optional[int] = None) -> List[PulseMessage]: messages = [] for subdata in self._get("pulse/hist", params={ "end": end, "limit": limit }): diff --git a/bfxapi/rest/middleware/__init__.py b/bfxapi/rest/middleware/__init__.py index d7f9c42..ae3488d 100644 --- a/bfxapi/rest/middleware/__init__.py +++ b/bfxapi/rest/middleware/__init__.py @@ -1,3 +1 @@ from .middleware import Middleware - -NAME = "middleware" diff --git a/bfxapi/tests/__init__.py b/bfxapi/tests/__init__.py index 3084e94..df78300 100644 --- a/bfxapi/tests/__init__.py +++ b/bfxapi/tests/__init__.py @@ -1,11 +1,10 @@ import unittest + from .test_rest_serializers import TestRestSerializers from .test_websocket_serializers import TestWebsocketSerializers from .test_labeler import TestLabeler from .test_notification import TestNotification -NAME = "tests" - def suite(): return unittest.TestSuite([ unittest.makeSuite(TestRestSerializers), diff --git a/bfxapi/utils/__init__.py b/bfxapi/utils/__init__.py index 32f9209..e69de29 100644 --- a/bfxapi/utils/__init__.py +++ b/bfxapi/utils/__init__.py @@ -1 +0,0 @@ -NAME = "utils" diff --git a/bfxapi/version.py b/bfxapi/version.py new file mode 100644 index 0000000..3996ce8 --- /dev/null +++ b/bfxapi/version.py @@ -0,0 +1 @@ +__version__ = "3.0.0b1" diff --git a/bfxapi/websocket/__init__.py b/bfxapi/websocket/__init__.py index 6be76dd..1509ba7 100644 --- a/bfxapi/websocket/__init__.py +++ b/bfxapi/websocket/__init__.py @@ -1,3 +1 @@ from .client import BfxWebsocketClient, BfxWebsocketBucket, BfxWebsocketInputs - -NAME = "websocket" diff --git a/bfxapi/websocket/client/__init__.py b/bfxapi/websocket/client/__init__.py index fa12a78..e9acea9 100644 --- a/bfxapi/websocket/client/__init__.py +++ b/bfxapi/websocket/client/__init__.py @@ -1,5 +1,3 @@ from .bfx_websocket_client import BfxWebsocketClient from .bfx_websocket_bucket import BfxWebsocketBucket from .bfx_websocket_inputs import BfxWebsocketInputs - -NAME = "client" diff --git a/bfxapi/websocket/handlers/__init__.py b/bfxapi/websocket/handlers/__init__.py index e339402..d55ea1e 100644 --- a/bfxapi/websocket/handlers/__init__.py +++ b/bfxapi/websocket/handlers/__init__.py @@ -1,4 +1,2 @@ from .public_channels_handler import PublicChannelsHandler from .authenticated_channels_handler import AuthenticatedChannelsHandler - -NAME = "handlers" diff --git a/setup.py b/setup.py index a11a161..b8484a6 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,12 @@ from distutils.core import setup +version = {} +with open("bfxapi/version.py", encoding="utf-8") as fp: + exec(fp.read(), version) #pylint: disable=exec-used + setup( name="bitfinex-api-py", - version="3.0.0b1", + version=version["__version__"], description="Official Bitfinex Python API", long_description="A Python reference implementation of the Bitfinex API for both REST and websocket interaction", long_description_content_type="text/markdown",