Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
96a1cc3
add option to reduce front-end metadata for untracked flags
eli-darkly Oct 5, 2018
e59a1c7
Merge pull request #76 from launchdarkly/eb/ch24449/less-metadata
eli-darkly Oct 5, 2018
89056fc
fix logic for whether a flag is tracked in all_flags_state
eli-darkly Oct 8, 2018
1fc23e4
use expiringdict from PyPi
eli-darkly Oct 14, 2018
0a30e0d
Merge pull request #77 from launchdarkly/eb/ch24449/less-metadata-2
eli-darkly Oct 15, 2018
103b339
Merge pull request #78 from launchdarkly/eb/ch25286/expiring-dict
eli-darkly Oct 15, 2018
40f2ca4
merge from public after release
LaunchDarklyCI Oct 17, 2018
ae8b25e
implement file data source, not including auto-update
eli-darkly Nov 1, 2018
850837d
rm debugging
eli-darkly Nov 1, 2018
aa7684a
rm debugging
eli-darkly Nov 1, 2018
39c9042
Python 3 compatibility fix
eli-darkly Nov 1, 2018
a43bf0c
add file watching, update documentation and tests
eli-darkly Nov 2, 2018
2cea730
readme
eli-darkly Nov 2, 2018
dcf1afe
debugging
eli-darkly Nov 2, 2018
4e98fdd
debugging
eli-darkly Nov 2, 2018
8f3c221
debugging
eli-darkly Nov 2, 2018
84276dd
fix cleanup logic
eli-darkly Nov 2, 2018
2a822e6
rm debugging
eli-darkly Nov 2, 2018
eaabe4d
Merge pull request #79 from launchdarkly/eb/ch26233/file-data-source
eli-darkly Nov 14, 2018
ac5e8de
typo in comment
eli-darkly Nov 14, 2018
39f5f62
merge from public after release
LaunchDarklyCI Nov 14, 2018
040ced9
add feature store wrapper class and make Redis feature store use it
eli-darkly Dec 29, 2018
59a67a8
test the new Redis factory method
eli-darkly Dec 29, 2018
1e38ac1
add DynamoDB support
eli-darkly Dec 29, 2018
431dddf
add test credentials
eli-darkly Dec 29, 2018
3aa5644
link in comment
eli-darkly Dec 31, 2018
bd00276
comment
eli-darkly Dec 31, 2018
11eabd3
Merge branch 'eb/ch28329/feature-store-support' into eb/ch28329/dynamodb
eli-darkly Dec 31, 2018
534ec5d
don't catch exceptions in Redis feature store, let the client catch them
eli-darkly Dec 31, 2018
5f16c8d
gitignore
eli-darkly Dec 31, 2018
ac0f2ea
misc test fixes
eli-darkly Dec 31, 2018
fa56526
Merge branch 'eb/ch28329/feature-store-support' into eb/ch28329/dynamodb
eli-darkly Dec 31, 2018
3a1c2dc
Merge pull request #81 from launchdarkly/eb/ch28329/dynamodb
eli-darkly Jan 9, 2019
b06eef9
Merge pull request #80 from launchdarkly/eb/ch28329/feature-store-sup…
eli-darkly Jan 9, 2019
256b6fb
implement dependency ordering for feature store data
eli-darkly Jan 9, 2019
289077c
fix incomplete implementation & test
eli-darkly Jan 9, 2019
2c59294
Python 3.x fix
eli-darkly Jan 9, 2019
1dd6961
Merge pull request #82 from launchdarkly/eb/ch29197/dependency-order
eli-darkly Jan 15, 2019
78b6118
minor doc fixes
eli-darkly Jan 16, 2019
931d008
merge from public after release
LaunchDarklyCI Jan 16, 2019
3eb821c
feature store test improvements
eli-darkly Jan 18, 2019
cc938e3
better database prefix test
eli-darkly Jan 19, 2019
5b8b337
clarify comment
eli-darkly Jan 19, 2019
b911d9e
Merge pull request #83 from launchdarkly/eb/feature-store-tests
eli-darkly Jan 19, 2019
f9ce243
add Consul feature store integration
eli-darkly Jan 19, 2019
89a96be
typo
eli-darkly Jan 19, 2019
da8c1a6
rm extra import
eli-darkly Jan 19, 2019
b19e618
fix byte/string issue and rename file
eli-darkly Jan 19, 2019
db621dc
rename file
eli-darkly Jan 19, 2019
b09e07e
docs
eli-darkly Jan 19, 2019
9ea89ca
script typo
eli-darkly Jan 19, 2019
a50e6f3
move all low-level feature store integration code into submodules
eli-darkly Jan 19, 2019
68c55b4
Merge pull request #84 from launchdarkly/eb/ch28431/consul
eli-darkly Jan 26, 2019
0baddab
move file data source implementation
eli-darkly Jan 28, 2019
c8585ba
don't need future.with_statement in Python 2.6+
eli-darkly Jan 28, 2019
2a6d53b
don't need future.absolute_import in Python 2.6+
eli-darkly Jan 28, 2019
c32793a
don't need future.print_function when you're printing a single string…
eli-darkly Jan 28, 2019
4971d17
don't need future.division since we're not using the / operator
eli-darkly Jan 28, 2019
0abadf1
rm unused dependency
eli-darkly Jan 28, 2019
e228e90
Revert "rm unused dependency"
eli-darkly Jan 28, 2019
122d7a6
don't need builtins.object unless we're defining an iterator, and eve…
eli-darkly Jan 29, 2019
6a45e70
update docs with note on portability
eli-darkly Jan 29, 2019
858e001
typo
eli-darkly Jan 29, 2019
6788526
Merge pull request #86 from launchdarkly/eb/ch30683/future
eli-darkly Jan 29, 2019
5657142
Merge pull request #85 from launchdarkly/eb/move-modules
eli-darkly Jan 31, 2019
d4d4b8a
update package metadata prior to release
eli-darkly Jan 31, 2019
7a6db77
Merge pull request #87 from launchdarkly/eb/ch30988/setup-py
eli-darkly Jan 31, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ test-template: &test-template
command: |
sudo pip install --upgrade pip setuptools;
sudo pip install -r test-requirements.txt;
if [[ "$CIRCLE_JOB" != "test-3.3" ]] && [[ "$CIRCLE_JOB" != "test-3.4" ]]; then
sudo pip install -r consul-requirements.txt;
fi;
sudo python setup.py install;
pip freeze
- run:
name: run tests
command: |
mkdir test-reports;
if [[ $CIRCLE_JOB == test-2.7 ]]; then
if [[ "$CIRCLE_JOB" == "test-2.7" ]]; then
pytest -s --cov=ldclient --junitxml=test-reports/junit.xml testing;
sh -c '[ -n "${CODECLIMATE_REPO_TOKEN+1}" ] && codeclimate-test-reporter || echo "No CODECLIMATE_REPO_TOKEN value is set; not publishing coverage report"';
else
Expand All @@ -41,33 +44,39 @@ jobs:
- image: circleci/python:2.7-jessie
- image: redis
- image: amazon/dynamodb-local
- image: consul
test-3.3:
<<: *test-template
docker:
- image: circleci/python:3.3-jessie
- image: redis
- image: amazon/dynamodb-local
# python-consul doesn't support Python 3.3
test-3.4:
<<: *test-template
docker:
- image: circleci/python:3.4-jessie
- image: redis
- image: amazon/dynamodb-local
# python-consul doesn't support Python 3.4
test-3.5:
<<: *test-template
docker:
- image: circleci/python:3.5-jessie
- image: redis
- image: amazon/dynamodb-local
- image: consul
test-3.6:
<<: *test-template
docker:
- image: circleci/python:3.6-jessie
- image: redis
- image: amazon/dynamodb-local
- image: consul
test-3.7:
<<: *test-template
docker:
- image: circleci/python:3.7-stretch
- image: redis
- image: amazon/dynamodb-local
- image: consul
12 changes: 8 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Development information (for developing this module itself)

1. One-time setup:

mkvirtualenv python-client
mkvirtualenv python-client

1. When working on the project be sure to activate the python-client virtualenv using the technique of your choosing.

Expand All @@ -17,13 +17,17 @@ Development information (for developing this module itself)
pip install -r requirements.txt
pip install -r test-requirements.txt

1. Run tests: You'll need redis running locally on its default port of 6379.
1. When running unit tests, in order for `test_feature_store.py` to run, you'll need all of the supported databases (Redis, Consul, DynamoDB) running locally on their default ports.

1. If you want integration tests to run, set the ```LD_SDK_KEY``` environment variable to a valid production SDK Key.

1. ```$ py.test testing```

Developing with different python versions
1. All code must be compatible with all supported Python versions as described in README. Most portability issues are addressed by using the `six` package. We are avoiding the use of `__future__` imports, since they can easily be omitted by mistake causing code in one file to behave differently from another; instead, whenever possible, use an explicit approach that makes it clear what the desired behavior is in all Python versions (e.g. if you want to do floor division, use `//`; if you want to divide as floats, explicitly cast to floats).

Developing with different Python versions
-----------------------------------------

Example for switching to python 3:
Example for switching to Python 3:

```virtualenv -p `which python3` ~/.virtualenvs/python-client```
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ The SDK is tested with the most recent patch releases of Python 2.7, 3.3, 3.4, 3
Database integrations
---------------------

Feature flag data can be kept in a persistent store using Redis or DynamoDB. These adapters are implemented in the `DynamoDB` and `Redis` classes in `ldclient.integrations`; to use them, call the `new_feature_store` method in the appropriate class, and put the returned object in the `feature_store` property of your client configuration. See [`ldclient.integrations`](https://github.com/launchdarkly/python-client-private/blob/master/ldclient/integrations.py) and the [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store) for more information.
Feature flag data can be kept in a persistent store using Consul, DynamoDB, or Redis. These adapters are implemented in the `Consul`, `DynamoDB` and `Redis` classes in `ldclient.integrations`; to use them, call the `new_feature_store` method in the appropriate class, and put the returned object in the `feature_store` property of your client configuration. See [`ldclient.integrations`](https://github.com/launchdarkly/python-client-private/blob/master/ldclient/integrations.py) and the [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store) for more information.

Note that Consul is not supported in Python 3.3 or 3.4.

Using flag data from a file
---------------------------
Expand Down
1 change: 1 addition & 0 deletions consul-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-consul>=1.0.1
2 changes: 0 additions & 2 deletions demo/demo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import logging
import sys

Expand Down
4 changes: 0 additions & 4 deletions ldclient/client.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
from __future__ import division, with_statement, absolute_import

import hashlib
import hmac
import threading
import traceback

from builtins import object

from ldclient.config import Config as Config
from ldclient.event_processor import NullEventProcessor
from ldclient.feature_requester import FeatureRequesterImpl
Expand Down
2 changes: 0 additions & 2 deletions ldclient/event_processor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

from collections import namedtuple
from email.utils import parsedate
import errno
Expand Down
2 changes: 0 additions & 2 deletions ldclient/feature_requester.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

from collections import namedtuple
import json
import urllib3
Expand Down
Loading