Skip to content

Commit 94bb63e

Browse files
Preparing for 2.0.1 (#130)
1 parent decbc7b commit 94bb63e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+246
-209
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ dist
1515
.idea/
1616
.virt/
1717
datafile.json
18+
19+
# OSX folder metadata
20+
*.DS_Store

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ python:
88
- "pypy3"
99
install: "pip install -r requirements/core.txt;pip install -r requirements/test.txt"
1010
before_script: "pep8"
11+
addons:
12+
srcclr: true
1113
script: "nosetests --with-coverage --cover-package=optimizely"
1214
after_success:
1315
- coveralls

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.0.1
2+
June 19th, 2018
3+
4+
- Fix: send impression event for Feature Test when Feature is disabled ([#128](https://github.com/optimizely/python-sdk/pull/128)).
5+
16
## 2.0.0
27
April 12th, 2018
38

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
include LICENSE
2-
include CHANGELOG
2+
include CHANGELOG.md
3+
include README.md
34
include requirements/*
45
recursive-exclude tests *

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Optimizely Python SDK
2+
[![PyPI version](https://badge.fury.io/py/optimizely-sdk.svg)](https://pypi.org/project/optimizely-sdk)
23
[![Build Status](https://travis-ci.org/optimizely/python-sdk.svg?branch=master)](https://travis-ci.org/optimizely/python-sdk)
34
[![Coverage Status](https://coveralls.io/repos/github/optimizely/python-sdk/badge.svg)](https://coveralls.io/github/optimizely/python-sdk)
4-
[![Apache 2.0](https://img.shields.io/github/license/nebula-plugins/gradle-extra-configurations-plugin.svg)](http://www.apache.org/licenses/LICENSE-2.0)
5+
[![Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
56

67
This repository houses the Python SDK for Optimizely Full Stack.
78

optimizely/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/bucketer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/decision_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/entities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/error_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/event_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/event_dispatcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/helpers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/helpers/audience.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/helpers/condition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/helpers/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/helpers/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/helpers/event_tag_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/helpers/experiment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/helpers/validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/lib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/notification_center.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/optimizely.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -387,16 +387,20 @@ def is_feature_enabled(self, feature_key, user_id, attributes=None):
387387
return False
388388

389389
decision = self.decision_service.get_variation_for_feature(feature, user_id, attributes)
390-
if decision.variation and decision.variation.featureEnabled:
391-
self.logger.log(enums.LogLevels.INFO, 'Feature "%s" is enabled for user "%s".' % (feature_key, user_id))
390+
if decision.variation:
392391
# Send event if Decision came from an experiment.
393392
if decision.source == decision_service.DECISION_SOURCE_EXPERIMENT:
394393
self._send_impression_event(decision.experiment,
395394
decision.variation,
396395
user_id,
397396
attributes)
398397

399-
return True
398+
if decision.variation.featureEnabled:
399+
self.logger.log(enums.LogLevels.INFO, 'Feature "%s" is enabled for user "%s".' % (feature_key, user_id))
400+
return True
401+
else:
402+
self.logger.log(enums.LogLevels.INFO, 'Feature "%s" is not enabled for user "%s".' % (feature_key, user_id))
403+
return False
400404

401405
self.logger.log(enums.LogLevels.INFO, 'Feature "%s" is not enabled for user "%s".' % (feature_key, user_id))
402406
return False

optimizely/project_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/user_profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

optimizely/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14-
version_info = (2, 0, 0)
14+
version_info = (2, 0, 1)
1515
__version__ = '.'.join(str(v) for v in version_info)

setup.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,22 @@
1717
TEST_REQUIREMENTS = _file.read().splitlines()
1818
TEST_REQUIREMENTS = list(set(REQUIREMENTS + TEST_REQUIREMENTS))
1919

20+
with open(os.path.join(here, 'README.md')) as _file:
21+
README = _file.read()
22+
23+
with open(os.path.join(here, 'CHANGELOG.md')) as _file:
24+
CHANGELOG = _file.read()
25+
26+
about_text = 'Optimizely X Full Stack is A/B testing and feature management for product development teams. ' \
27+
'Experiment in any application. Make every feature on your roadmap an opportunity to learn. ' \
28+
'Learn more at https://www.optimizely.com/products/full-stack/ or see our documentation at ' \
29+
'https://developers.optimizely.com/x/solutions/sdks/reference/index.html?language=python.'
30+
2031
setup(
2132
name='optimizely-sdk',
2233
version=__version__,
23-
description="SDK for Optimizely's Full Stack Python project.",
34+
description='Python SDK for Optimizely X Full Stack.',
35+
long_description=about_text + '\n\n# Readme: \n' + README + '\n\n# Change Log: \n' + CHANGELOG,
2436
author='Optimizely',
2537
author_email='developers@optimizely.com',
2638
url='https://github.com/optimizely/python-sdk',

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

tests/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

tests/benchmarking/benchmarking_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

tests/benchmarking/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

tests/helpers_tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

tests/helpers_tests/test_audience.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -56,11 +56,13 @@ def test_is_user_in_experiment__no_audience(self):
5656
def test_is_user_in_experiment__no_attributes(self):
5757
""" Test that is_user_in_experiment returns True when experiment is using no audience. """
5858

59-
self.assertFalse(audience.is_user_in_experiment(self.project_config,
60-
self.project_config.get_experiment_from_key('test_experiment'), None))
59+
self.assertFalse(audience.is_user_in_experiment(
60+
self.project_config, self.project_config.get_experiment_from_key('test_experiment'), None)
61+
)
6162

62-
self.assertFalse(audience.is_user_in_experiment(self.project_config,
63-
self.project_config.get_experiment_from_key('test_experiment'), {}))
63+
self.assertFalse(audience.is_user_in_experiment(
64+
self.project_config, self.project_config.get_experiment_from_key('test_experiment'), {})
65+
)
6466

6567
def test_is_user_in_experiment__audience_conditions_are_met(self):
6668
""" Test that is_user_in_experiment returns True when audience conditions are met. """

tests/helpers_tests/test_condition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

tests/helpers_tests/test_event_tag_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You may obtain a copy of the License at
55
#
66
# http://www.apache.org/licenses/LICENSE-2.0
7-
7+
#
88
# Unless required by applicable law or agreed to in writing, software
99
# distributed under the License is distributed on an "AS IS" BASIS,
1010
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

0 commit comments

Comments
 (0)