From 8f290d6276c095333d8e2d1f5ca95419d58b2c5c Mon Sep 17 00:00:00 2001 From: Dominik Hoffmann Date: Wed, 4 Dec 2024 14:14:04 +0100 Subject: [PATCH 1/9] #84: Removed print Signed-off-by: Dominik Hoffmann --- .../data_quality/data_manipulation/spark/interval_filtering.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdk/python/rtdip_sdk/pipelines/data_quality/data_manipulation/spark/interval_filtering.py b/src/sdk/python/rtdip_sdk/pipelines/data_quality/data_manipulation/spark/interval_filtering.py index 644ca6232..9eed0e05f 100644 --- a/src/sdk/python/rtdip_sdk/pipelines/data_quality/data_manipulation/spark/interval_filtering.py +++ b/src/sdk/python/rtdip_sdk/pipelines/data_quality/data_manipulation/spark/interval_filtering.py @@ -85,7 +85,7 @@ def filter(self) -> DataFrame: tolerance_in_ms = None if self.tolerance is not None: tolerance_in_ms = self.get_time_delta(self.tolerance).total_seconds() * 1000 - print(tolerance_in_ms) + time_delta_in_ms = self.get_time_delta(self.interval).total_seconds() * 1000 From 17fae5298bf1919c8d188b5bdd9b2a1a1542105a Mon Sep 17 00:00:00 2001 From: Dominik Hoffmann Date: Wed, 4 Dec 2024 14:20:43 +0100 Subject: [PATCH 2/9] #84: Added differences form core setup.py Signed-off-by: Dominik Hoffmann --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 1f3892e12..e1ab31df3 100644 --- a/setup.py +++ b/setup.py @@ -89,7 +89,6 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", ], project_urls={ "Issue Tracker": "https://github.com/rtdip/core/issues", @@ -100,7 +99,7 @@ package_dir={"": "src/sdk/python"}, include_package_data=True, packages=find_packages(where="src/sdk/python"), - python_requires=">=3.9, <3.13", + python_requires=">=3.9, <3.12", install_requires=INSTALL_REQUIRES, extras_require=EXTRAS_DEPENDENCIES, setup_requires=["pytest-runner", "setuptools_scm"], From 555d0e3a1959616cf13a7624b186a435cd8d05df Mon Sep 17 00:00:00 2001 From: Dominik Hoffmann Date: Wed, 4 Dec 2024 14:40:08 +0100 Subject: [PATCH 3/9] #84: Added differences form core Signed-off-by: Dominik Hoffmann --- .github/workflows/develop.yml | 2 +- .github/workflows/release.yml | 4 ++-- .github/workflows/sonarcloud_reusable.yml | 6 +++--- .github/workflows/test.yml | 14 ++------------ 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index cc272246e..3476ae2f6 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -48,7 +48,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.11 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f223d44f9..815f58056 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.11 - name: Install dependencies run: | python -m pip install --upgrade pip @@ -101,7 +101,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.11 - name: Install Boost run: | diff --git a/.github/workflows/sonarcloud_reusable.yml b/.github/workflows/sonarcloud_reusable.yml index f9a8ba878..3c358efd1 100644 --- a/.github/workflows/sonarcloud_reusable.yml +++ b/.github/workflows/sonarcloud_reusable.yml @@ -47,7 +47,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ["3.12"] + python-version: ["3.11"] pyspark: ["3.5.3"] delta-spark: ["3.0.0"] runs-on: ${{ matrix.os }} @@ -99,7 +99,7 @@ jobs: - name: Override Coverage Source Path for Sonar run: | - sed -i "s/\/home\/runner\/work\/core\/core<\/source>/\/github\/workspace<\/source>/g" coverage-reports/coverage-unittests.xml + sed -i "s/\/home\/runner\/work\/core\/core<\/source>/\/github\/workspace<\/source>/g" /home/runner/work/core/core/coverage-reports/coverage-unittests.xml - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master @@ -108,7 +108,7 @@ jobs: -Dsonar.organization=rtdip -Dsonar.projectKey=rtdip_core -Dsonar.python.coverage.reportPaths=coverage-reports/coverage-unittests.xml - -Dsoner.python.version=3.12 + -Dsoner.python.version=3.11 -Dsonar.scm.revision=${{ inputs.HEAD_SHA }} -Dsonar.pullrequest.key=${{ inputs.PR_NUMBER }} -Dsonar.pullrequest.branch=${{ inputs.PR_HEAD_REF }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 500ad212e..53af11eeb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11"] pyspark: ["3.3.0", "3.3.1", "3.3.2", "3.4.0", "3.4.1", "3.5.0", "3.5.1"] exclude: - pyspark: "3.5.1" @@ -51,16 +51,6 @@ jobs: python-version: "3.11" - pyspark: "3.3.0" python-version: "3.11" - - pyspark: "3.4.1" - python-version: "3.12" - - pyspark: "3.4.0" - python-version: "3.12" - - pyspark: "3.3.2" - python-version: "3.12" - - pyspark: "3.3.1" - python-version: "3.12" - - pyspark: "3.3.0" - python-version: "3.12" include: - pyspark: "3.3.0" delta-spark: "2.2.0" @@ -118,7 +108,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ["3.12"] + python-version: ["3.11"] pyspark: ["3.5.3"] delta-spark: ["3.0.0"] runs-on: ${{ matrix.os }} From 3de78629df823e2756fabdd66b1b827f07d2f5e3 Mon Sep 17 00:00:00 2001 From: Dominik Hoffmann Date: Wed, 4 Dec 2024 14:43:43 +0100 Subject: [PATCH 4/9] #84: Added differences form core Signed-off-by: Dominik Hoffmann --- docs/getting-started/installation.md | 4 ++-- .../essentials/rtdip/introduction/prerequisites.md | 2 +- environment.yml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 9045d2f6a..e1c24a879 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -90,7 +90,7 @@ To use RTDIP Pipelines components in your own environment that leverages [pyspar - conda-forge - defaults dependencies: - - python==3.12 + - python==3.11 - pip - openjdk==11.0.15 - pip: @@ -182,7 +182,7 @@ The following provides examples of how to install the RTDIP SDK package with Pip - conda-forge - defaults dependencies: - - python==3.12 + - python==3.11 - pip - pip: - rtdip-sdk diff --git a/docs/university/essentials/rtdip/introduction/prerequisites.md b/docs/university/essentials/rtdip/introduction/prerequisites.md index 7bb1bd49e..7868e45ae 100644 --- a/docs/university/essentials/rtdip/introduction/prerequisites.md +++ b/docs/university/essentials/rtdip/introduction/prerequisites.md @@ -3,7 +3,7 @@ Before you begin the course, ensure you obtain the following prerequisites(from your istructor or from your environment if you are doing this on your own): ## Development Environment -- Python >=3.9,<=3.12 +- Python >=3.9,<=3.11 - An IDE such as Visual Studio Code or PyCharm - Postman via the app, web browser or as an extension on Visual Studio Code diff --git a/environment.yml b/environment.yml index 53682960a..8e3a1fccd 100644 --- a/environment.yml +++ b/environment.yml @@ -18,7 +18,7 @@ channels: - conda-forge - defaults dependencies: - - python>=3.9,<3.13 + - python>=3.9,<3.12 - importlib-metadata>=7.0.0 - jinja2>=3.1.4 - pytest==7.4.0 @@ -35,7 +35,7 @@ dependencies: - azure-keyvault-secrets>=4.7.0,<5.0.0 - azure-mgmt-storage>=21.0.0 - boto3>=1.28.2,<2.0.0 - - pyodbc>=4.0.39,<5.3.0 + - pyodbc>=4.0.39,<5.0.0 - fastapi>=0.110.0,<1.0.0 - httpx>=0.24.1,<1.0.0 - pyspark>=3.3.0,<3.6.0 @@ -87,4 +87,4 @@ dependencies: - eth-typing>=4.2.3,<5.0.0 - pandas>=1.5.2,<2.2.0 - moto[s3]>=5.0.16,<6.0.0 - - pyarrow>=14.0.1,<17.0.0 \ No newline at end of file + - pyarrow>=14.0.1,<17.0.0 From 31978765702b773a40b1e8015125422ba66c6c92 Mon Sep 17 00:00:00 2001 From: Dominik Hoffmann Date: Wed, 4 Dec 2024 14:44:02 +0100 Subject: [PATCH 5/9] #84: linted Signed-off-by: Dominik Hoffmann --- .../data_quality/data_manipulation/spark/interval_filtering.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sdk/python/rtdip_sdk/pipelines/data_quality/data_manipulation/spark/interval_filtering.py b/src/sdk/python/rtdip_sdk/pipelines/data_quality/data_manipulation/spark/interval_filtering.py index 9eed0e05f..8641b7c14 100644 --- a/src/sdk/python/rtdip_sdk/pipelines/data_quality/data_manipulation/spark/interval_filtering.py +++ b/src/sdk/python/rtdip_sdk/pipelines/data_quality/data_manipulation/spark/interval_filtering.py @@ -86,7 +86,6 @@ def filter(self) -> DataFrame: if self.tolerance is not None: tolerance_in_ms = self.get_time_delta(self.tolerance).total_seconds() * 1000 - time_delta_in_ms = self.get_time_delta(self.interval).total_seconds() * 1000 rows = self.df.collect() From 42a12a133b2d087d1783f65c570c2fa55b6be6d0 Mon Sep 17 00:00:00 2001 From: Dominik Hoffmann Date: Wed, 4 Dec 2024 14:52:21 +0100 Subject: [PATCH 6/9] #84: Added differences form core Signed-off-by: Dominik Hoffmann --- .github/workflows/stale_issues.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/stale_issues.yml diff --git a/.github/workflows/stale_issues.yml b/.github/workflows/stale_issues.yml deleted file mode 100644 index d5cd3cf15..000000000 --- a/.github/workflows/stale_issues.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Close inactive issues -on: - schedule: - - cron: "30 1 * * *" - -jobs: - close-issues: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - uses: actions/stale@v5 - with: - days-before-issue-stale: 30 - days-before-issue-close: 14 - stale-issue-label: "stale" - stale-issue-message: "This issue is stale because it has been open for 30 days with no activity." - close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale." - days-before-pr-stale: -1 - days-before-pr-close: -1 - repo-token: ${{ secrets.GITHUB_TOKEN }} From f07acbe91b425a0e1117018a297d7f1e1079c8c2 Mon Sep 17 00:00:00 2001 From: Dominik Hoffmann Date: Wed, 4 Dec 2024 15:49:40 +0100 Subject: [PATCH 7/9] #84: Fixed wrong passing of FastAPI into httpx async client Signed-off-by: Dominik Hoffmann --- tests/api/v1/test_api_batch.py | 18 ++++++------- tests/api/v1/test_api_circular_average.py | 23 +++++++++------- .../test_api_circular_standard_deviation.py | 14 +++++----- tests/api/v1/test_api_interpolate.py | 14 +++++----- .../api/v1/test_api_interpolation_at_time.py | 14 +++++----- tests/api/v1/test_api_latest.py | 26 +++++++++---------- tests/api/v1/test_api_metadata.py | 24 ++++++++--------- tests/api/v1/test_api_plot.py | 14 +++++----- tests/api/v1/test_api_raw.py | 20 +++++++------- tests/api/v1/test_api_resample.py | 14 +++++----- tests/api/v1/test_api_sql.py | 8 +++--- tests/api/v1/test_api_summary.py | 14 +++++----- .../api/v1/test_api_time_weighted_average.py | 14 +++++----- tests/api/v1/test_api_utilities.py | 8 +++--- 14 files changed, 114 insertions(+), 111 deletions(-) diff --git a/tests/api/v1/test_api_batch.py b/tests/api/v1/test_api_batch.py index 3b6076396..2878d3607 100644 --- a/tests/api/v1/test_api_batch.py +++ b/tests/api/v1/test_api_batch.py @@ -38,7 +38,7 @@ RawResponse, ) from pandas.io.json import build_table_schema -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport, ASGITransport from src.api.v1 import app from src.api.v1.common import json_response_batch from src.sdk.python.rtdip_sdk.queries.time_series import batch @@ -87,7 +87,7 @@ async def test_api_batch_single_get_success(mocker: MockerFixture): mock_lookup = "src.api.v1.batch.lookup_before_get" mocked_lookup_before_get = mocker.patch(mock_lookup, return_value=None) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -175,7 +175,7 @@ async def test_api_batch_single_get_success_with_lookup(mocker: MockerFixture): mock_lookup = "src.api.v1.batch.lookup_before_get" mocked_lookup_before_get = mocker.patch(mock_lookup, return_value=test_data) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -255,7 +255,7 @@ async def test_api_batch_single_post_success(mocker: MockerFixture): # Make a surveillance batch method reference to check if called and what args with surveillance_batch = mocker.patch(mock_method, return_value=mock_method_return_data) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -300,7 +300,7 @@ async def test_api_batch_single_get_unsupported_route_error(mocker: MockerFixtur os.environ, {"DATABRICKS_SERVING_ENDPOINT": MOCK_MAPPING_ENDPOINT_URL} ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -343,7 +343,7 @@ async def test_api_batch_single_post_missing_body_error(mocker: MockerFixture): os.environ, {"DATABRICKS_SERVING_ENDPOINT": MOCK_MAPPING_ENDPOINT_URL} ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -406,7 +406,7 @@ async def test_api_batch_multiple_success(mocker: MockerFixture): # Make a surveillance batch method reference to check if called and what args with surveillance_batch = mocker.patch(mock_method, side_effect=mock_patch_side_effect) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -464,7 +464,7 @@ async def test_api_batch_one_success_one_fail(mocker: MockerFixture): os.environ, {"DATABRICKS_SERVING_ENDPOINT": MOCK_MAPPING_ENDPOINT_URL} ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -515,7 +515,7 @@ async def test_api_batch_one_success_one_fail(mocker: MockerFixture): os.environ, {"DATABRICKS_SERVING_ENDPOINT": MOCK_MAPPING_ENDPOINT_URL} ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, diff --git a/tests/api/v1/test_api_circular_average.py b/tests/api/v1/test_api_circular_average.py index 99100c52f..9cbbb3b15 100644 --- a/tests/api/v1/test_api_circular_average.py +++ b/tests/api/v1/test_api_circular_average.py @@ -15,6 +15,7 @@ import os import pytest +from fastapi import FastAPI from pytest_mock import MockerFixture import pandas as pd from datetime import datetime, timezone @@ -30,7 +31,7 @@ MOCK_TAG_MAPPING_EMPTY, MOCK_MAPPING_ENDPOINT_URL, ) -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport, ASGITransport from src.api.v1 import app MOCK_METHOD = "src.sdk.python.rtdip_sdk.queries.time_series.circular_average.get" @@ -42,11 +43,13 @@ async def test_api_circular_average_get_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=CIRCULAR_AVERAGE_MOCKED_PARAMETER_DICT, + ) actual = response.text @@ -59,7 +62,7 @@ async def test_api_circular_average_get_validation_error( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -82,7 +85,7 @@ async def test_api_circular_average_get_error(mocker: MockerFixture, api_test_da Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -97,7 +100,7 @@ async def test_api_circular_average_get_error(mocker: MockerFixture, api_test_da async def test_api_circular_average_post_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -115,7 +118,7 @@ async def test_api_circular_average_post_validation_error( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -139,7 +142,7 @@ async def test_api_circular_average_post_error(mocker: MockerFixture, api_test_d Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -182,7 +185,7 @@ async def test_api_circular_average_get_lookup_success(mocker: MockerFixture): modified_param_dict = CIRCULAR_AVERAGE_MOCKED_PARAMETER_DICT.copy() del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=modified_param_dict ) @@ -228,7 +231,7 @@ async def test_api_circular_average_post_lookup_success(mocker: MockerFixture): modified_param_dict = CIRCULAR_AVERAGE_MOCKED_PARAMETER_DICT.copy() del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -278,7 +281,7 @@ async def test_api_circular_average_get_lookup_no_tag_map_error(mocker: MockerFi modified_param_dict["tagname"] = ["NonExistentTag"] del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=modified_param_dict ) diff --git a/tests/api/v1/test_api_circular_standard_deviation.py b/tests/api/v1/test_api_circular_standard_deviation.py index 8db08ce19..7b944a362 100644 --- a/tests/api/v1/test_api_circular_standard_deviation.py +++ b/tests/api/v1/test_api_circular_standard_deviation.py @@ -25,7 +25,7 @@ TEST_HEADERS, BASE_URL, ) -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport from src.api.v1 import app MOCK_METHOD = ( @@ -41,7 +41,7 @@ async def test_api_circular_standard_deviation_get_success( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -58,7 +58,7 @@ async def test_api_circular_standard_deviation_get_validation_error( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -83,7 +83,7 @@ async def test_api_circular_standard_deviation_get_error( Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -100,7 +100,7 @@ async def test_api_circular_standard_deviation_post_success( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -118,7 +118,7 @@ async def test_api_circular_standard_deviation_post_validation_error( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -144,7 +144,7 @@ async def test_api_circular_standard_deviation_post_error( Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, diff --git a/tests/api/v1/test_api_interpolate.py b/tests/api/v1/test_api_interpolate.py index 80f67ba6b..0cc96fc34 100644 --- a/tests/api/v1/test_api_interpolate.py +++ b/tests/api/v1/test_api_interpolate.py @@ -25,7 +25,7 @@ TEST_HEADERS, BASE_URL, ) -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport, ASGITransport from src.api.v1 import app MOCK_METHOD = "src.sdk.python.rtdip_sdk.queries.time_series.interpolate.get" @@ -37,7 +37,7 @@ async def test_api_interpolate_get_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -54,7 +54,7 @@ async def test_api_interpolate_get_validation_error( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -77,7 +77,7 @@ async def test_api_interpolate_get_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -92,7 +92,7 @@ async def test_api_interpolate_get_error(mocker: MockerFixture, api_test_data): async def test_api_interpolate_post_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -110,7 +110,7 @@ async def test_api_interpolate_post_validation_error( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -134,7 +134,7 @@ async def test_api_interpolate_post_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, diff --git a/tests/api/v1/test_api_interpolation_at_time.py b/tests/api/v1/test_api_interpolation_at_time.py index 23218d5f4..bb7c49d09 100644 --- a/tests/api/v1/test_api_interpolation_at_time.py +++ b/tests/api/v1/test_api_interpolation_at_time.py @@ -24,7 +24,7 @@ TEST_HEADERS, BASE_URL, ) -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport from src.api.v1 import app MOCK_METHOD = "src.sdk.python.rtdip_sdk.queries.time_series.interpolation_at_time.get" @@ -38,7 +38,7 @@ async def test_api_interpolation_at_time_get_success( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -57,7 +57,7 @@ async def test_api_interpolation_at_time_get_success( # ) # mocker = mocker_setup(mocker, MOCK_METHOD, test_data) -# async with AsyncClient(app=app, base_url=BASE_URL) as ac: +# async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: # response = await ac.get( # MOCK_API_NAME, # headers=TEST_HEADERS, @@ -82,7 +82,7 @@ async def test_api_interpolation_at_time_get_error( Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -99,7 +99,7 @@ async def test_api_interpolation_at_time_post_success( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -119,7 +119,7 @@ async def test_api_interpolation_at_time_post_success( # ) # mocker = mocker_setup(mocker, MOCK_METHOD, test_data) -# async with AsyncClient(app=app, base_url=BASE_URL) as ac: +# async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: # response = await ac.post( # MOCK_API_NAME, # headers=TEST_HEADERS, @@ -145,7 +145,7 @@ async def test_api_interpolation_at_time_post_error( Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, diff --git a/tests/api/v1/test_api_latest.py b/tests/api/v1/test_api_latest.py index 1bc3b29a3..c89e4571d 100644 --- a/tests/api/v1/test_api_latest.py +++ b/tests/api/v1/test_api_latest.py @@ -29,7 +29,7 @@ MOCK_TAG_MAPPING_EMPTY, MOCK_MAPPING_ENDPOINT_URL, ) -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport from src.api.v1 import app MOCK_METHOD = "src.sdk.python.rtdip_sdk.queries.time_series.latest.get" @@ -43,7 +43,7 @@ async def test_api_latest_get_tags_provided_success( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_latest"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=METADATA_MOCKED_PARAMETER_DICT ) @@ -58,7 +58,7 @@ async def test_api_latest_get_no_good_values_tags_provided_success( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_latest"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=METADATA_MOCKED_PARAMETER_DICT ) @@ -75,7 +75,7 @@ async def test_api_latest_get_no_tags_provided_success( METADATA_MOCKED_PARAMETER_NO_TAG_DICT = METADATA_MOCKED_PARAMETER_DICT.copy() METADATA_MOCKED_PARAMETER_NO_TAG_DICT.pop("tag_name") - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -90,7 +90,7 @@ async def test_api_latest_get_no_tags_provided_success( async def test_api_latest_get_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_latest"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -113,7 +113,7 @@ async def test_api_latest_get_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=METADATA_MOCKED_PARAMETER_DICT ) @@ -128,7 +128,7 @@ async def test_api_latest_post_tags_provided_success( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_latest"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -148,7 +148,7 @@ async def test_api_latest_post_no_tags_provided_error( METADATA_MOCKED_PARAMETER_NO_TAG_DICT = METADATA_MOCKED_PARAMETER_DICT.copy() METADATA_MOCKED_PARAMETER_NO_TAG_DICT.pop("tag_name") - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -166,7 +166,7 @@ async def test_api_latest_post_no_tags_provided_error( async def test_api_latest_post_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_latest"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -190,7 +190,7 @@ async def test_api_raw_post_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -238,7 +238,7 @@ async def test_api_latest_get_lookup_success(mocker: MockerFixture): modified_param_dict = METADATA_MOCKED_PARAMETER_DICT.copy() del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=modified_param_dict ) @@ -288,7 +288,7 @@ async def test_api_latest_post_lookup_success(mocker: MockerFixture): modified_param_dict = METADATA_MOCKED_PARAMETER_DICT.copy() del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -342,7 +342,7 @@ async def test_api_latest_get_lookup_no_tag_map_error(mocker: MockerFixture): modified_param_dict["tagname"] = ["NonExistentTag"] del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=modified_param_dict ) diff --git a/tests/api/v1/test_api_metadata.py b/tests/api/v1/test_api_metadata.py index 966014ecb..afcf39a9a 100644 --- a/tests/api/v1/test_api_metadata.py +++ b/tests/api/v1/test_api_metadata.py @@ -28,7 +28,7 @@ MOCK_TAG_MAPPING_EMPTY, MOCK_MAPPING_ENDPOINT_URL, ) -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport from src.api.v1 import app MOCK_METHOD = "src.sdk.python.rtdip_sdk.queries.metadata.get" @@ -45,7 +45,7 @@ async def test_api_metadata_get_tags_provided_success( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_metadata"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=METADATA_MOCKED_PARAMETER_DICT ) @@ -62,7 +62,7 @@ async def test_api_metadata_get_no_tags_provided_success( METADATA_MOCKED_PARAMETER_NO_TAG_DICT = METADATA_MOCKED_PARAMETER_DICT.copy() METADATA_MOCKED_PARAMETER_NO_TAG_DICT.pop("tag_name") - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -77,7 +77,7 @@ async def test_api_metadata_get_no_tags_provided_success( async def test_api_metadata_get_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_metadata"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -100,7 +100,7 @@ async def test_api_metadata_get_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=METADATA_MOCKED_PARAMETER_DICT ) @@ -115,7 +115,7 @@ async def test_api_metadata_post_tags_provided_success( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_metadata"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -135,7 +135,7 @@ async def test_api_metadata_post_no_tags_provided_error( METADATA_MOCKED_PARAMETER_NO_TAG_DICT = METADATA_MOCKED_PARAMETER_DICT.copy() METADATA_MOCKED_PARAMETER_NO_TAG_DICT.pop("tag_name") - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -153,7 +153,7 @@ async def test_api_metadata_post_no_tags_provided_error( async def test_api_metadata_post_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_metadata"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -177,7 +177,7 @@ async def test_api_metadata_post_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -212,7 +212,7 @@ async def test_api_metadata_get_lookup_success(mocker: MockerFixture): modified_param_dict = METADATA_MOCKED_PARAMETER_DICT.copy() del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=modified_param_dict ) @@ -249,7 +249,7 @@ async def test_api_metadata_post_lookup_success(mocker: MockerFixture): modified_param_dict = METADATA_MOCKED_PARAMETER_DICT.copy() del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -290,7 +290,7 @@ async def test_api_metadata_get_lookup_no_tag_map_error(mocker: MockerFixture): modified_param_dict["tagname"] = ["NonExistentTag"] del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=modified_param_dict ) diff --git a/tests/api/v1/test_api_plot.py b/tests/api/v1/test_api_plot.py index 52560e293..f86e103e7 100644 --- a/tests/api/v1/test_api_plot.py +++ b/tests/api/v1/test_api_plot.py @@ -25,7 +25,7 @@ TEST_HEADERS, BASE_URL, ) -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport from src.api.v1 import app MOCK_METHOD = "src.sdk.python.rtdip_sdk.queries.time_series.plot.get" @@ -37,7 +37,7 @@ async def test_api_plot_get_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_plot"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=PLOT_MOCKED_PARAMETER_DICT ) @@ -50,7 +50,7 @@ async def test_api_plot_get_success(mocker: MockerFixture, api_test_data): async def test_api_plot_get_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_plot"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -73,7 +73,7 @@ async def test_api_pot_get_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=PLOT_MOCKED_PARAMETER_DICT ) @@ -86,7 +86,7 @@ async def test_api_pot_get_error(mocker: MockerFixture, api_test_data): async def test_api_plot_post_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_plot"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -102,7 +102,7 @@ async def test_api_plot_post_success(mocker: MockerFixture, api_test_data): async def test_api_plot_post_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_plot"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -126,7 +126,7 @@ async def test_api_plot_post_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, diff --git a/tests/api/v1/test_api_raw.py b/tests/api/v1/test_api_raw.py index afde6d60b..539439edf 100644 --- a/tests/api/v1/test_api_raw.py +++ b/tests/api/v1/test_api_raw.py @@ -29,7 +29,7 @@ ) from pandas.io.json import build_table_schema import pandas as pd -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport from src.api.v1 import app MOCK_METHOD = "src.sdk.python.rtdip_sdk.queries.time_series.raw.get" @@ -41,7 +41,7 @@ async def test_api_raw_get_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_raw"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=RAW_MOCKED_PARAMETER_DICT ) @@ -54,7 +54,7 @@ async def test_api_raw_get_success(mocker: MockerFixture, api_test_data): async def test_api_raw_get_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_raw"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=RAW_MOCKED_PARAMETER_ERROR_DICT ) @@ -75,7 +75,7 @@ async def test_api_raw_get_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=RAW_MOCKED_PARAMETER_DICT ) @@ -88,7 +88,7 @@ async def test_api_raw_get_error(mocker: MockerFixture, api_test_data): async def test_api_raw_post_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_raw"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -104,7 +104,7 @@ async def test_api_raw_post_success(mocker: MockerFixture, api_test_data): async def test_api_raw_post_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_raw"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -128,7 +128,7 @@ async def test_api_raw_post_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -172,7 +172,7 @@ async def test_api_raw_get_lookup_success(mocker: MockerFixture, api_test_data): modified_param_dict = RAW_MOCKED_PARAMETER_DICT.copy() del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=modified_param_dict ) @@ -217,7 +217,7 @@ async def test_api_raw_post_lookup_success(mocker: MockerFixture): modified_param_dict = RAW_POST_MOCKED_PARAMETER_DICT.copy() del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -267,7 +267,7 @@ async def test_api_raw_get_lookup_no_tag_map_error(mocker: MockerFixture): modified_param_dict["tagname"] = ["NonExistentTag"] del modified_param_dict["business_unit"] - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: actual = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=modified_param_dict ) diff --git a/tests/api/v1/test_api_resample.py b/tests/api/v1/test_api_resample.py index 2baa5a6fc..59d62814d 100644 --- a/tests/api/v1/test_api_resample.py +++ b/tests/api/v1/test_api_resample.py @@ -25,7 +25,7 @@ TEST_HEADERS, BASE_URL, ) -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport from src.api.v1 import app MOCK_METHOD = "src.sdk.python.rtdip_sdk.queries.time_series.resample.get" @@ -37,7 +37,7 @@ async def test_api_resample_get_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=RESAMPLE_MOCKED_PARAMETER_DICT ) @@ -50,7 +50,7 @@ async def test_api_resample_get_success(mocker: MockerFixture, api_test_data): async def test_api_resample_get_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -73,7 +73,7 @@ async def test_api_resample_get_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=RESAMPLE_MOCKED_PARAMETER_DICT ) @@ -86,7 +86,7 @@ async def test_api_resample_get_error(mocker: MockerFixture, api_test_data): async def test_api_resample_post_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -102,7 +102,7 @@ async def test_api_resample_post_success(mocker: MockerFixture, api_test_data): async def test_api_resample_post_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -126,7 +126,7 @@ async def test_api_resample_post_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, diff --git a/tests/api/v1/test_api_sql.py b/tests/api/v1/test_api_sql.py index 1ea88482e..cecc98de4 100644 --- a/tests/api/v1/test_api_sql.py +++ b/tests/api/v1/test_api_sql.py @@ -25,7 +25,7 @@ BASE_URL, ) from pandas.io.json import build_table_schema -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport from src.api.v1 import app MOCK_METHOD = "src.sdk.python.rtdip_sdk.queries.sql.sql_query.SQLQueryBuilder.get" @@ -37,7 +37,7 @@ async def test_api_sql_post_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_raw"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -53,7 +53,7 @@ async def test_api_sql_post_success(mocker: MockerFixture, api_test_data): async def test_api_sql_post_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_raw"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -77,7 +77,7 @@ async def test_api_sql_post_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, diff --git a/tests/api/v1/test_api_summary.py b/tests/api/v1/test_api_summary.py index 88c2f1cbe..5ffa1290b 100644 --- a/tests/api/v1/test_api_summary.py +++ b/tests/api/v1/test_api_summary.py @@ -24,7 +24,7 @@ TEST_HEADERS, BASE_URL, ) -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport from src.api.v1 import app import json @@ -37,7 +37,7 @@ async def test_api_summary_get_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_summary"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=SUMMARY_MOCKED_PARAMETER_DICT ) @@ -50,7 +50,7 @@ async def test_api_summary_get_success(mocker: MockerFixture, api_test_data): async def test_api_summary_get_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_summary"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -73,7 +73,7 @@ async def test_api_summary_get_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=SUMMARY_MOCKED_PARAMETER_DICT ) @@ -86,7 +86,7 @@ async def test_api_summary_get_error(mocker: MockerFixture, api_test_data): async def test_api_summary_post_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_summary"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -102,7 +102,7 @@ async def test_api_summary_post_success(mocker: MockerFixture, api_test_data): async def test_api_summary_post_validation_error(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_summary"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -126,7 +126,7 @@ async def test_api_summary_post_error(mocker: MockerFixture, api_test_data): Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, diff --git a/tests/api/v1/test_api_time_weighted_average.py b/tests/api/v1/test_api_time_weighted_average.py index 99eb19c8d..e0018f71a 100644 --- a/tests/api/v1/test_api_time_weighted_average.py +++ b/tests/api/v1/test_api_time_weighted_average.py @@ -25,7 +25,7 @@ TEST_HEADERS, BASE_URL, ) -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport from src.api.v1 import app MOCK_METHOD = "src.sdk.python.rtdip_sdk.queries.time_series.time_weighted_average.get" @@ -39,7 +39,7 @@ async def test_api_time_weighted_average_get_success( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -56,7 +56,7 @@ async def test_api_time_weighted_average_get_validation_error( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -81,7 +81,7 @@ async def test_api_time_weighted_average_get_error( Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, @@ -98,7 +98,7 @@ async def test_api_time_weighted_average_post_success( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -116,7 +116,7 @@ async def test_api_time_weighted_average_post_validation_error( ): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, @@ -142,7 +142,7 @@ async def test_api_time_weighted_average_post_error( Exception("Error Connecting to Database"), ) - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.post( MOCK_API_NAME, headers=TEST_HEADERS, diff --git a/tests/api/v1/test_api_utilities.py b/tests/api/v1/test_api_utilities.py index fb3042a6b..dfa4c4d42 100644 --- a/tests/api/v1/test_api_utilities.py +++ b/tests/api/v1/test_api_utilities.py @@ -14,7 +14,7 @@ import pytest from pytest_mock import MockerFixture -from httpx import AsyncClient +from httpx import AsyncClient, ASGITransport from tests.api.v1.api_test_objects import BASE_URL from src.api.v1 import app @@ -22,7 +22,7 @@ async def test_api_home(mocker: MockerFixture): - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get("/") assert response.status_code == 307 @@ -30,14 +30,14 @@ async def test_api_home(mocker: MockerFixture): async def test_api_docs(mocker: MockerFixture): - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get("/docs") assert response.status_code == 200 async def test_api_redoc(mocker: MockerFixture): - async with AsyncClient(app=app, base_url=BASE_URL) as ac: + async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get("/redoc") assert response.status_code == 200 From 9730324a38bbe4496120ca73a5b392ff5a2f0b11 Mon Sep 17 00:00:00 2001 From: Dominik Hoffmann Date: Wed, 4 Dec 2024 15:50:01 +0100 Subject: [PATCH 8/9] #84: Fixed wrong passing of FastAPI into httpx async client Signed-off-by: Dominik Hoffmann --- tests/api/v1/test_api_circular_average.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/api/v1/test_api_circular_average.py b/tests/api/v1/test_api_circular_average.py index 9cbbb3b15..ec09d55c1 100644 --- a/tests/api/v1/test_api_circular_average.py +++ b/tests/api/v1/test_api_circular_average.py @@ -43,13 +43,11 @@ async def test_api_circular_average_get_success(mocker: MockerFixture, api_test_data): mocker = mocker_setup(mocker, MOCK_METHOD, api_test_data["mock_data_agg"]) - async with AsyncClient(transport=ASGITransport(app), base_url=BASE_URL) as ac: response = await ac.get( MOCK_API_NAME, headers=TEST_HEADERS, params=CIRCULAR_AVERAGE_MOCKED_PARAMETER_DICT, - ) actual = response.text From 36f377cf68c55405fcc94605e28626021520f0d7 Mon Sep 17 00:00:00 2001 From: Dominik Hoffmann Date: Wed, 4 Dec 2024 16:05:41 +0100 Subject: [PATCH 9/9] #84: Changed back files that were taken from core repo Signed-off-by: Dominik Hoffmann --- .github/workflows/develop.yml | 2 +- .github/workflows/release.yml | 4 ++-- .github/workflows/sonarcloud_reusable.yml | 6 ++--- .github/workflows/stale_issues.yml | 22 +++++++++++++++++++ .github/workflows/test.yml | 14 ++++++++++-- docs/getting-started/installation.md | 4 ++-- .../rtdip/introduction/prerequisites.md | 2 +- environment.yml | 6 ++--- setup.py | 3 ++- 9 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/stale_issues.yml diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 3476ae2f6..cc272246e 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -48,7 +48,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: 3.12 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 815f58056..f223d44f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: 3.12 - name: Install dependencies run: | python -m pip install --upgrade pip @@ -101,7 +101,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: 3.12 - name: Install Boost run: | diff --git a/.github/workflows/sonarcloud_reusable.yml b/.github/workflows/sonarcloud_reusable.yml index 3c358efd1..f9a8ba878 100644 --- a/.github/workflows/sonarcloud_reusable.yml +++ b/.github/workflows/sonarcloud_reusable.yml @@ -47,7 +47,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ["3.11"] + python-version: ["3.12"] pyspark: ["3.5.3"] delta-spark: ["3.0.0"] runs-on: ${{ matrix.os }} @@ -99,7 +99,7 @@ jobs: - name: Override Coverage Source Path for Sonar run: | - sed -i "s/\/home\/runner\/work\/core\/core<\/source>/\/github\/workspace<\/source>/g" /home/runner/work/core/core/coverage-reports/coverage-unittests.xml + sed -i "s/\/home\/runner\/work\/core\/core<\/source>/\/github\/workspace<\/source>/g" coverage-reports/coverage-unittests.xml - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master @@ -108,7 +108,7 @@ jobs: -Dsonar.organization=rtdip -Dsonar.projectKey=rtdip_core -Dsonar.python.coverage.reportPaths=coverage-reports/coverage-unittests.xml - -Dsoner.python.version=3.11 + -Dsoner.python.version=3.12 -Dsonar.scm.revision=${{ inputs.HEAD_SHA }} -Dsonar.pullrequest.key=${{ inputs.PR_NUMBER }} -Dsonar.pullrequest.branch=${{ inputs.PR_HEAD_REF }} diff --git a/.github/workflows/stale_issues.yml b/.github/workflows/stale_issues.yml new file mode 100644 index 000000000..d5cd3cf15 --- /dev/null +++ b/.github/workflows/stale_issues.yml @@ -0,0 +1,22 @@ +name: Close inactive issues +on: + schedule: + - cron: "30 1 * * *" + +jobs: + close-issues: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v5 + with: + days-before-issue-stale: 30 + days-before-issue-close: 14 + stale-issue-label: "stale" + stale-issue-message: "This issue is stale because it has been open for 30 days with no activity." + close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale." + days-before-pr-stale: -1 + days-before-pr-close: -1 + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 53af11eeb..500ad212e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] pyspark: ["3.3.0", "3.3.1", "3.3.2", "3.4.0", "3.4.1", "3.5.0", "3.5.1"] exclude: - pyspark: "3.5.1" @@ -51,6 +51,16 @@ jobs: python-version: "3.11" - pyspark: "3.3.0" python-version: "3.11" + - pyspark: "3.4.1" + python-version: "3.12" + - pyspark: "3.4.0" + python-version: "3.12" + - pyspark: "3.3.2" + python-version: "3.12" + - pyspark: "3.3.1" + python-version: "3.12" + - pyspark: "3.3.0" + python-version: "3.12" include: - pyspark: "3.3.0" delta-spark: "2.2.0" @@ -108,7 +118,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ["3.11"] + python-version: ["3.12"] pyspark: ["3.5.3"] delta-spark: ["3.0.0"] runs-on: ${{ matrix.os }} diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index e1c24a879..9045d2f6a 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -90,7 +90,7 @@ To use RTDIP Pipelines components in your own environment that leverages [pyspar - conda-forge - defaults dependencies: - - python==3.11 + - python==3.12 - pip - openjdk==11.0.15 - pip: @@ -182,7 +182,7 @@ The following provides examples of how to install the RTDIP SDK package with Pip - conda-forge - defaults dependencies: - - python==3.11 + - python==3.12 - pip - pip: - rtdip-sdk diff --git a/docs/university/essentials/rtdip/introduction/prerequisites.md b/docs/university/essentials/rtdip/introduction/prerequisites.md index 7868e45ae..7bb1bd49e 100644 --- a/docs/university/essentials/rtdip/introduction/prerequisites.md +++ b/docs/university/essentials/rtdip/introduction/prerequisites.md @@ -3,7 +3,7 @@ Before you begin the course, ensure you obtain the following prerequisites(from your istructor or from your environment if you are doing this on your own): ## Development Environment -- Python >=3.9,<=3.11 +- Python >=3.9,<=3.12 - An IDE such as Visual Studio Code or PyCharm - Postman via the app, web browser or as an extension on Visual Studio Code diff --git a/environment.yml b/environment.yml index 8e3a1fccd..53682960a 100644 --- a/environment.yml +++ b/environment.yml @@ -18,7 +18,7 @@ channels: - conda-forge - defaults dependencies: - - python>=3.9,<3.12 + - python>=3.9,<3.13 - importlib-metadata>=7.0.0 - jinja2>=3.1.4 - pytest==7.4.0 @@ -35,7 +35,7 @@ dependencies: - azure-keyvault-secrets>=4.7.0,<5.0.0 - azure-mgmt-storage>=21.0.0 - boto3>=1.28.2,<2.0.0 - - pyodbc>=4.0.39,<5.0.0 + - pyodbc>=4.0.39,<5.3.0 - fastapi>=0.110.0,<1.0.0 - httpx>=0.24.1,<1.0.0 - pyspark>=3.3.0,<3.6.0 @@ -87,4 +87,4 @@ dependencies: - eth-typing>=4.2.3,<5.0.0 - pandas>=1.5.2,<2.2.0 - moto[s3]>=5.0.16,<6.0.0 - - pyarrow>=14.0.1,<17.0.0 + - pyarrow>=14.0.1,<17.0.0 \ No newline at end of file diff --git a/setup.py b/setup.py index e1ab31df3..1f3892e12 100644 --- a/setup.py +++ b/setup.py @@ -89,6 +89,7 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ], project_urls={ "Issue Tracker": "https://github.com/rtdip/core/issues", @@ -99,7 +100,7 @@ package_dir={"": "src/sdk/python"}, include_package_data=True, packages=find_packages(where="src/sdk/python"), - python_requires=">=3.9, <3.12", + python_requires=">=3.9, <3.13", install_requires=INSTALL_REQUIRES, extras_require=EXTRAS_DEPENDENCIES, setup_requires=["pytest-runner", "setuptools_scm"],