-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Migrate from Poetry to UV for build System (#234)
* ♻️ migrate from Poetry to Hatch for build system * 🔥 remove Poetry configuration across multiple modules * ♻️ update project dependencies to use direct paths and migrate to Hatch * ♻️ migrate from Poetry to uv for dependency management and update related scripts and documentation * update abis * update abis * 🐛 exclude JSON files from end-of-file fixer in pre-commit configuration * 🐛 fix missing dependencies * ♻️ update dependencies across multiple projects for consistency and compatibility * ♻️ update dependency versions for consistency and compatibility * 🐛 update pytest configuration for async fixtures and improve event loop fixture * fix: checkpointer test * 🐛 add pytest configuration for asyncio and improve event loop management * 🐛 fix checkpointer tests * 🐛 fix event loop scope in fixtures and update fixture parameters * fix: deploy oracle fixture * ✨ fix Linting issue * fix: okx future fetcher test * feat: add Docker image build workflow and integrate with pull request process * 🐛 specify Dockerfile path in docker-test workflow * ♻️ remove `merkle-maker` from docker-test workflow package matrix * ✨ update Dockerfile to install pipx correctly and improve stage naming * ♻️ streamline Dockerfile by consolidating dependency * ♻️ update Dockerfile to install uv from GitHub and streamline commands * ♻️ refactor Dockerfiles to standardize build stages and improve package version extraction * ♻️ update workflows to standardize package version extraction by normalizing package paths * ✨ fix the current version of the SDK --------- Co-authored-by: 0xevolve <[email protected]>
- Loading branch information
Showing
171 changed files
with
12,565 additions
and
21,261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
TESTNET_ACCOUNT_ADDRESS= | ||
TESTNET_PRIVATE_KEY= | ||
TESTNET_PRIVATE_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
name: Task - Build Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
build_containers: | ||
strategy: | ||
matrix: | ||
package: [pragma-sdk, price-pusher, vrf-listener, checkpointer] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: Extract package version | ||
if: matrix.package == 'pragma-sdk' | ||
run: | | ||
PKG_PATH=$(echo ${{ matrix.package }} | tr '-' '_') | ||
export PACKAGE_VERSION=$(grep -o '".*"' ./${{ matrix.package }}/$PKG_PATH/__init__.py | tr -d '"') | ||
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV | ||
echo $PACKAGE_VERSION | ||
- name: Build Docker Image | ||
id: docker_build | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./${{ matrix.package }}/Dockerfile | ||
build-args: ${{ matrix.package == 'pragma-sdk' && format('PRAGMA_PACKAGE_VERSION={0}', env.PACKAGE_VERSION) || '' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,29 @@ | ||
--- | ||
name: Task - Lint, Format & Typecheck | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
env: | ||
PYTHON_VERSION: 3.12.4 | ||
PYTHON_VERSION: 3.12 | ||
|
||
jobs: | ||
lint-format-typecheck: | ||
continue-on-error: true | ||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
package: | ||
[ | ||
pragma-utils, | ||
pragma-sdk, | ||
price-pusher, | ||
vrf-listener, | ||
checkpointer, | ||
merkle-maker, | ||
lp-pricer, | ||
] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: CfirTsabari/actions-pipx@v1 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- name: Set up Python 3.12.4 | ||
uses: actions/setup-python@v4 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: astral-sh/setup-uv@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: "poetry" | ||
enable-cache: true | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry install | ||
- name: Check poetry.lock | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry lock --check | ||
- name: Run lint | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry run poe lint | ||
- name: Run format | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry run poe format_check | ||
- name: Run typecheck | ||
run: | | ||
cd ${{ matrix.package }} | ||
poetry run poe typecheck | ||
run: uv sync --python ${{ env.PYTHON_VERSION }} --all-extras | ||
|
||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --all-files --verbose | ||
env: | ||
SKIP: no-commit-to-branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,15 +19,26 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: CfirTsabari/actions-pipx@v1 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/setup-python@v5 | ||
|
||
- name: set up python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: "poetry" | ||
- run: pipx inject poetry poetry-monorepo-dependency-plugin | ||
- run: poetry config repositories.test-pypi https://test.pypi.org/legacy/ | ||
- run: poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
- run: poetry build -f sdist | ||
- run: poetry publish -r test-pypi --skip-existing | ||
|
||
- name: install | ||
run: pip install -U build | ||
|
||
- name: check version | ||
id: check-tag | ||
uses: samuelcolvin/[email protected] | ||
with: | ||
version_file_path: pragma_sdk/__init__.py | ||
|
||
- name: build | ||
run: python -m build | ||
|
||
- name: Upload package to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,70 +8,26 @@ defaults: | |
run: | ||
working-directory: pragma-sdk | ||
|
||
env: | ||
PYTHON_VERSION: 3.12.4 | ||
|
||
jobs: | ||
bump_version: | ||
release: | ||
name: Pypi Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: astral-sh/setup-uv@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install Commitizen | ||
run: pip install --upgrade Commitizen | ||
- name: Configure Git | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
- name: Bump version | ||
run: | | ||
git fetch --tags | ||
cz bump --retry || echo "probably nothing to do" | ||
- name: Push changes | ||
run: | | ||
TAG=$(git tag --points-at HEAD) | ||
if [[ $TAG ]]; then | ||
echo "Version bumped to $TAG" | ||
git push | ||
git push --tags | ||
else | ||
echo "Version NOT bumped" | ||
fi | ||
enable-cache: true | ||
|
||
pypi_publish: | ||
needs: [bump_version] | ||
name: Upload package to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: CfirTsabari/actions-pipx@v1 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/setup-python@v5 | ||
- name: check GITHUB_REF matches package version | ||
uses: samuelcolvin/[email protected] | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: "poetry" | ||
- run: pipx inject poetry poetry-monorepo-dependency-plugin | ||
- run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}" | ||
- run: poetry build -f sdist | ||
- run: poetry publish --skip-existing | ||
version_file_path: pragma_sdk/__init__.py | ||
|
||
update_lock: | ||
needs: [pypi_publish] | ||
name: Update lock file | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: CfirTsabari/actions-pipx@v1 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/setup-python@v5 | ||
- run: uv build | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: "poetry" | ||
- run: sh scripts/poetry_lock_update.sh | ||
password: ${{ secrets.PYPI_API_KEY }} | ||
skip-existing: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "pragma-oracle"] | ||
path = pragma-oracle | ||
url = https://github.com/Astraly-Labs/pragma-oracle.git | ||
url = https://github.com/Astraly-Labs/pragma-oracle.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-toml | ||
- id: check-yaml | ||
args: [ --allow-multiple-documents ] | ||
- id: end-of-file-fixer | ||
exclude: '.*\.json$' | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.8.1 | ||
hooks: | ||
- id: ruff | ||
args: | ||
- --fix | ||
- id: ruff-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.