Skip to content

Commit 9256673

Browse files
anihamdeaniani
authored
Express relay python searcher (#1319)
* move js searcher sdk * add the python searcher sdk * remove pycache * create class for simple searcher * add websocket to python searcher sdk * finish ws, avoid storing liquidation opportunities within client * python scripts now working w auto type generation * minor precommit changes * address comments 1 * add openapi type generations * fixed precommit issues on generated type files * reorg * fixed openapi_client generated precommit * fix js filepath issue * added close ws * renamings and add send_ws_message method * get rid of duplicate error parsing * cleanup * set up pypi workflow * address comments * add python precommit * changes + precommit changes * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * test precommit change * correct directory for poetry in pypi wf * remove isort * rename package * add UUID and some cleanup * new openapi typings * add pydantic to pyproj * more changes * precommit * remove extraneous files, stick w actual_instance * added back http as nondefault * correction * some cleanup and reorg * minor changes * add back api response typing file * minorer changes * exclude openapi_client from end of file fixer * build internal models via pydantic * chgs * start to reorg classes * configure precommit to work * some cleanup * reorg a bit * address comments * chgs * fgt * morechgs * some more chgs --------- Co-authored-by: ani <[email protected]> Co-authored-by: ani <[email protected]>
1 parent 6bea697 commit 9256673

File tree

16 files changed

+8747
-5
lines changed

16 files changed

+8747
-5
lines changed

.github/workflows/ci-pre-commit.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
push:
66
branches: [main]
77

8+
env:
9+
PYTHON_VERSION: "3.11"
10+
POETRY_VERSION: "1.4.2"
11+
812
jobs:
913
pre-commit:
1014
runs-on: ubuntu-latest
@@ -13,7 +17,6 @@ jobs:
1317
with:
1418
# Need to grab the history of the PR
1519
fetch-depth: 0
16-
- uses: actions/setup-python@v2
1720
- uses: actions-rs/toolchain@v1
1821
with:
1922
profile: minimal
@@ -24,6 +27,21 @@ jobs:
2427
profile: minimal
2528
toolchain: nightly-2023-07-23
2629
components: rustfmt, clippy
30+
- uses: actions/checkout@v4
31+
- name: Install poetry
32+
run: pipx install poetry
33+
- uses: actions/setup-python@v2
34+
with:
35+
python-version: ${{ env.PYTHON_VERSION }}
36+
id: setup_python
37+
- name: Cache Poetry cache
38+
uses: actions/cache@v3
39+
with:
40+
path: ~/.cache/pypoetry
41+
key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
42+
- name: Install poetry dependencies
43+
run: poetry -C express_relay/sdk/python/express_relay install
44+
shell: sh
2745
- uses: pre-commit/[email protected]
2846
if: ${{ github.event_name == 'pull_request' }}
2947
with:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Upload express-relay Python Package to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "python-v*"
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
- name: Install dependencies
15+
run: |
16+
python3 -m pip install --upgrade poetry
17+
poetry -C express_relay/sdk/python/express_relay build
18+
- name: Build and publish
19+
run: |
20+
poetry -C express_relay/sdk/python/express_relay build
21+
poetry -C express_relay/sdk/python/express_relay publish --username __token__ --password ${{ secrets.PYPI_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ tsconfig.tsbuildinfo
1818
*mnemonic*
1919
.envrc
2020
*/*.sui.log*
21+
__pycache__

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,19 @@ repos:
111111
entry: cargo +nightly-2023-03-01 clippy --manifest-path ./target_chains/solana/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
112112
pass_filenames: false
113113
files: target_chains/solana
114+
# For express relay python files
115+
- id: black
116+
name: black
117+
entry: poetry -C express_relay/sdk/python/express_relay run black express_relay/sdk/python/express_relay
118+
pass_filenames: false
119+
language: "system"
120+
- id: pyflakes
121+
name: pyflakes
122+
entry: poetry -C express_relay/sdk/python/express_relay run pyflakes express_relay/sdk/python/express_relay
123+
pass_filenames: false
124+
language: "system"
125+
- id: mypy
126+
name: mypy
127+
entry: poetry -C express_relay/sdk/python/express_relay run mypy express_relay/sdk/python/express_relay
128+
pass_filenames: false
129+
language: "system"

0 commit comments

Comments
 (0)