Skip to content

Commit 91d345f

Browse files
committed
Merge branch 'master' of github.com:dxFeed/dxfeed-python-api
2 parents 1ea8559 + ae77e44 commit 91d345f

File tree

5 files changed

+25
-21
lines changed

5 files changed

+25
-21
lines changed

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ Install package via PyPI
2323
pip3 install dxfeed
2424
```
2525

26-
---
27-
**NOTE**
28-
29-
MacOS is not supported yet
30-
31-
---
32-
3326
## Basic usage
3427

3528
All the functions in C API have similar ones in Python with the same name. Not all arguments are

build.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,29 @@
1717
source_files_directory = Path(__file__).resolve().parent.joinpath('dxfeed', 'dxfeed-c-api', 'src')
1818
source_files_paths = [str(path) for path in source_files_directory.glob('*.c')]
1919
libs = list()
20+
include_dirs = [str(source_files_directory.parent.joinpath('include')),
21+
str(source_files_directory)]
22+
### Build dxfeed c library
23+
dxfeed_c_lib_args = dict()
2024
if platform.system() == 'Windows':
2125
source_files_paths.remove(str(source_files_directory.joinpath('Linux.c')))
22-
libs = ['ws2_32']
26+
libs.append('ws2_32')
2327
else:
2428
source_files_paths.remove(str(source_files_directory.joinpath('Win32.c')))
29+
dxfeed_c_lib_args.update({'sources': source_files_paths,
30+
'include_dirs': include_dirs})
2531

26-
# Separate dxfeed c api library
27-
dxfeed_c = ('dxfeed_c', {'sources': source_files_paths,
28-
'libraries': libs})
32+
if platform.system() == 'Darwin':
33+
dxfeed_c_lib_args.update({'macros': [('MACOSX', 'TRUE')]})
2934

30-
extensions = [Extension('dxfeed.core.utils.helpers', ['dxfeed/core/utils/helpers.' + ext]),
31-
Extension('dxfeed.core.listeners.listener', ['dxfeed/core/listeners/listener.' + ext]),
32-
Extension('dxfeed.core.DXFeedPy', ['dxfeed/core/DXFeedPy.' + ext_pp], libraries=libs)]
35+
dxfeed_c = ('dxfeed_c', dxfeed_c_lib_args)
36+
37+
extensions = [Extension('dxfeed.core.utils.helpers', ['dxfeed/core/utils/helpers.' + ext],
38+
include_dirs=include_dirs),
39+
Extension('dxfeed.core.listeners.listener', ['dxfeed/core/listeners/listener.' + ext],
40+
include_dirs=include_dirs),
41+
Extension('dxfeed.core.DXFeedPy', ['dxfeed/core/DXFeedPy.' + ext_pp], libraries=libs,
42+
include_dirs=include_dirs)]
3343

3444
if use_cython:
3545
extensions = cythonize(extensions, language_level=3)
@@ -41,8 +51,7 @@ def build(setup_kwargs):
4151
'zip_safe': False,
4252
'libraries': [dxfeed_c],
4353
'packages': find_packages(),
44-
'include_dirs': ['dxfeed/dxfeed-c-api/include',
45-
'dxfeed/dxfeed-c-api/src'],
54+
'include_dirs': include_dirs,
4655
})
4756

4857
def build_extensions():

docs/installation.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ Installation
1010
1111
pip3 install pandas
1212
13-
The easiest way to install dxfeed is to use pip
13+
Install package itself with PyPI
1414

1515
.. code-block:: bash
1616
1717
pip3 install dxfeed
1818
19-
.. warning::
20-
Package is not available on MacOS for now

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ readme = "README.md"
99
classifiers = ["Development Status :: 4 - Beta",
1010
"Operating System :: Microsoft :: Windows",
1111
"Operating System :: POSIX :: Linux",
12+
"Operating System :: MacOS",
1213
"Programming Language :: Cython",
1314
"Programming Language :: Python :: 3 :: Only",
1415
"Topic :: Office/Business :: Financial",
@@ -24,7 +25,7 @@ exclude = ["dxfeed/dxfeed-c-api/wrappers*",
2425
"dxfeed/dxfeed-c-api/.github*"]
2526

2627
[tool.poetry.urls]
27-
"Repository" = "https://github.com/dxFeed/dxfeed-python-api"
28+
"Source code" = "https://github.com/dxFeed/dxfeed-python-api"
2829
"Documentation" = "https://docs.dxfeed.com/python/index.html"
2930

3031
[tool.poetry.dependencies]
@@ -41,7 +42,7 @@ sphinx_rtd_theme = "^0.4.3"
4142

4243

4344
[tool.taskipy.tasks]
44-
clear = "find dxfeed/core/* -type f ( -name '*.c*' -or -name '*.pyd' ) -delete"
45+
clear = "find dxfeed/core -type f \\( -iname \\*.c -o -iname \\*.cpp -o -iname \\*.pyd -o -iname \\*.so \\) -delete"
4546
build = "python build.py && poetry build"
4647
html_docs = "make html -C docs"
4748
test = "pytest tests"

tests/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import sys
2+
from pathlib import Path
3+
sys.path.append(str(Path(__file__).parents[1]))
14
from build import build_extensions
25

36

0 commit comments

Comments
 (0)