diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3876caa --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: Build Connect Python SDK + +on: + push: + branches: "*" + tags: + - '*' + + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements/test.txt + pip install -r requirements/sdk.txt + pip install pytest-cov + - name: Linting + run: | + flake8 connect + - name: Testing + run: | + pytest --cov-report=xml --cov=./connect + sed -i "s/version='0.0.0'/version='${TRAVIS_TAG}'/g" setup.py + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true + verbose: true + - name: SonarCloud + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..bfc9fdc --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,47 @@ +name: Deploy Connect Python SDK + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements/test.txt + pip install -r requirements/sdk.txt + pip install pytest-cov + - name: Linting + run: | + flake8 connect + - name: Testing + run: | + pytest --cov-report=xml --cov=./connect + sed -i "s/version='0.0.0'/version='${TRAVIS_TAG}'/g" setup.py + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: true + verbose: true + - name: SonarCloud + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 44d43a6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -dist: trusty - -language: python -matrix: - include: - - os: linux - python: 2.7 - env: BUILD=PYPI - - os: linux - python: 3.5 - - os: linux - python: 3.6 - - os: linux - python: 3.7 - dist: xenial - sudo: true - - os: linux - python: 3.8 - dist: xenial - sudo: true - -install: -- pip install -r requirements/test.txt -- pip install -r requirements/sdk.txt -- pip install pytest-cov - -script: -- flake8 connect -- pytest --cov-report=xml --cov=./connect -- sed -i "s/version='0.0.0'/version='${TRAVIS_TAG}'/g" setup.py -- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sonar-scanner; fi' - -after_success: -- bash <(curl -s https://codecov.io/bash) - -addons: - sonarcloud: - organization: "cloudbluesonarcube" - token: - secure: rLMrKhQitMly/RhNQp0ixxQwVIuRpFY1ruKprZ2LSmE+RD3guFxtZ+EMX12gSdOBd3vV4qUfPKAcFThFDjNAscP6W3rcxip85pPWV8QiCjm0mszIlQiU7GjyMq0gOf5pLDTQk67gTBDkpXBVpPv4BgEfG2ms5BLMvkGmCba+4iRa8QQ2J0OaRV69DuOnOftc4YZZnJeVNxfm+OrRInDfmcdJfOAChWzmjsriHATu4KbV9r1G7zMkU0ovvLavS8pqg6PEu5lYbFAYa2O1wG/sRTufIPqCSbQvK6gwzsFbwFtfshWHz1MAMhVub0cVWj+umXab3o+Av1bqNMC3xrzzL05PJSpCExBXrHhdsS/I7ucXSmOiJZhu69HZvoaujbaYmTFGHz/BUdvFrNNIEXKAQOo/N2bnlGpzOora1QFJRX05yx9y5/Z6T+qOJ1uVp3JyoOtw4xkrbeU2AWQko04whN6FJ6ljHlfoubGwdme7Sz7JsGkEFxBHSLyZX9QNtUKnq6vAZEMJmiVtiCNes+f7gCH8h92Jyw0zD5tNxYrvZJS5w235CV88G1FLLG1Kl6eegj+EompH4vlf2kXDEEVzGzzDHjROC6LzUMuxABmeJ/lkxzrfKi5P7R5JbQzWKBjyzMRLneD0pwJWePLmMr2zGA9f75S1th4yqvr+NzjbQrA= -deploy: - skip_cleanup: true - provider: pypi - user: apslite - password: - secure: nzWd7Fqgi/K5YKqrAPkIBkgRImWQyQgD2/qP3fYksyJnIFWNcea5T4EKqQKXIPZHh1K0cRhT7mSjIfIrQ6H3XKM/eMTAlz6pbisG2cuu4ueUBjbxHCVCkwzBPgF7+DuCJUXJ/SHyoqMnTdAQo8fb8g69/UCmnUp37YoDO1YHXIMjFVkNc6PFS7nQElXnWkvWd1SpQgA1ZdWdwBzEnIiq+L6IFeTa83PH0Schkem/vR9Ql9CmuliovNt3yHfFaeIqLUgOmsfrwOtDVs0/SkcF+Gg5tNds7DHH2TR4fHco5s8F+n4FVgv2DUPlvBbOVvUH1RiRB8hdATetUxe1cU8fT1nPdJASLWS5E4b4knGLH53+bGxqPVezHxghbVYZHPXp7yI1zWX/Wtn9MBiAo9S3f+Tf8zTk5PIjAJLG/Sdn0RX8mLn89fsslku3enH/FknwPtG+xVYSzUlrd+yzHKnqYkKJzMjsBq/F5+shmYSDlnGdGv+Ga3xZSjIoXlphO5qpxR7vrGnLMxEPJC06+mPgPZp1qfDMyrei/IAPRP8qYPC+Vnj8yclH/UyBKT66z2UEP1z5Op99fUXi3W59x2zdVaLHYniNf16UqtrE5kc7gdLvVcH+NtbO716SAbvO5ql/JsYYTmDSoWEC9KWZS+4E7p7n45c8DEieg8Q5HThWF9Y= - on: - tags: true - all_branches: true - distributions: sdist - condition: "$BUILD = PYPI" diff --git a/README.md b/README.md index f492c7e..327d9e7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Connect Python SDK -![pyversions](https://img.shields.io/pypi/pyversions/connect-sdk.svg) [![PyPi Status](https://img.shields.io/pypi/v/connect-sdk.svg)](https://pypi.org/project/connect-sdk/) [![codecov](https://codecov.io/gh/cloudblue/connect-python-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/cloudblue/connect-python-sdk) [![Build Status](https://travis-ci.org/cloudblue/connect-python-sdk.svg?branch=master)](https://travis-ci.org/cloudblue/connect-python-sdk) [![PyPI status](https://img.shields.io/pypi/status/connect-sdk.svg)](https://pypi.python.org/pypi/connect-sdk/) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=connectpythonsdk&metric=alert_status)](https://sonarcloud.io/dashboard?id=connectpythonsdk) +![pyversions](https://img.shields.io/pypi/pyversions/connect-sdk.svg) [![PyPi Status](https://img.shields.io/pypi/v/connect-sdk.svg)](https://pypi.org/project/connect-sdk/) [![codecov](https://codecov.io/gh/cloudblue/connect-python-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/cloudblue/connect-python-sdk) [![Build Status](https://github.com/cloudblue/connect-python-sdk/workflows/Build%20Connect%20Python%20SDK/badge.svg)](https://github.com/cloudblue/connect-python-sdk/actions) [![PyPI status](https://img.shields.io/pypi/status/connect-sdk.svg)](https://pypi.python.org/pypi/connect-sdk/) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=connectpythonsdk&metric=alert_status)](https://sonarcloud.io/dashboard?id=connectpythonsdk) Connect Python SDK allows an easy and fast integration with Connect fulfillment API. Thanks to it you can automate the fulfillment of orders generated by your products. diff --git a/connect/resources/__init__.py b/connect/resources/__init__.py index 1776337..dcfa5a0 100644 --- a/connect/resources/__init__.py +++ b/connect/resources/__init__.py @@ -24,7 +24,6 @@ 'UsageAutomation', 'UsageFileAutomation', 'TierAccountRequestAutomation', - 'Subscription', 'BillingRequest', 'RecurringAsset', 'AssetRequestResource'