Add bfxapi/version.py to contain the package version.

This commit is contained in:
Davide Casale
2023-03-22 21:24:44 +01:00
parent 275cff6a2a
commit 34f583cfff
12 changed files with 12 additions and 18 deletions

View File

@@ -3,4 +3,4 @@ from .client import Client
from .urls import REST_HOST, PUB_REST_HOST, \ from .urls import REST_HOST, PUB_REST_HOST, \
WSS_HOST, PUB_WSS_HOST WSS_HOST, PUB_WSS_HOST
NAME = "bfxapi" from .version import __version__

View File

@@ -1,4 +1,2 @@
from .endpoints import BfxRestInterface, RestPublicEndpoints, RestAuthenticatedEndpoints, \ from .endpoints import BfxRestInterface, RestPublicEndpoints, RestAuthenticatedEndpoints, \
RestMerchantEndpoints RestMerchantEndpoints
NAME = "rest"

View File

@@ -3,5 +3,3 @@ from .bfx_rest_interface import BfxRestInterface
from .rest_public_endpoints import RestPublicEndpoints from .rest_public_endpoints import RestPublicEndpoints
from .rest_authenticated_endpoints import RestAuthenticatedEndpoints from .rest_authenticated_endpoints import RestAuthenticatedEndpoints
from .rest_merchant_endpoints import RestMerchantEndpoints from .rest_merchant_endpoints import RestMerchantEndpoints
NAME = "endpoints"

View File

@@ -242,7 +242,10 @@ class RestPublicEndpoints(Middleware):
def get_pulse_profile_details(self, nickname: str) -> PulseProfile: def get_pulse_profile_details(self, nickname: str) -> PulseProfile:
return serializers.PulseProfile.parse(*self._get(f"pulse/profile/{nickname}")) 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 = [] messages = []
for subdata in self._get("pulse/hist", params={ "end": end, "limit": limit }): for subdata in self._get("pulse/hist", params={ "end": end, "limit": limit }):

View File

@@ -1,3 +1 @@
from .middleware import Middleware from .middleware import Middleware
NAME = "middleware"

View File

@@ -1,11 +1,10 @@
import unittest import unittest
from .test_rest_serializers import TestRestSerializers from .test_rest_serializers import TestRestSerializers
from .test_websocket_serializers import TestWebsocketSerializers from .test_websocket_serializers import TestWebsocketSerializers
from .test_labeler import TestLabeler from .test_labeler import TestLabeler
from .test_notification import TestNotification from .test_notification import TestNotification
NAME = "tests"
def suite(): def suite():
return unittest.TestSuite([ return unittest.TestSuite([
unittest.makeSuite(TestRestSerializers), unittest.makeSuite(TestRestSerializers),

View File

@@ -1 +0,0 @@
NAME = "utils"

1
bfxapi/version.py Normal file
View File

@@ -0,0 +1 @@
__version__ = "3.0.0b1"

View File

@@ -1,3 +1 @@
from .client import BfxWebsocketClient, BfxWebsocketBucket, BfxWebsocketInputs from .client import BfxWebsocketClient, BfxWebsocketBucket, BfxWebsocketInputs
NAME = "websocket"

View File

@@ -1,5 +1,3 @@
from .bfx_websocket_client import BfxWebsocketClient from .bfx_websocket_client import BfxWebsocketClient
from .bfx_websocket_bucket import BfxWebsocketBucket from .bfx_websocket_bucket import BfxWebsocketBucket
from .bfx_websocket_inputs import BfxWebsocketInputs from .bfx_websocket_inputs import BfxWebsocketInputs
NAME = "client"

View File

@@ -1,4 +1,2 @@
from .public_channels_handler import PublicChannelsHandler from .public_channels_handler import PublicChannelsHandler
from .authenticated_channels_handler import AuthenticatedChannelsHandler from .authenticated_channels_handler import AuthenticatedChannelsHandler
NAME = "handlers"

View File

@@ -1,8 +1,12 @@
from distutils.core import setup 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( setup(
name="bitfinex-api-py", name="bitfinex-api-py",
version="3.0.0b1", version=version["__version__"],
description="Official Bitfinex Python API", description="Official Bitfinex Python API",
long_description="A Python reference implementation of the Bitfinex API for both REST and websocket interaction", long_description="A Python reference implementation of the Bitfinex API for both REST and websocket interaction",
long_description_content_type="text/markdown", long_description_content_type="text/markdown",