Skip to content

Commit 8784a4c

Browse files
committed
Merge branch 'development' of github.com:splitio/python-client into development
2 parents ddb8c6c + 14064fc commit 8784a4c

File tree

93 files changed

+8219
-1684
lines changed

Some content is hidden

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

93 files changed

+8219
-1684
lines changed

.coveragerc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[run]
2+
source =
3+
splitio/
4+
5+
omit =
6+
tests/*
7+
*/__init__.py
8+
9+
branch = True
10+
11+
relative_files = True
12+
13+
[report]
14+
# Regexes for lines to exclude from consideration
15+
exclude_lines =
16+
# Have to re-enable the standard pragma
17+
pragma: no cover
18+
19+
# Don't complain about missing debug-only code:
20+
def __repr__
21+
if self\.debug
22+
23+
# Don't complain if tests don't hit defensive assertion code:
24+
raise AssertionError
25+
raise NotImplementedError
26+
27+
# Don't complain if non-runnable code isn't run:
28+
if 0:
29+
if __name__ == .__main__.:
30+
31+
precision = 2

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @splitio/sdk

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
## How do we test the changes introduced in this PR?
66

7-
## Extra Notes
7+
## Extra Notes

.github/workflows/ci.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ on:
33
push:
44
branches:
55
- master
6+
- development
67
pull_request:
78
branches:
89
- master
910
- development
1011

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
14+
cancel-in-progress: true
15+
1116
jobs:
1217
test:
18+
name: Test
1319
runs-on: ubuntu-20.04
1420
services:
1521
redis:
@@ -22,48 +28,45 @@ jobs:
2228
with:
2329
fetch-depth: 0
2430

25-
- name: Set up Python
31+
- name: Setup Python
2632
uses: actions/setup-python@v3
2733
with:
2834
python-version: '3.6'
2935

3036
- name: Install dependencies
3137
run: |
32-
pip install -U setuptools pip
38+
pip install -U setuptools pip wheel
3339
pip install -e .[cpphash,redis,uwsgi]
3440
3541
- name: Run tests
3642
run: python setup.py test
3743

44+
- name: Set VERSION env
45+
run: echo "VERSION=$(cat splitio/version.py | grep "__version__" | awk -F\' '{print $2}')" >> $GITHUB_ENV
46+
3847
- name: SonarQube Scan (Push)
3948
if: github.event_name == 'push'
40-
uses: SonarSource/sonarcloud-github-action@v1.5
49+
uses: SonarSource/sonarcloud-github-action@v1.9
4150
env:
4251
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4353
with:
4454
projectBaseDir: .
4555
args: >
4656
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
47-
-Dsonar.projectName=${{ github.event.repository.name }}
48-
-Dsonar.projectKey=${{ github.event.repository.name }}
49-
-Dsonar.python.coverage.reportPaths=coverage.xml
50-
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
51-
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
57+
-Dsonar.projectVersion=${{ env.VERSION }}
5258
5359
- name: SonarQube Scan (Pull Request)
5460
if: github.event_name == 'pull_request'
55-
uses: SonarSource/sonarcloud-github-action@v1.5
61+
uses: SonarSource/sonarcloud-github-action@v1.9
5662
env:
5763
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5865
with:
5966
projectBaseDir: .
6067
args: >
6168
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
62-
-Dsonar.projectName=${{ github.event.repository.name }}
63-
-Dsonar.projectKey=${{ github.event.repository.name }}
64-
-Dsonar.python.coverage.reportPaths=coverage.xml
65-
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
66-
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
69+
-Dsonar.projectVersion=${{ env.VERSION }}
6770
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
6871
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
6972
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}

.github/workflows/update-license-year.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
19-
19+
2020
- name: Set Current year
2121
run: "echo CURRENT=$(date +%Y) >> $GITHUB_ENV"
22-
22+
2323
- name: Set Previous Year
2424
run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV"
2525

2626
- name: Update LICENSE
27-
uses: jacobtomlinson/gha-find-replace@v2
27+
uses: jacobtomlinson/gha-find-replace@v3
2828
with:
2929
find: ${{ env.PREVIOUS }}
3030
replace: ${{ env.CURRENT }}
@@ -38,7 +38,7 @@ jobs:
3838
git commit -m "Updated License Year" -a
3939
4040
- name: Create Pull Request
41-
uses: peter-evans/create-pull-request@v3
41+
uses: peter-evans/create-pull-request@v5
4242
with:
4343
token: ${{ secrets.GITHUB_TOKEN }}
4444
title: Update License Year

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,7 @@ target/
7272
# vim backup files
7373
*.swp
7474

75-
.DS_Store
75+
.DS_Store
76+
77+
# Sonarqube
78+
.scannerwork

CHANGES.txt

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,40 @@
1-
9.3.0-rc1 (Jan 20, 2023)
1+
9.6.2 (Apr 5, 2024)
2+
- Fixed an issue when pushing unique keys tracker data to redis if no keys exist, i.e. get_treatment flavors are not called.
3+
4+
9.6.1 (Feb 15, 2024)
5+
- Added redisUsername configuration parameter for Redis connection to set the username for accessing redis when not using the default `root` username
6+
7+
9.6.0 (Nov 3, 2023)
8+
- Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation):
9+
- Added new variations of the get treatment methods to support evaluating flags in given flag set/s.
10+
- get_treatments_by_flag_set and get_treatments_by_flag_sets
11+
- get_treatments_with_config_by_flag_set and get_treatments_with_config_by_flag_sets
12+
- Added a new optional Split Filter configuration option. This allows the SDK and Split services to only synchronize the flags in the specified flag sets, avoiding unused or unwanted flags from being synced on the SDK instance, bringing all the benefits from a reduced payload.
13+
- Note: Only applicable when the SDK is in charge of the rollout data synchronization. When not applicable, the SDK will log a warning on init.
14+
- Updated the following SDK manager methods to expose flag sets on flag views.
15+
- Removed raising an exception when Telemetry post config data fails, SDK will only log the error.
16+
17+
9.5.1 (Sep 5, 2023)
18+
- Exclude tests from when building the package
19+
- Fixed exception when fetching telemetry stats if no SSE Feature flags update events are stored
20+
21+
9.5.0 (Jul 18, 2023)
22+
- Improved streaming architecture implementation to apply feature flag updates from the notification received which is now enhanced, improving efficiency and reliability of the whole update system.
23+
24+
9.4.2 (May 15, 2023)
25+
- Updated terminology on the SDKs codebase to be more aligned with current standard without causing a breaking change. The core change is the term split for feature flag on things like logs and code documentation comments.
26+
- Added detailed debug logging for redis adapter.
27+
- Fixed setting defaultTreatment to 'control' if it is missing in localhost JSON file.
28+
29+
9.4.1 (Apr 18, 2023)
30+
- Fixed storing incorrect Telemetry method latency data
31+
32+
9.4.0 (Mar 1, 2023)
33+
- Added support to use JSON files in localhost mode.
34+
- Updated default periodic telemetry post time to one hour.
35+
- Fixed unhandeled exception in push.manager.py class when SDK is connected to split proxy
36+
37+
9.3.0 (Jan 30, 2023)
238
- Updated SDK telemetry storage, metrics and updater to be more effective and send less often.
339
- Removed deprecated threading.Thread.setDaemon() method.
440

@@ -95,7 +131,7 @@
95131
7.0.1 (Mar 8, 2019)
96132
- Updated Splits refreshing rate.
97133
- Replaced exception log level to error level.
98-
- Improved validation for apikey.
134+
- Improved validation for sdkkey.
99135

100136
7.0.0 (Feb 21, 2019)
101137
- BREAKING CHANGE: Stored Impressions in Queue.

CONTRIBUTORS-GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ To run test you need to execute the following commands:
2828

2929
# Contact
3030

31-
If you have any other questions or need to contact us directly in a private manner send us a note at sdks@split.io.
31+
If you have any other questions or need to contact us directly in a private manner send us a note at sdks@split.io.

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2023 Split Software, Inc.
1+
Copyright © 2024 Split Software, Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Split Python SDK
2-
[![Build Status](https://api.travis-ci.com/splitio/python-client.svg?branch=master)](https://api.travis-ci.com/splitio/python-client)
1+
# Split Python SDK
2+
![Build Status](https://github.com/splitio/python-client/actions/workflows/ci.yml/badge.svg?branch=master)
33

44
## Overview
55
This SDK is designed to work with Split, the platform for controlled rollouts, which serves features to your users via a Split feature flag to manage your complete customer experience.
@@ -22,8 +22,8 @@ factory = get_factory('YOUR_SDK_TYPE_API_KEY', config=config)
2222
try:
2323
factory.block_until_ready(5) # wait up to 5 seconds
2424
split = factory.client()
25-
treatment = split.get_treatment('CUSTOMER_ID', 'SPLIT_NAME')
26-
if treatment == "on":
25+
treatment = split.get_treatment('CUSTOMER_ID', 'FEATURE_FLAG_NAME')
26+
if treatment == "on":
2727
# insert code here to show on treatment
2828
elif treatment == "off":
2929
# insert code here to show off treatment
@@ -54,16 +54,21 @@ To learn more about Split, contact hello@split.io, or get started with feature f
5454

5555
Split has built and maintains SDKs for:
5656

57+
* .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
58+
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
59+
* Angular [Github](https://github.com/splitio/angular-sdk-plugin) [Docs](https://help.split.io/hc/en-us/articles/6495326064397-Angular-utilities)
60+
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
61+
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
5762
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
58-
* Javascript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
63+
* JavaScript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
64+
* JavaScript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
5965
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
60-
* .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
61-
* Ruby [Github](https://github.com/splitio/ruby-client) [Docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK)
6266
* PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
6367
* Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)
64-
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
65-
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
66-
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
68+
* React [Github](https://github.com/splitio/react-client) [Docs](https://help.split.io/hc/en-us/articles/360038825091-React-SDK)
69+
* React Native [Github](https://github.com/splitio/react-native-client) [Docs](https://help.split.io/hc/en-us/articles/4406066357901-React-Native-SDK)
70+
* Redux [Github](https://github.com/splitio/redux-client) [Docs](https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK)
71+
* Ruby [Github](https://github.com/splitio/ruby-client) [Docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK)
6772

6873
For a comprehensive list of open source projects visit our [Github page](https://github.com/splitio?utf8=%E2%9C%93&query=%20only%3Apublic%20).
6974

0 commit comments

Comments
 (0)