diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index a1480bf6..e4b5f2a0 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 - name: Build Artifacts run: poetry build diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7babefd9..835095da 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -29,3 +29,4 @@ jobs: contents: read pages: write id-token: write + diff --git a/.github/workflows/check-release-tag.yml b/.github/workflows/check-release-tag.yml index 32aa6b81..a3d0350a 100644 --- a/.github/workflows/check-release-tag.yml +++ b/.github/workflows/check-release-tag.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 - name: Check Tag Version # make sure the pushed/created tag matched the project version diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index eaace6fc..dfb7eebf 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 - name: Check Version(s) run: poetry run -- nox -s version:check @@ -32,12 +32,16 @@ jobs: uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 - name: Build Documentation run: | poetry run -- nox -s docs:build + - name: Link Check + run: | + poetry run -- nox -s links:check + build-matrix: name: Generate Build Matrix uses: ./.github/workflows/matrix-python.yml @@ -55,7 +59,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 - name: Run changelog update check run: poetry run -- nox -s changelog:updated @@ -74,7 +78,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 with: python-version: ${{ matrix.python-version }} @@ -105,7 +109,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 with: python-version: ${{ matrix.python-version }} @@ -127,7 +131,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 with: python-version: ${{ matrix.python-version }} @@ -151,12 +155,12 @@ jobs: uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 - name: Run format check run: poetry run -- nox -s project:format - tests-job: + Tests: name: Tests (Python-${{ matrix.python-version }}) needs: [ Documentation, Lint, Type-Check, Security, Format, build-matrix ] strategy: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ae029a6..25693b53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,13 +16,6 @@ jobs: permissions: contents: read - metrics: - needs: [ ci-job ] - uses: ./.github/workflows/report.yml - secrets: inherit - permissions: - contents: read - gate-1: name: Gate 1 - Regular CI needs: [ ci-job ] @@ -55,6 +48,13 @@ jobs: slow-tests: true python-version: "3.10" + metrics: + needs: [ ci-job, run-slow-tests ] + uses: ./.github/workflows/report.yml + secrets: inherit + permissions: + contents: read + gate-2: name: Gate 2 - Allow Merge runs-on: ubuntu-24.04 diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index d717074f..233cf2b1 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 - name: Build Documentation run: | diff --git a/.github/workflows/matrix-python.yml b/.github/workflows/matrix-python.yml index 7045528a..cfc0c272 100644 --- a/.github/workflows/matrix-python.yml +++ b/.github/workflows/matrix-python.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 - name: Generate matrix run: poetry run -- nox -s matrix:python diff --git a/.github/workflows/report.yml b/.github/workflows/report.yml index 8346dd35..1dbc3222 100644 --- a/.github/workflows/report.yml +++ b/.github/workflows/report.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@1.5.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.6.0 - name: Download Artifacts uses: actions/download-artifact@v4.2.1 @@ -32,6 +32,11 @@ jobs: - name: Validate Artifacts run: poetry run -- nox -s artifacts:validate + - name: Upload to sonar + env: + SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}" + run: poetry run -- nox -s sonar:check + - name: Generate Report run: poetry run -- nox -s project:report -- --format json | tee metrics.json diff --git a/.gitignore b/.gitignore index b1124f76..3e601db1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ __pycache__ /.lint.json /.coverage TAGS +.sonar \ No newline at end of file diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index 79e701b8..00ff721b 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -1 +1,5 @@ # Unreleased + +## Refactorings + +* #110: Updated exasol-toolbox to 1.6.0 & activated sonar \ No newline at end of file diff --git a/exasol/saas/client/__init__.py b/exasol/saas/client/__init__.py index b3c017dc..b6e0c0a5 100644 --- a/exasol/saas/client/__init__.py +++ b/exasol/saas/client/__init__.py @@ -2,9 +2,7 @@ Package openapi contains the API generated from the JSON definition. """ -from dataclasses import dataclass from datetime import ( - datetime, timedelta, ) from typing import Final diff --git a/exasol/saas/client/api_access.py b/exasol/saas/client/api_access.py index edf11ea1..e137d3da 100644 --- a/exasol/saas/client/api_access.py +++ b/exasol/saas/client/api_access.py @@ -10,11 +10,7 @@ datetime, timedelta, ) -from typing import ( - Any, - List, - Optional, -) +from typing import Any from tenacity import ( TryAgain, @@ -173,7 +169,9 @@ def get_connection_params( account_id, client, database_name=database_name ) clusters = list_clusters.sync(account_id, database_id, client=client) - cluster_id = next(filter(lambda cl: cl.main_cluster, clusters)).id # type: ignore + cluster_id = next( + filter(lambda cl: cl.main_cluster, clusters) # type: ignore + ).id connections = get_cluster_connection.sync( account_id, database_id, cluster_id, client=client ) diff --git a/poetry.lock b/poetry.lock index 35eb406f..ae75faad 100644 --- a/poetry.lock +++ b/poetry.lock @@ -737,14 +737,14 @@ files = [ [[package]] name = "exasol-toolbox" -version = "1.5.0" +version = "1.6.0" description = "Your one-stop solution for managing all standard tasks and core workflows of your Python project." optional = false python-versions = "<4.0,>=3.9" groups = ["dev"] files = [ - {file = "exasol_toolbox-1.5.0-py3-none-any.whl", hash = "sha256:60ea3ece68354d83e4e18ad7200bd2f6966ea415baac8eb87d80b908057d465c"}, - {file = "exasol_toolbox-1.5.0.tar.gz", hash = "sha256:46af5efb56fc2088099980be610d8cfa15acda105657057230a5a5696647f524"}, + {file = "exasol_toolbox-1.6.0-py3-none-any.whl", hash = "sha256:a8d35bd2ad90dffa4e3ba9afbace459e9e45d418521c50d2e9e62b082e610c0e"}, + {file = "exasol_toolbox-1.6.0.tar.gz", hash = "sha256:9475424f59decf268b9692bb54b664d833da1948e35a16e5748d6fb920e93a5c"}, ] [package.dependencies] @@ -3169,5 +3169,5 @@ test = ["websockets"] [metadata] lock-version = "2.1" -python-versions = "^3.10.0" -content-hash = "78bcaeece114f0d7b47b923afa25d3505e6b37945bbb11e602ef9d1fa718aa26" +python-versions = ">=3.10.0,<4.0" +content-hash = "40ee15b34a4d8a567a87eb926c3191d8dfe23fd13623eddd37af3145129abcf8" diff --git a/pyproject.toml b/pyproject.toml index dbfbb11a..e476fa5a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [project] name = "exasol-saas-api" version = "2.2.0" +requires-python = ">=3.10.0,<4.0" description = "API enabling Python applications connecting to Exasol database SaaS instances and using their SaaS services" authors = [ {name="Christoph Kuhnke", email="christoph.kuhnke@exasol.com"}, @@ -10,7 +11,7 @@ maintainers = [ ] readme = "README.md" license = "MIT" -dynamic = ["classifiers"] +dynamic = ["classifiers", "dependencies"] [project.urls] Homepage = "https://github.com/exasol/saas-api-python" @@ -28,7 +29,6 @@ classifiers = [ ] [tool.poetry.dependencies] -python = "^3.10.0" requests = "^2.32.4" types-requests = "^2.31.0.6" ifaddr = "^0.2.0" @@ -47,7 +47,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry.group.dev.dependencies] pytest = "^7.1.1" pytest-mock = "^3.7.0" -exasol-toolbox = "^1.5.0" +exasol-toolbox = "^1.6.0" openapi-python-client = ">=0.21.5" pyexasol = ">=0.25.0" toml = "^0.10.2" @@ -114,3 +114,9 @@ max-module-lines = 800 [tool.poetry.scripts] tbx = 'exasol.toolbox.tools.tbx:CLI' + +[tool.sonar] +projectKey = "com.exasol:saas-api-python" +hostUrl = "https://sonarcloud.io" +organization = "exasol" +exclusions = "exasol/saas/client/openapi/*" \ No newline at end of file