Skip to content

Commit f3cc257

Browse files
committed
Merge branch 'master' of github.com:dxFeed/dxfeed-python-api into EN-1454-extend-listeners
2 parents 224cfd8 + 3c513f4 commit f3cc257

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

dxfeed/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
from dxfeed.wrappers.endpoint import Endpoint
22
from dxfeed.core.utils.handler import EventHandler, DefaultHandler
33
import pkg_resources
4+
import toml
5+
from pathlib import Path
46

57

6-
__version__ = pkg_resources.get_distribution('dxfeed').version
8+
try:
9+
__version__ = pkg_resources.get_distribution('dxfeed').version
10+
except pkg_resources.DistributionNotFound:
11+
pyproject = toml.load(Path(__file__).parents[1] / 'pyproject.toml')
12+
__version__ = pyproject['tool']['poetry']['version']

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,24 @@ exclude = ['dxfeed/dxfeed-c-api/wrappers*',
3131
[tool.poetry.dependencies]
3232
python = '^3.6'
3333
pandas = '^0.25.1'
34+
toml = '^0.10.0'
3435
# The following dependencies are used for docs generation when installed as extras
3536
# (e.g. pip install nornir[docs])
3637
# Currently they have to be specified as non-dev dependencies with optional = true
3738
# Refer to: https://github.com/sdispater/poetry/issues/129
3839
# Issue to watch for: https://github.com/python-poetry/poetry/issues/1644
39-
toml = { version = '^0.10.0', optional = true }
4040
jupyter = { version = '^1.0.0', optional = true }
4141

4242
[tool.poetry.dev-dependencies]
4343
cython = '^0.29.13'
4444
taskipy = '^1.1.3'
4545
pytest = '^5.3.5'
4646
sphinx = '^2.4.4'
47-
toml = '^0.10.0'
4847
sphinx_rtd_theme = '^0.4.3'
4948
pygments = '^2.6.1'
5049

5150
[tool.poetry.extras]
52-
docs = ['toml', 'jupyter']
51+
docs = ['jupyter']
5352

5453
[tool.taskipy.tasks]
5554
clear = 'find dxfeed/core -type f \( -iname *.c -o -iname *.cpp -o -iname *.pyd -o -iname *.so \) -delete'

0 commit comments

Comments
 (0)