Skip to content

Commit ed430ce

Browse files
authored
Merge pull request #1 from Bandwidth/SWI-5401
SWI-5401
2 parents 50c2c12 + d429dd1 commit ed430ce

File tree

410 files changed

+11768
-0
lines changed

Some content is hidden

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

410 files changed

+11768
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Deploy SDK
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
deploy_pre_release:
10+
name: Deploy Client Pre-Release to PYPI
11+
if: ${{ github.event.release.prerelease }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set Release Version
15+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
16+
17+
- name: Check Release Tag Format
18+
run: |
19+
re=[0-9]+\.[0-9]+\.[0-9]+b[0-9]+
20+
if ! [[ $RELEASE_VERSION =~ $re ]]; then
21+
echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+.[0-9]+.[0-9]+b[0-9]+)'
22+
echo $RELEASE_VERSION
23+
echo 'Please update your tag to match the expected regex pattern'
24+
exit 1
25+
fi
26+
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
ref: feature/openapi-generator-sdk
31+
32+
- name: Install Packages
33+
run: |
34+
pip install -r requirements.txt
35+
pip install -r test-requirements.txt
36+
37+
- name: Test
38+
run: |
39+
pytest -v
40+
41+
- name: Deploy to PYPI
42+
run: |
43+
pip install twine
44+
pip install wheel
45+
python setup.py sdist bdist_wheel
46+
twine upload dist/* -u __token__ -p $PYPI_API_KEY
47+
env:
48+
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
49+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
50+
51+
- uses: Bandwidth/[email protected]
52+
if: always()
53+
with:
54+
job-status: ${{ job.status }}
55+
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
56+
slack-channel: ${{ secrets.SLACK_CHANNEL }}
57+
58+
deploy:
59+
name: Deploy `main` to PYPI
60+
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }}
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: Set Release Version
64+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
65+
66+
- name: Check Release Tag Format
67+
run: |
68+
re=[0-9]+\.[0-9]+\.[0-9]+
69+
if ! [[ $RELEASE_VERSION =~ $re ]]; then
70+
echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+.[0-9]+.[0-9]+b[0-9]+)'
71+
echo $RELEASE_VERSION
72+
echo 'Please update your tag to match the expected regex pattern'
73+
exit 1
74+
fi
75+
76+
- name: Checkout
77+
uses: actions/checkout@v4
78+
79+
- name: Install Packages
80+
run: |-
81+
pip install -r requirements.txt
82+
pip install -r test-requirements.txt
83+
84+
- name: Test
85+
run: |-
86+
pytest -v
87+
88+
- name: Deploy to PYPI
89+
run: |
90+
pip install twine
91+
pip install wheel
92+
python setup.py sdist bdist_wheel
93+
twine upload dist/* -u __token__ -p $PYPI_API_KEY
94+
env:
95+
PYPI_API_KEY: ${{ secrets.PYPI_API_KEY }}
96+
97+
- uses: Bandwidth/[email protected]
98+
if: always()
99+
with:
100+
job-status: ${{ job.status }}
101+
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
102+
slack-channel: ${{ secrets.SLACK_CHANNEL }}

.github/workflows/test.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Test
2+
3+
on:
4+
schedule:
5+
- cron: "0 4 * * *"
6+
pull_request:
7+
workflow_dispatch:
8+
inputs:
9+
logLevel:
10+
description: Log level
11+
required: false
12+
default: WARNING
13+
type: choice
14+
options:
15+
- WARNING
16+
- DEBUG
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.head_ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
test:
24+
name: Test
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
matrix:
28+
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-latest]
29+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
30+
fail-fast: false
31+
env:
32+
PYTHON_VERSION: ${{ matrix.python-version }}
33+
OPERATING_SYSTEM: ${{ matrix.os }}
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Set up Python
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: ${{ matrix.python-version }}
43+
44+
- name: Install Packages
45+
run: |
46+
pip install -r requirements.txt
47+
pip install -r test-requirements.txt
48+
49+
- name: Test at Debug Level
50+
if: ${{ inputs.logLevel == 'DEBUG' }}
51+
run: |
52+
echo "Log level: DEBUG"
53+
pytest -v --log-cli-level=DEBUG
54+
55+
- name: Test at Warning Level
56+
if: ${{( inputs.logLevel == null) || ( inputs.logLevel == 'WARNING') }}
57+
run: |
58+
echo "Log level: WARNING"
59+
pytest -v --log-cli-level=WARNING
60+
61+
notify_for_failures:
62+
name: Notify for Failures
63+
needs: [test]
64+
if: failure()
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Notify Slack of Failures
68+
uses: Bandwidth/[email protected]
69+
with:
70+
job-status: failure
71+
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
72+
slack-channel: ${{ secrets.SLACK_CHANNEL }}

.gitignore

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# OS
2+
.DS_Store
3+
Thumbs.db
4+
5+
# Python
6+
*.pyc
7+
*.pyo
8+
__pycache__
9+
10+
# Common IDEs
11+
*.swp
12+
.idea/
13+
.pyenv/
14+
.buildpath
15+
.settings
16+
atlassian-ide-plugin.xml
17+
.project
18+
.pydevproject
19+
.installed.cfg
20+
*.sublime-project
21+
*.sublime-workspace
22+
*.ropeproject
23+
*.patch
24+
25+
# Coverage
26+
.coverage
27+
htmlcov/
28+
29+
# Virtualenv
30+
env/
31+
.env/
32+
.env
33+
venv/
34+
.venv/
35+
.venv
36+
p2_7
37+
38+
# Project
39+
/public/
40+
41+
# Settings
42+
settings_local.py
43+
local_settings.py
44+
local.py
45+
46+
# SQLite
47+
*.sqlite*
48+
*.db
49+
50+
# Translations
51+
52+
# Logs
53+
*.log
54+
55+
*.pid
56+
57+
/reports/
58+
59+
# Redis
60+
*.rdb
61+
*.bak
62+
63+
django-colors-formatter
64+
65+
# testing
66+
testing/
67+
local_env.sh
68+
*.egg-info/
69+
.tox/
70+
deprecated/
71+
72+
# Config
73+
config.cfg
74+
75+
# Examples
76+
examples/src

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 bandwidthcom
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)