Skip to content

Commit

Permalink
Merge pull request #330 from splitio/development
Browse files Browse the repository at this point in the history
Development to master
  • Loading branch information
Israphel committed Apr 4, 2023
2 parents 3dc14ca + 14d83c6 commit 749923a
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 24 deletions.
31 changes: 31 additions & 0 deletions .coveragerc
@@ -0,0 +1,31 @@
[run]
source =
splitio/

omit =
tests/*
*/__init__.py

branch = True

relative_files = True

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

precision = 2
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Expand Up @@ -4,4 +4,4 @@

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

## Extra Notes
## Extra Notes
31 changes: 17 additions & 14 deletions .github/workflows/ci.yml
Expand Up @@ -3,13 +3,19 @@ on:
push:
branches:
- master
- development
pull_request:
branches:
- master
- development

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
test:
name: Test
runs-on: ubuntu-20.04
services:
redis:
Expand All @@ -22,48 +28,45 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.6'

- name: Install dependencies
run: |
pip install -U setuptools pip
pip install -U setuptools pip wheel
pip install -e .[cpphash,redis,uwsgi]
- name: Run tests
run: python setup.py test

- name: Set VERSION env
run: echo "VERSION=$(cat splitio/version.py | grep "__version__" | awk -F\' '{print $2}')" >> $GITHUB_ENV

- name: SonarQube Scan (Push)
if: github.event_name == 'push'
uses: SonarSource/sonarcloud-github-action@v1.5
uses: SonarSource/sonarcloud-github-action@v1.9
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.projectName=${{ github.event.repository.name }}
-Dsonar.projectKey=${{ github.event.repository.name }}
-Dsonar.python.coverage.reportPaths=coverage.xml
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
-Dsonar.projectVersion=${{ env.VERSION }}
- name: SonarQube Scan (Pull Request)
if: github.event_name == 'pull_request'
uses: SonarSource/sonarcloud-github-action@v1.5
uses: SonarSource/sonarcloud-github-action@v1.9
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.projectName=${{ github.event.repository.name }}
-Dsonar.projectKey=${{ github.event.repository.name }}
-Dsonar.python.coverage.reportPaths=coverage.xml
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
-Dsonar.projectVersion=${{ env.VERSION }}
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
4 changes: 2 additions & 2 deletions .github/workflows/update-license-year.yml
Expand Up @@ -16,10 +16,10 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set Current year
run: "echo CURRENT=$(date +%Y) >> $GITHUB_ENV"

- name: Set Previous Year
run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV"

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -72,4 +72,7 @@ target/
# vim backup files
*.swp

.DS_Store
.DS_Store

# Sonarqube
.scannerwork
2 changes: 1 addition & 1 deletion CONTRIBUTORS-GUIDE.md
Expand Up @@ -28,4 +28,4 @@ To run test you need to execute the following commands:

# Contact

If you have any other questions or need to contact us directly in a private manner send us a note at sdks@split.io.
If you have any other questions or need to contact us directly in a private manner send us a note at sdks@split.io.
6 changes: 3 additions & 3 deletions README.md
@@ -1,5 +1,5 @@
# Split Python SDK
[![Build Status](https://api.travis-ci.com/splitio/python-client.svg?branch=master)](https://api.travis-ci.com/splitio/python-client)
# Split Python SDK
![Build Status](https://github.com/splitio/python-client/actions/workflows/ci.yml/badge.svg?branch=master)

## Overview
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.
Expand All @@ -23,7 +23,7 @@ try:
factory.block_until_ready(5) # wait up to 5 seconds
split = factory.client()
treatment = split.get_treatment('CUSTOMER_ID', 'SPLIT_NAME')
if treatment == "on":
if treatment == "on":
# insert code here to show on treatment
elif treatment == "off":
# insert code here to show off treatment
Expand Down
2 changes: 1 addition & 1 deletion doc/source/flask_support.rst
Expand Up @@ -37,4 +37,4 @@ This example assumes that the Split.io configuration is save in a file called ``

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

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`.)
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`.)
1 change: 0 additions & 1 deletion doc/source/index.rst
Expand Up @@ -20,4 +20,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

10 changes: 10 additions & 0 deletions sonar-project.properties
@@ -0,0 +1,10 @@
sonar.projectName=python-client
sonar.projectKey=python-client
sonar.python.version=3.6
sonar.sources=splitio
sonar.tests=tests
sonar.text.excluded.file.suffixes=.csv
sonar.python.coverage.reportPaths=coverage.xml
sonar.coverage.exclusions=**/__init__.py
sonar.links.ci=https://github.com/splitio/python-client
sonar.links.scm=https://github.com/splitio/python-client/actions

0 comments on commit 749923a

Please sign in to comment.