diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8b137891..3ec632d3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1 +1,73 @@ +name: Release +on: + pull_request: + types: + - closed +jobs: + set-package-matrix: + # This action returns all sub-packages to be published, except the `thousandeyes-sdk-core`. + # It thens exports the variable to matrix, so that the deployment job is run individually for each sub-package + runs-on: ubuntu-latest + outputs: + packages: ${{ steps.packages.outputs.packages }} + steps: + - uses: actions/checkout@v4 + - id: packages + run: | + FOLDERS_JSON=$(find . -maxdepth 1 -type d -name "thousandeyes-sdk-*" ! -name "thousandeyes-sdk-core"| cut -c 3- | jq -R -s -c 'split("\n")[:-1]') + echo "packages=$FOLDERS_JSON" >> "$GITHUB_OUTPUT" + deployment: + if: github.event.pull_request.merged == true + needs: set-package-matrix + strategy: + matrix: + package-name: ${{ fromJSON(needs.set-package-matrix.outputs.packages) }} + runs-on: ubuntu-latest + permissions: + id-token: write + environment: + name: test + url: https://pypi.org/p/${{ matrix.package-name }} + steps: + - uses: actions/checkout@v4 + with: + ref: main + token: ${{ secrets.TEST_PAT }} + - name: Set up Python + uses: actions/setup-python@v5 + with: + cache: pip + cache-dependency-path: '**/pyproject.toml' + - name: Install dependencies + run: | + pip install setuptools wheel build + - name: Build + run: | + cp .version ${{ matrix.package-name }}/ + python -m build ${{ matrix.package-name }} --outdir dist/ + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true + bump-version: + needs: deployment + name: Bump version and commit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + cache: pip + python-version: '3.11' + - name: Install bumpversion + env: + GITHUB_TOKEN: ${{ secrets.PAT_COMMIT_TO_MAIN }} + run: | + git config user.name "API Team" + git config user.email "api-team@thousandeyes.com" + + pip install bumpversion + bumpversion minor --commit + git push --force diff --git a/test.py b/test.py new file mode 100644 index 00000000..0e1273aa --- /dev/null +++ b/test.py @@ -0,0 +1,29 @@ +import thousandeyes_sdk.core +import thousandeyes_sdk.usage +from thousandeyes_sdk.core.exceptions import ApiException +from pprint import pprint + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token='8b919a53-6977-4d19-92a7-3615a20836b2', + host='https://api.stg.thousandeyes.com' +) + + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.usage.UsageApi(api_client) + + try: + # Create or update accout group quotas + api_response = api_instance.get_usage(aid="85486") + print("The response of UsageApi->assign_organizations_account_groups_quotas:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling QuotasApi->assign_organizations_account_groups_quotas: %s\n" % e) diff --git a/thousandeyes-sdk-administrative/pyproject.toml b/thousandeyes-sdk-administrative/pyproject.toml index 4e64e753..01074bbf 100644 --- a/thousandeyes-sdk-administrative/pyproject.toml +++ b/thousandeyes-sdk-administrative/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Administrative API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-agents/pyproject.toml b/thousandeyes-sdk-agents/pyproject.toml index 7e325b16..0be3ed44 100644 --- a/thousandeyes-sdk-agents/pyproject.toml +++ b/thousandeyes-sdk-agents/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Agents API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-alerts/pyproject.toml b/thousandeyes-sdk-alerts/pyproject.toml index 8cbef3f2..1d837987 100644 --- a/thousandeyes-sdk-alerts/pyproject.toml +++ b/thousandeyes-sdk-alerts/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Alerts API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-bgp-monitors/pyproject.toml b/thousandeyes-sdk-bgp-monitors/pyproject.toml index 0d16ebb5..fd98f085 100644 --- a/thousandeyes-sdk-bgp-monitors/pyproject.toml +++ b/thousandeyes-sdk-bgp-monitors/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK BGP Monitors API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-core/pyproject.toml b/thousandeyes-sdk-core/pyproject.toml index 69c20656..0f92d138 100644 --- a/thousandeyes-sdk-core/pyproject.toml +++ b/thousandeyes-sdk-core/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Core" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-credentials/pyproject.toml b/thousandeyes-sdk-credentials/pyproject.toml index 612bdd5a..c12cb37f 100644 --- a/thousandeyes-sdk-credentials/pyproject.toml +++ b/thousandeyes-sdk-credentials/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Credentials API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-dashboards/pyproject.toml b/thousandeyes-sdk-dashboards/pyproject.toml index f14d0af5..a5cade04 100644 --- a/thousandeyes-sdk-dashboards/pyproject.toml +++ b/thousandeyes-sdk-dashboards/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Dashboards API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-endpoint-agents/pyproject.toml b/thousandeyes-sdk-endpoint-agents/pyproject.toml index 68de3f19..353b6e75 100644 --- a/thousandeyes-sdk-endpoint-agents/pyproject.toml +++ b/thousandeyes-sdk-endpoint-agents/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Endpoint Agents API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-endpoint-instant-tests/pyproject.toml b/thousandeyes-sdk-endpoint-instant-tests/pyproject.toml index 6ad396da..d02d1f41 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/pyproject.toml +++ b/thousandeyes-sdk-endpoint-instant-tests/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Endpoint Instant Scheduled Tests API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-endpoint-labels/pyproject.toml b/thousandeyes-sdk-endpoint-labels/pyproject.toml index 1d223f7d..07d6bec7 100644 --- a/thousandeyes-sdk-endpoint-labels/pyproject.toml +++ b/thousandeyes-sdk-endpoint-labels/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Endpoint Agent Labels API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-endpoint-test-results/pyproject.toml b/thousandeyes-sdk-endpoint-test-results/pyproject.toml index af87f9a9..d2264611 100644 --- a/thousandeyes-sdk-endpoint-test-results/pyproject.toml +++ b/thousandeyes-sdk-endpoint-test-results/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Endpoint Test Results API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-endpoint-tests/pyproject.toml b/thousandeyes-sdk-endpoint-tests/pyproject.toml index e39e983a..9a98aaf1 100644 --- a/thousandeyes-sdk-endpoint-tests/pyproject.toml +++ b/thousandeyes-sdk-endpoint-tests/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Endpoint Tests API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-instant-tests/pyproject.toml b/thousandeyes-sdk-instant-tests/pyproject.toml index 1401c06c..61d7eac0 100644 --- a/thousandeyes-sdk-instant-tests/pyproject.toml +++ b/thousandeyes-sdk-instant-tests/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Instant Tests API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-internet-insights/pyproject.toml b/thousandeyes-sdk-internet-insights/pyproject.toml index 574d9ec9..8f12f446 100644 --- a/thousandeyes-sdk-internet-insights/pyproject.toml +++ b/thousandeyes-sdk-internet-insights/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Internet Insights API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-labels/pyproject.toml b/thousandeyes-sdk-labels/pyproject.toml index e36bb63b..41dd080b 100644 --- a/thousandeyes-sdk-labels/pyproject.toml +++ b/thousandeyes-sdk-labels/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Labels API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-snapshots/pyproject.toml b/thousandeyes-sdk-snapshots/pyproject.toml index 22e2377b..e07c9888 100644 --- a/thousandeyes-sdk-snapshots/pyproject.toml +++ b/thousandeyes-sdk-snapshots/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Test Snapshots API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-streaming/pyproject.toml b/thousandeyes-sdk-streaming/pyproject.toml index 417ddf6a..a6ebf7f2 100644 --- a/thousandeyes-sdk-streaming/pyproject.toml +++ b/thousandeyes-sdk-streaming/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK ThousandEyes for OpenTelemetry API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-tags/pyproject.toml b/thousandeyes-sdk-tags/pyproject.toml index 6cf4ee15..4f25cf6a 100644 --- a/thousandeyes-sdk-tags/pyproject.toml +++ b/thousandeyes-sdk-tags/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Tags API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-test-results/pyproject.toml b/thousandeyes-sdk-test-results/pyproject.toml index f3b0235c..fa92c493 100644 --- a/thousandeyes-sdk-test-results/pyproject.toml +++ b/thousandeyes-sdk-test-results/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Test Results API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-tests/pyproject.toml b/thousandeyes-sdk-tests/pyproject.toml index 74cd78e2..7927ad94 100644 --- a/thousandeyes-sdk-tests/pyproject.toml +++ b/thousandeyes-sdk-tests/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Tests API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2", diff --git a/thousandeyes-sdk-usage/pyproject.toml b/thousandeyes-sdk-usage/pyproject.toml index dce72892..90564229 100644 --- a/thousandeyes-sdk-usage/pyproject.toml +++ b/thousandeyes-sdk-usage/pyproject.toml @@ -6,7 +6,7 @@ authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] description = "ThousandEyes SDK Usage API" -license = { text = "../LICENSE" } +license = { file = "LICENSE" } dependencies = [ "urllib3 >= 1.25.3", "python-dateutil >=2.8.2",