Skip to content

Commit 749923a

Browse files
authored
Merge pull request #330 from splitio/development
Development to master
2 parents 3dc14ca + 14d83c6 commit 749923a

File tree

10 files changed

+70
-24
lines changed

10 files changed

+70
-24
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/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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
uses: actions/checkout@v2
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

.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

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.

README.md

Lines changed: 3 additions & 3 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.
@@ -23,7 +23,7 @@ try:
2323
factory.block_until_ready(5) # wait up to 5 seconds
2424
split = factory.client()
2525
treatment = split.get_treatment('CUSTOMER_ID', 'SPLIT_NAME')
26-
if treatment == "on":
26+
if treatment == "on":
2727
# insert code here to show on treatment
2828
elif treatment == "off":
2929
# insert code here to show off treatment

doc/source/flask_support.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ This example assumes that the Split.io configuration is save in a file called ``
3737

3838
When using the Redis client the update scripts need to be run periodically, otherwise there won't be any data available to the client.
3939

40-
As mentioned before, if the API key is set to ``'localhost'`` a localhost environment client is generated and no connections to Split.io are made as everything is read from ``.split`` file (you can read about this feature in the Localhost Environment section of the :doc:`/introduction`.)
40+
As mentioned before, if the API key is set to ``'localhost'`` a localhost environment client is generated and no connections to Split.io are made as everything is read from ``.split`` file (you can read about this feature in the Localhost Environment section of the :doc:`/introduction`.)

doc/source/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ Indices and tables
2020
* :ref:`genindex`
2121
* :ref:`modindex`
2222
* :ref:`search`
23-

sonar-project.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sonar.projectName=python-client
2+
sonar.projectKey=python-client
3+
sonar.python.version=3.6
4+
sonar.sources=splitio
5+
sonar.tests=tests
6+
sonar.text.excluded.file.suffixes=.csv
7+
sonar.python.coverage.reportPaths=coverage.xml
8+
sonar.coverage.exclusions=**/__init__.py
9+
sonar.links.ci=https://github.com/splitio/python-client
10+
sonar.links.scm=https://github.com/splitio/python-client/actions

0 commit comments

Comments
 (0)