Skip to content

Commit 56bbbb0

Browse files
author
Aleksandr Salynskii
authored
Merge pull request #6 from dxFeed/EN-1370-readthedocs
En 1370 readthedocs
2 parents 6bdc3c2 + 4f419ff commit 56bbbb0

15 files changed

+59
-21
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ _build*
1616
*.ipynb_checkpoints*
1717

1818
Pipfile*
19-
dist*
19+
dist*

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "dxfeed/dxfeed-c-api"]
22
path = dxfeed/dxfeed-c-api
3-
url = https://github.com/dxFeed/dxfeed-c-api.git
3+
url = https://github.com/dxFeed/dxfeed-c-api.git

.readthedocs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Required
2+
version: 2
3+
4+
# Build documentation in the docs/ directory with Sphinx
5+
sphinx:
6+
configuration: docs/conf.py
7+
8+
# Optionally build your docs in additional formats such as PDF and ePub
9+
formats: all
10+
11+
# Optionally set the version of Python and requirements required to build your docs
12+
python:
13+
version: 3.7
14+
install:
15+
- method: pip
16+
path: .
17+
extra_requirements:
18+
- docs
19+
20+
submodules:
21+
include: all

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,4 +370,4 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
370370
---------------------------------------------------------
371371

372372
This Source Code Form is "Incompatible With Secondary Licenses", as
373-
defined by the Mozilla Public License, v. 2.0.
373+
defined by the Mozilla Public License, v. 2.0.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# dxfeed package
22

3+
[![Documentation Status](https://readthedocs.org/projects/dxfeed/badge/?version=latest)](https://dxfeed.readthedocs.io/en/latest/?badge=latest)
4+
35
This package provides access to [dxFeed](https://www.dxfeed.com/) streaming data.
46
The library is build as a thin wrapper over [dxFeed C-API library](https://github.com/dxFeed/dxfeed-c-api).
57
We use [Cython](https://cython.org/) in this project as it combines flexibility, reliability and

build.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from setuptools import setup, Extension, find_packages
1+
from setuptools import Extension, find_packages
22
from setuptools.dist import Distribution
33
from pathlib import Path
44
import platform
@@ -14,18 +14,19 @@
1414
ext = ext_pp = 'pyx'
1515

1616
# Get all dxfeed c api c files to be compiled into separate lib
17-
source_files_directory = Path(__file__).resolve().parent.joinpath('dxfeed', 'dxfeed-c-api', 'src')
17+
root_path = Path(__file__).resolve().parent
18+
source_files_directory = root_path / 'dxfeed' / 'dxfeed-c-api' / 'src'
1819
source_files_paths = [str(path) for path in source_files_directory.glob('*.c')]
1920
libs = list()
20-
include_dirs = [str(source_files_directory.parent.joinpath('include')),
21+
include_dirs = [str(source_files_directory.parent / 'include'),
2122
str(source_files_directory)]
22-
### Build dxfeed c library
23+
# Build dxfeed c library
2324
dxfeed_c_lib_args = dict()
2425
if platform.system() == 'Windows':
25-
source_files_paths.remove(str(source_files_directory.joinpath('Linux.c')))
26+
source_files_paths.remove(str(source_files_directory / 'Linux.c'))
2627
libs.append('ws2_32')
2728
else:
28-
source_files_paths.remove(str(source_files_directory.joinpath('Win32.c')))
29+
source_files_paths.remove(str(source_files_directory / 'Win32.c'))
2930
dxfeed_c_lib_args.update({'sources': source_files_paths,
3031
'include_dirs': include_dirs})
3132

@@ -44,14 +45,13 @@
4445
if use_cython:
4546
extensions = cythonize(extensions, language_level=3)
4647

47-
4848
def build(setup_kwargs):
4949
setup_kwargs.update({
5050
'ext_modules': extensions,
5151
'zip_safe': False,
5252
'libraries': [dxfeed_c],
5353
'packages': find_packages(),
54-
'include_dirs': include_dirs,
54+
'include_dirs': include_dirs
5555
})
5656

5757
def build_extensions():

docs/_static/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
}
1010
.current.reference.internal {
1111
font-weight: bold;
12-
}
12+
}

docs/_static/custom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
$(document).ready(function () {
22
$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');
3-
});
3+
});

docs/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Utils functions
1818
:inherited-members:
1919

2020
.. automodule:: dxfeed.core.utils.data_class
21-
:members:
21+
:members:

docs/basic_usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ Same with connection:
8282

8383
.. code-block:: python
8484
85-
dx.dxf_close_connection(con)
85+
dx.dxf_close_connection(con)

docs/custom_listener.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ After some time you will get the data.
143143
144144
.. code:: ipython3
145145
146-
dx.dxf_detach_listener(sub)
146+
dx.dxf_detach_listener(sub)

docs/devs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ Documentation
5757
task html_docs
5858
5959
The upper command starts sphinx documentation building. The files can be found in
60-
`docs/_build/html` folder. Automatically zip archive is created in `docs/_build/` folder.
60+
`docs/_build/html` folder. Automatically zip archive is created in `docs/_build/` folder.

docs/installation.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ Install package itself with PyPI
1515
.. code-block:: bash
1616
1717
pip3 install dxfeed
18-

pyproject.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ exclude = ["dxfeed/dxfeed-c-api/wrappers*",
2626

2727
[tool.poetry.urls]
2828
"Source code" = "https://github.com/dxFeed/dxfeed-python-api"
29-
"Documentation" = "https://docs.dxfeed.com/python/index.html"
29+
"Documentation" = "https://dxfeed.readthedocs.io/en/latest/"
3030

3131
[tool.poetry.dependencies]
3232
python = "^3.6"
3333
pandas = "^0.25.1"
34+
# The following dependencies are used for docs generation when installed as extras
35+
# (e.g. pip install nornir[docs])
36+
# Currently they have to be specified as non-dev dependencies with optional = true
37+
# Refer to: https://github.com/sdispater/poetry/issues/129
38+
# Issue to watch for: https://github.com/python-poetry/poetry/issues/1644
39+
toml = { version = "^0.10.0", optional = true }
3440

3541
[tool.poetry.dev-dependencies]
3642
cython = "^0.29.13"
@@ -40,6 +46,8 @@ sphinx = "^2.4.4"
4046
toml = "^0.10.0"
4147
sphinx_rtd_theme = "^0.4.3"
4248

49+
[tool.poetry.extras]
50+
docs = ["toml"]
4351

4452
[tool.taskipy.tasks]
4553
clear = "find dxfeed/core -type f \\( -iname \\*.c -o -iname \\*.cpp -o -iname \\*.pyd -o -iname \\*.so \\) -delete"
@@ -49,7 +57,6 @@ test = "pytest tests"
4957
post_build = "task clear"
5058
post_test = "task clear"
5159

52-
5360
[build-system]
5461
requires = ["poetry>=0.12", "cython"]
55-
build-backend = "poetry.masonry.api"
62+
build-backend = "poetry.masonry.api"

setup.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from setuptools import setup
2+
from build import *
3+
4+
global setup_kwargs
5+
6+
setup_kwargs = {}
7+
8+
build(setup_kwargs)
9+
setup(**setup_kwargs)

0 commit comments

Comments
 (0)