From 7ae87740bf26f13552164266699eb95d2e61021e Mon Sep 17 00:00:00 2001 From: Philip Usher Date: Fri, 26 Jan 2024 15:00:24 +0000 Subject: [PATCH 01/17] updated doc build process --- README.rst | 1 + doc/source/index.rst | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 1c11e714..7f608595 100644 --- a/README.rst +++ b/README.rst @@ -38,6 +38,7 @@ A Python wrapper for Ansys conceptev core .. WARNING:: The below is autogenerated for pyansys and needs updating to get started check index.rst + How to install -------------- diff --git a/doc/source/index.rst b/doc/source/index.rst index ecb16f5a..c31d2bd7 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -21,7 +21,7 @@ You need to: - `Understand the API` at https://dev-conceptev.awsansys3np.onscale.com/api/docs Install the library -^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^ #. Start by cloning this repository: @@ -38,13 +38,14 @@ Install the library #. Install dependencies using poetry: .. code:: bash - poetry install + poetry install Configure Session using .env file ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ you need to create a .env file to keep your password and other configurable data it should look something like this: .. code-block:: bash + CONCEPTEV_USERNAME = joe.blogs@my_work.com CONCEPTEV_PASSWORD = sup3r_s3cr3t_passw0rd OCM_URL = https://test.portal.onscale.com/api @@ -57,6 +58,7 @@ Get a token Import the main module and use get_token this should return a random string from the servers to get you access. .. code-block:: python + import pyconceptev-core.main as pyconceptev #Test this token = pyconceptev.get_token() @@ -67,6 +69,7 @@ Create a client You need to create a client that can access and talk to the api. You can use the health check api to check your connection. .. code-block:: python + import pythonconceptev-core.main as pyconceptev with pyconceptev.create_client(token,concept_id) as client: @@ -81,6 +84,7 @@ You can use the verb functions created in this module to make things simpler. To create a configuration we need to use the verb `post` with route `/configurations` and add the `data` from the schema. .. code-block:: python + pyconcetpev.create(client,'/configurations',data={"name": "New Aero Config", "drag_coefficient": 1, "cross_sectional_area": 2, From ec5a599f1a0a7af5103db52fb354e29a75c443c5 Mon Sep 17 00:00:00 2001 From: Philip Usher Date: Fri, 26 Jan 2024 15:16:24 +0000 Subject: [PATCH 02/17] updated doc build process --- doc/source/index.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index c31d2bd7..28d3f8fd 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -9,7 +9,7 @@ ConceptEV Specific Instructions ------------------------------- .. WARNING:: - Beware this api is in a state of rapid to change and should be considered unstable. + Beware this API is in a state of rapid to change and should be considered unstable. @@ -55,7 +55,7 @@ you need to create a .env file to keep your password and other configurable data Get a token ^^^^^^^^^^^ -Import the main module and use get_token this should return a random string from the servers to get you access. +Import the main module and use :code:`get_token` this should return a random string from the servers to get you access. .. code-block:: python @@ -66,7 +66,7 @@ Import the main module and use get_token this should return a random string from Create a client ^^^^^^^^^^^^^^^ -You need to create a client that can access and talk to the api. You can use the health check api to check your connection. +You need to create a client that can access and talk to the API. You can use the health check API to check your connection. .. code-block:: python @@ -78,7 +78,7 @@ You need to create a client that can access and talk to the api. You can use the Understand the API ^^^^^^^^^^^^^^^^^^ -Use the api documentation at https://dev-conceptev.awsansys3np.onscale.com/api/docs +Use the API documentation at https://dev-conceptev.awsansys3np.onscale.com/api/docs This shows you which verbs and which routes/paths are available and what inputs/outputs they have. You can use the verb functions created in this module to make things simpler. From f39f7766cceda9d38736b100f2a28b7bd6654f41 Mon Sep 17 00:00:00 2001 From: Philip Usher Date: Mon, 19 Feb 2024 08:55:37 +0000 Subject: [PATCH 03/17] updated for additional changes with design_instance_id --- src/ansys/conceptev/core/main.py | 4 ++-- tests/test_main.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ansys/conceptev/core/main.py b/src/ansys/conceptev/core/main.py index fdeefd42..b8ccf268 100644 --- a/src/ansys/conceptev/core/main.py +++ b/src/ansys/conceptev/core/main.py @@ -53,7 +53,7 @@ def get_token() -> str: return response.json()["accessToken"] -def get_http_client(token: str, concept_id: str | None = None) -> httpx.Client: +def get_http_client(token: str, design_instance_id: str | None = None) -> httpx.Client: """Get a http client. This http client creates and maintains the connection and is more performant than @@ -61,7 +61,7 @@ def get_http_client(token: str, concept_id: str | None = None) -> httpx.Client: """ base_url = os.environ["CONCEPTEV_URL"] if concept_id: - params = {"concept_id": concept_id} + params = {"design_instance_id": design_instance_id} else: params = None return httpx.Client(headers={"Authorization": token}, params=params, base_url=base_url) diff --git a/tests/test_main.py b/tests/test_main.py index 25b7cb78..cac7b9f3 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -22,8 +22,8 @@ def test_get_token(httpx_mock: HTTPXMock): @pytest.fixture def client(): fake_token = "value1" - concept_id = "123" - client = main.get_http_client(fake_token, concept_id=concept_id) + design_instance_id = "123" + client = main.get_http_client(fake_token, design_instance_id=design_instance_id) return client From a9cb771a102b7f0886babf321a36b56230e6a114 Mon Sep 17 00:00:00 2001 From: Philip Usher Date: Tue, 5 Mar 2024 12:17:13 +0000 Subject: [PATCH 04/17] improved docs --- doc/source/index.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index 28d3f8fd..a4a871ea 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -29,7 +29,7 @@ Install the library git clone https://github.com/ansys-internal/pyconceptev-core -#. Install poetry: +#. Install poetry following your preferred route. See https://python-poetry.org/docs/#installation for example using pipx: .. code:: bash @@ -40,6 +40,11 @@ Install the library poetry install +#. Activate the poetry environment: + .. code:: bash + + poetry shell + Configure Session using .env file ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -59,7 +64,7 @@ Import the main module and use :code:`get_token` this should return a random str .. code-block:: python - import pyconceptev-core.main as pyconceptev #Test this + import ansys.conceptev.core.main as pyconceptev token = pyconceptev.get_token() From 64347d61d124372adb13da9fa69ee02b4f4ae54e Mon Sep 17 00:00:00 2001 From: Philip Date: Tue, 5 Mar 2024 12:32:00 +0000 Subject: [PATCH 05/17] Update ci_cd.yml --- .github/workflows/ci_cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 32251c71..f4185002 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -43,7 +43,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python-version: [3.8,3.9,3.10,3.11] + python-version: [3.9,3.10,3.11] steps: - uses: ansys/actions/build-wheelhouse@v5 with: @@ -59,7 +59,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - python-version: [3.8,3.9,3.10,3.11] + python-version: [3.9,3.10,3.11] fail-fast: false steps: - uses: ansys/actions/tests-pytest@v5 From c92f63c1a89829fc9a5ef177e367d8a98f6fd76b Mon Sep 17 00:00:00 2001 From: Philip Usher Date: Tue, 5 Mar 2024 12:38:21 +0000 Subject: [PATCH 06/17] fix style issue changed to string in python_version --- .github/workflows/ci_cd.yml | 4 ++-- doc/source/index.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index f4185002..d6e2321f 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -43,7 +43,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python-version: [3.9,3.10,3.11] + python-version: ["3.9","3.10","3.11"] steps: - uses: ansys/actions/build-wheelhouse@v5 with: @@ -59,7 +59,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - python-version: [3.9,3.10,3.11] + python-version: ["3.9","3.10","3.11"] fail-fast: false steps: - uses: ansys/actions/tests-pytest@v5 diff --git a/doc/source/index.rst b/doc/source/index.rst index a4a871ea..bb08b9c3 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -29,7 +29,7 @@ Install the library git clone https://github.com/ansys-internal/pyconceptev-core -#. Install poetry following your preferred route. See https://python-poetry.org/docs/#installation for example using pipx: +#. Install poetry following your preferred route. See https://python-poetry.org/docs/#installation for example using `pipx`: .. code:: bash From 6f8045b9dcf396ff628a7df6713de8ef408b35a6 Mon Sep 17 00:00:00 2001 From: Philip Usher Date: Tue, 5 Mar 2024 12:42:43 +0000 Subject: [PATCH 07/17] updated style --- doc/source/index.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index bb08b9c3..372d7d91 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -29,13 +29,14 @@ Install the library git clone https://github.com/ansys-internal/pyconceptev-core -#. Install poetry following your preferred route. See https://python-poetry.org/docs/#installation for example using `pipx`: +#. Install poetry following your preferred route. See https://python-poetry.org/docs/#installation for example using :code:`pipx`: .. code:: bash pipx install poetry #. Install dependencies using poetry: + .. code:: bash poetry install From 001c9d42e5541446a745bd1b8a374ce0d0bb6582 Mon Sep 17 00:00:00 2001 From: Philip Usher Date: Tue, 5 Mar 2024 15:33:20 +0000 Subject: [PATCH 08/17] removed badges without links while in ansys-internal --- README.rst | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/README.rst b/README.rst index 7f608595..fb6f1206 100644 --- a/README.rst +++ b/README.rst @@ -1,27 +1,11 @@ Pyconceptev core ================ -|pyansys| |python| |pypi| |GH-CI| |codecov| |MIT| |black| +|pyansys| |MIT| |black| .. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC :target: https://docs.pyansys.com/ :alt: PyAnsys -.. |python| image:: https://img.shields.io/pypi/pyversions/pyconceptev-core?logo=pypi - :target: https://pypi.org/project/pyconceptev-core/ - :alt: Python - -.. |pypi| image:: https://img.shields.io/pypi/v/pyconceptev-core.svg?logo=python&logoColor=white - :target: https://pypi.org/project/pyconceptev-core - :alt: PyPI - -.. |codecov| image:: https://codecov.io/gh/ansys/pyconceptev-core/branch/main/graph/badge.svg - :target: https://codecov.io/gh/ansys/pyconceptev-core - :alt: Codecov - -.. |GH-CI| image:: https://github.com/ansys/pyconceptev-core/actions/workflows/ci_cd.yml/badge.svg - :target: https://github.com/ansys/pyconceptev-core/actions/workflows/ci_cd.yml - :alt: GH-CI - .. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg :target: https://opensource.org/licenses/MIT :alt: MIT @@ -30,6 +14,25 @@ Pyconceptev core :target: https://github.com/psf/black :alt: Black +.. + some missing stuff from the badges while in development + .. |python| image:: https://img.shields.io/pypi/pyversions/pyconceptev-core?logo=pypi + :target: https://pypi.org/project/pyconceptev-core/ + :alt: Python + + .. |pypi| image:: https://img.shields.io/pypi/v/pyconceptev-core.svg?logo=python&logoColor=white + :target: https://pypi.org/project/pyconceptev-core + :alt: PyPI + + .. |codecov| image:: https://codecov.io/gh/ansys/pyconceptev-core/branch/main/graph/badge.svg + :target: https://codecov.io/gh/ansys/pyconceptev-core + :alt: Codecov + + .. |GH-CI| image:: https://github.com/ansys/pyconceptev-core/actions/workflows/ci_cd.yml/badge.svg + :target: https://github.com/ansys/pyconceptev-core/actions/workflows/ci_cd.yml + :alt: GH-CI + + A Python wrapper for Ansys conceptev core From b7cf94e7a0f7d06721886e53afe75d1e54cb3e28 Mon Sep 17 00:00:00 2001 From: Philip Usher Date: Tue, 5 Mar 2024 16:01:44 +0000 Subject: [PATCH 09/17] update to fix test with new api --- src/ansys/conceptev/core/main.py | 2 +- tests/test_main.py | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/ansys/conceptev/core/main.py b/src/ansys/conceptev/core/main.py index b8ccf268..1456195a 100644 --- a/src/ansys/conceptev/core/main.py +++ b/src/ansys/conceptev/core/main.py @@ -60,7 +60,7 @@ def get_http_client(token: str, design_instance_id: str | None = None) -> httpx. re-creating that connection for each call. """ base_url = os.environ["CONCEPTEV_URL"] - if concept_id: + if design_instance_id: params = {"design_instance_id": design_instance_id} else: params = None diff --git a/tests/test_main.py b/tests/test_main.py index cac7b9f3..93fc9636 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -29,12 +29,12 @@ def client(): def test_get_http_client(): fake_token = "value1" - concept_id = "123" - client = main.get_http_client(fake_token, concept_id=concept_id) + design_instance_id = "123" + client = main.get_http_client(fake_token, design_instance_id=design_instance_id) assert isinstance(client, httpx.Client) assert client.headers["authorization"] == fake_token assert str(client.base_url).strip("/") == os.environ["CONCEPTEV_URL"].strip("/") - assert client.params["concept_id"] == concept_id + assert client.params["design_instance_id"] == design_instance_id def test_processed_response(): @@ -53,7 +53,9 @@ def test_processed_response(): def test_get(httpx_mock: HTTPXMock, client: httpx.Client): example_results = [{"name": "aero_mock_response"}, {"name": "aero_mock_response2"}] httpx_mock.add_response( - url=f"{conceptev_url}/configurations?concept_id=123", method="get", json=example_results + url=f"{conceptev_url}/configurations?design_instance_id=123", + method="get", + json=example_results, ) results = main.get(client, "/configurations") @@ -63,7 +65,7 @@ def test_get(httpx_mock: HTTPXMock, client: httpx.Client): def test_post(httpx_mock: HTTPXMock, client: httpx.Client): example_aero = {"name": "aero_mock_response"} httpx_mock.add_response( - url=f"{conceptev_url}/configurations?concept_id=123", + url=f"{conceptev_url}/configurations?design_instance_id=123", method="post", match_json=example_aero, json=example_aero, @@ -75,12 +77,12 @@ def test_post(httpx_mock: HTTPXMock, client: httpx.Client): def test_delete(httpx_mock: HTTPXMock, client: httpx.Client): httpx_mock.add_response( - url=f"{conceptev_url}/configurations/456?concept_id=123", + url=f"{conceptev_url}/configurations/456?design_instance_id=123", method="delete", status_code=204, ) httpx_mock.add_response( - url=f"{conceptev_url}/configurations/489?concept_id=123", + url=f"{conceptev_url}/configurations/489?design_instance_id=123", method="delete", status_code=404, ) @@ -220,7 +222,7 @@ def test_create_submit_job(httpx_mock: HTTPXMock, client: httpx.Client): } mocked_job = ({"job": "data"}, {"stuff": "in file"}) httpx_mock.add_response( - url=f"{conceptev_url}/jobs?concept_id=123", match_json=job_input, json=mocked_job + url=f"{conceptev_url}/jobs?design_instance_id=123", match_json=job_input, json=mocked_job ) mocked_info = "job info" mocked_job_start = { @@ -230,7 +232,7 @@ def test_create_submit_job(httpx_mock: HTTPXMock, client: httpx.Client): "hpc_id": hpc_id, } httpx_mock.add_response( - url=f"{conceptev_url}/jobs:start?concept_id=123", + url=f"{conceptev_url}/jobs:start?design_instance_id=123", match_json=mocked_job_start, json=mocked_info, ) @@ -242,7 +244,7 @@ def test_put(httpx_mock: HTTPXMock, client: httpx.Client): example_aero = {"name": "aero_mock_response"} mocked_id = "345" httpx_mock.add_response( - url=f"{conceptev_url}/configurations/{mocked_id}?concept_id=123", + url=f"{conceptev_url}/configurations/{mocked_id}?design_instance_id=123", method="put", match_json=example_aero, json=example_aero, @@ -264,7 +266,7 @@ def test_read_results(httpx_mock: HTTPXMock, client: httpx.Client): example_job_info = {"job": "mocked_job"} example_results = {"results": "returned"} httpx_mock.add_response( - url=f"{conceptev_url}/jobs:result?concept_id=123", + url=f"{conceptev_url}/jobs:result?design_instance_id=123", method="post", match_json=example_job_info, json=example_results, @@ -282,7 +284,7 @@ def test_post_file(mocker, httpx_mock: HTTPXMock, client: httpx.Client): filename = "filename" params = {"param1": "one"} httpx_mock.add_response( - url=f"{conceptev_url}/configurations:from_file?concept_id=123¶m1=one", + url=f"{conceptev_url}/configurations:from_file?design_instance_id=123¶m1=one", method="post", json=file_post_response_data, ) From e9190bb9be355b9b2883508bee74606201cc8967 Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 8 Mar 2024 13:11:20 +0000 Subject: [PATCH 10/17] udpate workflow with new env variable --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index a952e51e..fe46f4bd 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -62,7 +62,7 @@ jobs: python-version: ["3.9","3.10","3.11"] fail-fast: false steps: - - uses: philipjusher/actions/tests-pytest@patch-1 + - uses: ansys/actions/tests-pytest@5 with: pytest-extra-args: "--cov=ansys --cov-report=term --cov-report=html:.cov/html" From 3d6d29fa107d8f23a9b738d112cb6745f0994a79 Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 8 Mar 2024 13:27:28 +0000 Subject: [PATCH 11/17] typo in the v number --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index fe46f4bd..d6e2321f 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -62,7 +62,7 @@ jobs: python-version: ["3.9","3.10","3.11"] fail-fast: false steps: - - uses: ansys/actions/tests-pytest@5 + - uses: ansys/actions/tests-pytest@v5 with: pytest-extra-args: "--cov=ansys --cov-report=term --cov-report=html:.cov/html" From 5b8c22e2b25d7b825282ff49921dd31659972a5b Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 8 Mar 2024 16:12:20 +0000 Subject: [PATCH 12/17] added env variables --- .github/workflows/ci_cd.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index d6e2321f..18a064cb 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -65,6 +65,12 @@ jobs: - uses: ansys/actions/tests-pytest@v5 with: pytest-extra-args: "--cov=ansys --cov-report=term --cov-report=html:.cov/html" + env: + CONCEPTEV_PASSWORD: ${{ secrets.CONCEPTEV_PASSWORD }} + CONCEPTEV_URL: ${{ secrets.CONCEPTEV_URL }} + CONCEPTEV_USERNAME: ${{ secrets.CONCEPTEV_USERNAME }} + OCM_URL: ${{ secrets.OCM_URL }} + POETRY_VIRTUALENVS_CREATE: ${{ secrets.POETRY_VIRTUALENVS_CREATE }} doc-build: name: "Build documentation" From 86afbde31dc649f1a09a139c76195d84a1f4f23d Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 8 Mar 2024 16:27:35 +0000 Subject: [PATCH 13/17] update secret locations --- .github/workflows/ci_cd.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 18a064cb..188d1387 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -67,10 +67,10 @@ jobs: pytest-extra-args: "--cov=ansys --cov-report=term --cov-report=html:.cov/html" env: CONCEPTEV_PASSWORD: ${{ secrets.CONCEPTEV_PASSWORD }} - CONCEPTEV_URL: ${{ secrets.CONCEPTEV_URL }} - CONCEPTEV_USERNAME: ${{ secrets.CONCEPTEV_USERNAME }} - OCM_URL: ${{ secrets.OCM_URL }} - POETRY_VIRTUALENVS_CREATE: ${{ secrets.POETRY_VIRTUALENVS_CREATE }} + CONCEPTEV_URL: ${{ env.CONCEPTEV_URL }} + CONCEPTEV_USERNAME: ${{ env.CONCEPTEV_USERNAME }} + OCM_URL: ${{ env.OCM_URL }} + POETRY_VIRTUALENVS_CREATE: ${{ env.POETRY_VIRTUALENVS_CREATE }} doc-build: name: "Build documentation" From 5def5b66a236609dd24b363775427a2adadd5fdc Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 8 Mar 2024 16:41:21 +0000 Subject: [PATCH 14/17] added some debug prints to test --- tests/test_main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_main.py b/tests/test_main.py index 93fc9636..baf8a384 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -11,6 +11,9 @@ def test_get_token(httpx_mock: HTTPXMock): + print(conceptev_url) + print(ocm_url) + fake_token = "value1" httpx_mock.add_response( url=f"{ocm_url}/auth/login/", method="post", json={"accessToken": fake_token} From b3b1cd60171895c662c71c77ccb3281e7a7cdfd7 Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 8 Mar 2024 16:50:55 +0000 Subject: [PATCH 15/17] change env block --- .github/workflows/ci_cd.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 188d1387..aa9e6c8d 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -61,16 +61,17 @@ jobs: os: [ubuntu-latest, windows-latest] python-version: ["3.9","3.10","3.11"] fail-fast: false + env: + CONCEPTEV_PASSWORD: ${{ secrets.CONCEPTEV_PASSWORD }} + CONCEPTEV_URL: ${{ env.CONCEPTEV_URL }} + CONCEPTEV_USERNAME: ${{ env.CONCEPTEV_USERNAME }} + OCM_URL: ${{ env.OCM_URL }} + POETRY_VIRTUALENVS_CREATE: ${{ env.POETRY_VIRTUALENVS_CREATE }} + steps: - uses: ansys/actions/tests-pytest@v5 with: pytest-extra-args: "--cov=ansys --cov-report=term --cov-report=html:.cov/html" - env: - CONCEPTEV_PASSWORD: ${{ secrets.CONCEPTEV_PASSWORD }} - CONCEPTEV_URL: ${{ env.CONCEPTEV_URL }} - CONCEPTEV_USERNAME: ${{ env.CONCEPTEV_USERNAME }} - OCM_URL: ${{ env.OCM_URL }} - POETRY_VIRTUALENVS_CREATE: ${{ env.POETRY_VIRTUALENVS_CREATE }} doc-build: name: "Build documentation" From 3b8213dc8667b9da9c125311ccbc92b6416f6c59 Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 8 Mar 2024 16:55:47 +0000 Subject: [PATCH 16/17] changed env location but still not working --- .github/workflows/ci_cd.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index aa9e6c8d..f6467df9 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -61,18 +61,18 @@ jobs: os: [ubuntu-latest, windows-latest] python-version: ["3.9","3.10","3.11"] fail-fast: false - env: - CONCEPTEV_PASSWORD: ${{ secrets.CONCEPTEV_PASSWORD }} - CONCEPTEV_URL: ${{ env.CONCEPTEV_URL }} - CONCEPTEV_USERNAME: ${{ env.CONCEPTEV_USERNAME }} - OCM_URL: ${{ env.OCM_URL }} - POETRY_VIRTUALENVS_CREATE: ${{ env.POETRY_VIRTUALENVS_CREATE }} - steps: - uses: ansys/actions/tests-pytest@v5 + env: + CONCEPTEV_PASSWORD: ${{ secrets.CONCEPTEV_PASSWORD }} + CONCEPTEV_URL: ${{ env.CONCEPTEV_URL }} + CONCEPTEV_USERNAME: ${{ env.CONCEPTEV_USERNAME }} + OCM_URL: ${{ env.OCM_URL }} + POETRY_VIRTUALENVS_CREATE: ${{ env.POETRY_VIRTUALENVS_CREATE }} with: pytest-extra-args: "--cov=ansys --cov-report=term --cov-report=html:.cov/html" + doc-build: name: "Build documentation" runs-on: ubuntu-latest From 2c000c3fa07dcd74c78c97de7879a8223d2db2d5 Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 8 Mar 2024 22:23:06 +0000 Subject: [PATCH 17/17] Update ci_cd.yml --- .github/workflows/ci_cd.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index f6467df9..7e5472a9 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -65,10 +65,10 @@ jobs: - uses: ansys/actions/tests-pytest@v5 env: CONCEPTEV_PASSWORD: ${{ secrets.CONCEPTEV_PASSWORD }} - CONCEPTEV_URL: ${{ env.CONCEPTEV_URL }} - CONCEPTEV_USERNAME: ${{ env.CONCEPTEV_USERNAME }} - OCM_URL: ${{ env.OCM_URL }} - POETRY_VIRTUALENVS_CREATE: ${{ env.POETRY_VIRTUALENVS_CREATE }} + CONCEPTEV_URL: ${{ vars.CONCEPTEV_URL }} + CONCEPTEV_USERNAME: ${{ vars.CONCEPTEV_USERNAME }} + OCM_URL: ${{ vars.OCM_URL }} + POETRY_VIRTUALENVS_CREATE: ${{ vars.POETRY_VIRTUALENVS_CREATE }} with: pytest-extra-args: "--cov=ansys --cov-report=term --cov-report=html:.cov/html"