Skip to content

Commit e12d62f

Browse files
authored
prepare 6.8.0 release (#104)
1 parent 250deac commit e12d62f

30 files changed

+692
-389
lines changed

.circleci/config.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ test-template: &test-template
1717
command: |
1818
sudo pip install --upgrade pip setuptools;
1919
sudo pip install -r test-requirements.txt;
20+
if [[ "$CIRCLE_JOB" != "test-3.3" ]] && [[ "$CIRCLE_JOB" != "test-3.4" ]]; then
21+
sudo pip install -r consul-requirements.txt;
22+
fi;
2023
sudo python setup.py install;
2124
pip freeze
2225
- run:
2326
name: run tests
2427
command: |
2528
mkdir test-reports;
26-
if [[ $CIRCLE_JOB == test-2.7 ]]; then
29+
if [[ "$CIRCLE_JOB" == "test-2.7" ]]; then
2730
pytest -s --cov=ldclient --junitxml=test-reports/junit.xml testing;
2831
sh -c '[ -n "${CODECLIMATE_REPO_TOKEN+1}" ] && codeclimate-test-reporter || echo "No CODECLIMATE_REPO_TOKEN value is set; not publishing coverage report"';
2932
else
@@ -41,33 +44,39 @@ jobs:
4144
- image: circleci/python:2.7-jessie
4245
- image: redis
4346
- image: amazon/dynamodb-local
47+
- image: consul
4448
test-3.3:
4549
<<: *test-template
4650
docker:
4751
- image: circleci/python:3.3-jessie
4852
- image: redis
4953
- image: amazon/dynamodb-local
54+
# python-consul doesn't support Python 3.3
5055
test-3.4:
5156
<<: *test-template
5257
docker:
5358
- image: circleci/python:3.4-jessie
5459
- image: redis
5560
- image: amazon/dynamodb-local
61+
# python-consul doesn't support Python 3.4
5662
test-3.5:
5763
<<: *test-template
5864
docker:
5965
- image: circleci/python:3.5-jessie
6066
- image: redis
6167
- image: amazon/dynamodb-local
68+
- image: consul
6269
test-3.6:
6370
<<: *test-template
6471
docker:
6572
- image: circleci/python:3.6-jessie
6673
- image: redis
6774
- image: amazon/dynamodb-local
75+
- image: consul
6876
test-3.7:
6977
<<: *test-template
7078
docker:
7179
- image: circleci/python:3.7-stretch
7280
- image: redis
7381
- image: amazon/dynamodb-local
82+
- image: consul

CONTRIBUTING.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Development information (for developing this module itself)
88

99
1. One-time setup:
1010

11-
mkvirtualenv python-client
11+
mkvirtualenv python-client
1212

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

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

20-
1. Run tests: You'll need redis running locally on its default port of 6379.
20+
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.
21+
2122
1. If you want integration tests to run, set the ```LD_SDK_KEY``` environment variable to a valid production SDK Key.
23+
2224
1. ```$ py.test testing```
2325

24-
Developing with different python versions
26+
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).
27+
28+
Developing with different Python versions
2529
-----------------------------------------
2630

27-
Example for switching to python 3:
31+
Example for switching to Python 3:
2832

2933
```virtualenv -p `which python3` ~/.virtualenvs/python-client```

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ The SDK is tested with the most recent patch releases of Python 2.7, 3.3, 3.4, 3
8181
Database integrations
8282
---------------------
8383

84-
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.
84+
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.
85+
86+
Note that Consul is not supported in Python 3.3 or 3.4.
8587

8688
Using flag data from a file
8789
---------------------------

consul-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-consul>=1.0.1

demo/demo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function
2-
31
import logging
42
import sys
53

ldclient/client.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
from __future__ import division, with_statement, absolute_import
2-
31
import hashlib
42
import hmac
53
import threading
64
import traceback
75

8-
from builtins import object
9-
106
from ldclient.config import Config as Config
117
from ldclient.event_processor import NullEventProcessor
128
from ldclient.feature_requester import FeatureRequesterImpl

ldclient/event_processor.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import
2-
31
from collections import namedtuple
42
from email.utils import parsedate
53
import errno

ldclient/feature_requester.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import
2-
31
from collections import namedtuple
42
import json
53
import urllib3

0 commit comments

Comments
 (0)