From 2c0cedb177694f2ad6fdb3a0326ce4938b7347a0 Mon Sep 17 00:00:00 2001 From: quickpanda Date: Tue, 19 Dec 2023 14:11:09 -0800 Subject: [PATCH 1/3] fix bug and update readme --- README.md | 5 +++++ convect_flow_sdk/flow_algo.py | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a013669..8fd23c7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,12 @@ pip install convect-flow-sdk ## Usage ```bash +# set up environment variables +# FLOW_WORKSPACE_ID: your flow workspace id +# FLOW_API_TOKEN: your flow api token from the workspace +# FLOW_HOST: flow host, default to https://flow.convect.ai from convect_flow_sdk import FlowAlgo +from pprint import pprint # this is an example of how to use the flow_algo_sdk flow_algo = FlowAlgo() # this algo_id is will be the one defined in the algo project diff --git a/convect_flow_sdk/flow_algo.py b/convect_flow_sdk/flow_algo.py index aafb3b1..cff787b 100644 --- a/convect_flow_sdk/flow_algo.py +++ b/convect_flow_sdk/flow_algo.py @@ -153,7 +153,8 @@ def list_algos(self): _data = { "workspace_id": self.flow_workspace_id, } - r = requests.post(_api_url, headers=self.get_credential_header(), params=pagination) + r = requests.post(_api_url, headers=self.get_credential_header(), params=pagination,json=_data) + print(r.json()) r.raise_for_status() return r.json() @@ -412,4 +413,4 @@ def terminate(self, run_id): if _run_hash_file["run_id"] == run_id: os.remove(_file_path) break - print("terminate algo run successfully") + print("terminate algo run successfully") \ No newline at end of file From c0220ac8f64aaa27de134bc94e69c23d4cb26001 Mon Sep 17 00:00:00 2001 From: quickpanda Date: Tue, 19 Dec 2023 14:12:01 -0800 Subject: [PATCH 2/3] add github actions --- .github/workflows/release.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..e69de29 From 39c170e847d598c674e433149f291c755352e435 Mon Sep 17 00:00:00 2001 From: quickpanda Date: Tue, 19 Dec 2023 14:34:52 -0800 Subject: [PATCH 3/3] update workflow.yaml --- .github/workflows/release.yaml | 0 .github/workflows/workflow.yaml | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) delete mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/workflow.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml new file mode 100644 index 0000000..4f989b3 --- /dev/null +++ b/.github/workflows/workflow.yaml @@ -0,0 +1,19 @@ +name: Python package publishing +on: + push: + branches: + - main +jobs: + pypi-publish: + name: upload release to PyPI + runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + # retrieve your distributions here + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file