-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af8cc80
commit 0d74e1d
Showing
40 changed files
with
884 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: 2 | ||
|
||
python: | ||
version: 3.5 | ||
install: | ||
- requirements: docs/requirements.txt | ||
- requirements: requirements.txt | ||
|
||
sphinx: | ||
builder: html | ||
configuration: docs/conf.py | ||
fail_on_warning: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
jobs: | ||
- job: build | ||
pool: | ||
vmImage: 'vs2017-win2016' | ||
steps: | ||
- task: PowerShell@2 | ||
displayName: 'Setup Dynamo' | ||
inputs: | ||
targetType: inline | ||
workingDirectory: $(System.DefaultWorkingDirectory) | ||
script: | | ||
iwr -outf dynamo.zip https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip | ||
mkdir dynamo | ||
Expand-Archive -Path dynamo.zip -DestinationPath dynamo | ||
cd dynamo | ||
javaw -D"java.library.path=./DynamoDBLocal_lib" -jar DynamoDBLocal.jar | ||
- task: PowerShell@2 | ||
displayName: 'Setup Consul' | ||
inputs: | ||
targetType: inline | ||
workingDirectory: $(System.DefaultWorkingDirectory) | ||
script: | | ||
iwr -outf consul.zip https://releases.hashicorp.com/consul/1.4.2/consul_1.4.2_windows_amd64.zip | ||
mkdir consul | ||
Expand-Archive -Path consul.zip -DestinationPath consul | ||
cd consul | ||
sc.exe create "Consul" binPath="$(System.DefaultWorkingDirectory)/consul/consul.exe agent -dev" | ||
sc.exe start "Consul" | ||
- task: PowerShell@2 | ||
displayName: 'Setup Redis' | ||
inputs: | ||
targetType: inline | ||
workingDirectory: $(System.DefaultWorkingDirectory) | ||
script: | | ||
iwr -outf redis.zip https://github.com/MicrosoftArchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.zip | ||
mkdir redis | ||
Expand-Archive -Path redis.zip -DestinationPath redis | ||
cd redis | ||
./redis-server --service-install | ||
./redis-server --service-start | ||
- task: PowerShell@2 | ||
displayName: 'Setup SDK and Test' | ||
inputs: | ||
targetType: inline | ||
workingDirectory: $(System.DefaultWorkingDirectory) | ||
script: | | ||
python --version | ||
pip install -r test-requirements.txt | ||
pip install -r consul-requirements.txt | ||
python setup.py install | ||
mkdir test-reports | ||
pytest -s --junitxml=test-reports/junit.xml testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
.PHONY: help install html | ||
|
||
SPHINXOPTS = | ||
SPHINXBUILD = sphinx-build | ||
SPHINXPROJ = ldclient-py | ||
SOURCEDIR = . | ||
BUILDDIR = build | ||
|
||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
install: | ||
pip install -r requirements.txt | ||
|
||
html: install | ||
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# How the Python SDK documentation works | ||
|
||
The generated API documentation is built with [Sphinx](http://www.sphinx-doc.org/en/master/), and is hosted on [Read the Docs](https://readthedocs.org/). | ||
|
||
It uses the following: | ||
|
||
* Docstrings within the code. Docstrings can use any of the markup supported by Sphinx. | ||
* The `.rst` files in the `docs` directory. These provide the overall page structure. | ||
* The `conf.py` file containing Sphinx settings. | ||
|
||
## What to document | ||
|
||
Every public class, method, and module should have a docstring. Classes and methods with no docstring will not be included in the API docs. | ||
|
||
"Public" here means things that we want third-party developers to use. The SDK also contains many modules and classes that are not actually private (i.e. they aren't prefixed with `_`), but are for internal use only and aren't supported for any other use (we would like to reduce the amount of these in future). | ||
|
||
To add an undocumented class or method in an existing module to the docs, just give it a docstring. | ||
|
||
To add a new module to the docs, give it a docstring and then add a link to it in the appropriate `api-*.rst` file, in the same format as the existing links. | ||
|
||
## Undocumented things | ||
|
||
Modules that contain only implementation details are omitted from the docs by simply not including links to them in the `.rst` files. | ||
|
||
Internal classes in a documented module will be omitted from the docs if they do not have any docstrings, unless they inherit from another class that has docstrings. In the latter case, the way to omit them from the docs is to edit the `.rst` file that contains the link to that module, and add a `:members:` directive under the module that specifically lists all the classes that _should_ be shown. | ||
|
||
## Testing | ||
|
||
In the `docs` directory, run `make html` to build all the docs. Then view `docs/build/html/index.html`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Extending the SDK | ||
================= | ||
|
||
ldclient.interfaces module | ||
-------------------------- | ||
|
||
.. automodule:: ldclient.interfaces | ||
:members: | ||
:special-members: __init__ | ||
:show-inheritance: | ||
|
||
ldclient.feature_store_helpers module | ||
------------------------------------- | ||
|
||
.. automodule:: ldclient.feature_store_helpers | ||
:members: | ||
:special-members: __init__ | ||
:show-inheritance: | ||
|
||
ldclient.versioned_data_kind module | ||
----------------------------------- | ||
|
||
.. automodule:: ldclient.versioned_data_kind | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Integrating with other services | ||
=============================== | ||
|
||
ldclient.integrations module | ||
---------------------------- | ||
|
||
.. automodule:: ldclient.integrations | ||
:members: | ||
:special-members: __init__ | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Core API | ||
======== | ||
|
||
ldclient module | ||
--------------- | ||
|
||
.. automodule:: ldclient | ||
:members: get,set_config,set_sdk_key | ||
:show-inheritance: | ||
|
||
ldclient.client module | ||
---------------------- | ||
|
||
.. automodule:: ldclient.client | ||
:members: LDClient | ||
:special-members: __init__ | ||
:show-inheritance: | ||
|
||
ldclient.config module | ||
---------------------- | ||
|
||
.. automodule:: ldclient.config | ||
:members: | ||
:special-members: __init__ | ||
:show-inheritance: | ||
|
||
ldclient.flag module | ||
-------------------- | ||
|
||
.. automodule:: ldclient.flag | ||
:members: EvaluationDetail | ||
:special-members: __init__ | ||
:show-inheritance: | ||
|
||
ldclient.flags_state module | ||
--------------------------- | ||
|
||
.. automodule:: ldclient.flags_state | ||
:members: | ||
:show-inheritance: |
Oops, something went wrong.