Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 13 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,20 @@ jobs:
runs-on: ubicloud
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.10.10"
- name: Install and configure Poetry
uses: snok/[email protected]
with:
version: 1.4.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies
run: poetry install
- name: Install pytest
run: poetry run pip install pytest
- name: Install ruff
run: poetry run pip install ruff
run: uv sync
- name: Run tests
env:
MAINNET_RPC_ENDPOINT: ${{ secrets.MAINNET_RPC_ENDPOINT }}
DEVNET_RPC_ENDPOINT: ${{ secrets.DEVNET_RPC_ENDPOINT }}
# run: poetry run ruff format --check . && poetry run bash scripts/ci.sh
run: poetry run bash scripts/ci.sh
# run: uv run ruff format --check . && uv run bash scripts/ci.sh
run: uv run bash scripts/ci.sh

bump-version:
runs-on: ubicloud
Expand Down Expand Up @@ -83,21 +74,16 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10.10"
- name: Install and configure Poetry
uses: snok/[email protected]
with:
version: 1.4.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Build package
run: poetry build
run: uv build
- name: Publish to PyPI
run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
run: uv publish --token ${{ secrets.PYPI_TOKEN }}
- name: Get version
id: get_version
run: echo "VERSION=$(poetry version -s)" >> $GITHUB_OUTPUT
run: echo "VERSION=$(grep '^version = ' pyproject.toml | cut -d '"' -f 2)" >> $GITHUB_OUTPUT
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ jobs:
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.10.10'
python-version: '3.11'
#----------------------------------------------
# ----- install & configure poetry -----
# ----- install & configure uv -----
#----------------------------------------------
- name: Install and configure Poetry
uses: snok/[email protected]
with:
version: 1.4.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- run: poetry build
- run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
- name: Install uv
uses: astral-sh/setup-uv@v4
- run: uv build
- run: uv publish --token ${{ secrets.PYPI_TOKEN }}
32 changes: 8 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,43 +54,27 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
python-version: '3.11'

#----------------------------------------------
# ----- install & configure poetry -----
# ----- install & configure uv -----
#----------------------------------------------
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.1.10
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install uv
uses: astral-sh/setup-uv@v4
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
id: cached-uv-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist (todo)
# install dependencies
#----------------------------------------------
- name: Install dependencies
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
#----------------------------------------------
# install nox-poetry
#----------------------------------------------
- name: Install nox-poetry
run: pip install nox-poetry
run: uv sync
#----------------------------------------------
# run linters
#----------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,20 @@ If you intend to use `AccountSubscriptionConfig("demo)`, you *must* call `get_ma

Ensure correct python version (using pyenv is recommended):
```bash
pyenv install 3.10.11
pyenv global 3.10.11
poetry env use $(pyenv which python)
pyenv install 3.11
pyenv global 3.11
```

Install dependencies:
```bash
poetry install
uv sync
```

To run tests, first ensure you have set up the RPC url, then run `pytest`:
```bash
export MAINNET_RPC_ENDPOINT="<YOUR_RPC_URL>"
export DEVNET_RPC_ENDPOINT="https://api.devnet.solana.com" # or your own RPC

poetry run pytest -v -s -x tests/ci/*.py
poetry run pytest -v -s tests/math/*.py
uv run pytest -v -s -x tests/ci/*.py
uv run pytest -v -s tests/math/*.py
```
Loading