forked from cowdao-grants/cow-py
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add codegen (contracts, subgraph), order signing and order book API i…
…nterface
- Loading branch information
1 parent
bfc594f
commit 82433b2
Showing
92 changed files
with
8,706 additions
and
2,984 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
USER_ADDRESS= | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
name: CI | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: main | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
python-version: [ | ||
"3.10", "3.11", "3.12", | ||
] | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install Poetry | ||
run: | | ||
pipx install poetry | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: poetry | ||
cache-dependency-path: poetry.lock | ||
|
||
- name: Poetry lock | ||
run: | | ||
poetry lock | ||
- name: Install dependencies | ||
run: | | ||
poetry install | ||
- name: Typecheck | ||
run: | | ||
poetry run pyright . | ||
- name: Lint | ||
run: | | ||
poetry run ruff check . | ||
- name: Test | ||
run: | | ||
poetry run pytest tests/ | ||
- name: Build sdist | ||
run: | | ||
poetry build -f sdist | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: wheels | ||
path: | | ||
dist | ||
- name: Display structure of downloaded files | ||
run: | | ||
ls -R | ||
working-directory: ./ | ||
|
||
- run: | | ||
poetry config repositories.testpypi https://test.pypi.org/legacy/ | ||
- run: | | ||
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }} | ||
- name: Publish package (test) | ||
run: | | ||
poetry publish --no-interaction --dry-run -r testpypi -vvv | ||
- if: github.event_name == 'release' | ||
run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | ||
|
||
- name: Publish package (prod) | ||
if: github.event_name == 'release' | ||
run: | | ||
poetry publish --no-interaction -vvv |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.3.7 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
args: [--fix] | ||
# Run the formatter. | ||
- id: ruff-format |
Validating CODEOWNERS rules …
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,8 @@ | ||
# This is a comment. | ||
# Each line is a file pattern followed by one or more owners. | ||
|
||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence, | ||
# @global-owner1 and @global-owner2 will be requested for | ||
# review when someone opens a pull request. | ||
* @mfw78 |
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,27 @@ | ||
.PHONY: codegen web3_codegen orderbook_codegen subgraph_codegen test lint format remove_unused_imports | ||
|
||
codegen: web3_codegen orderbook_codegen subgraph_codegen | ||
|
||
# web3_codegen: | ||
# poetry run web3_codegen | ||
|
||
orderbook_codegen: | ||
poetry run datamodel-codegen --url="https://raw.githubusercontent.com/cowprotocol/services/v2.245.1/crates/orderbook/openapi.yml" --output cow_py/order_book/generated/model.py --target-python-version 3.12 --output-model-type pydantic_v2.BaseModel --input-file-type openapi | ||
|
||
subgraph_codegen: | ||
poetry run ariadne-codegen | ||
|
||
test: | ||
poetry run pytest -s | ||
|
||
lint: | ||
poetry run ruff check . --fix | ||
|
||
format: remove_unused_imports | ||
poetry run ruff format | ||
|
||
remove_unused_imports: | ||
poetry run pycln --all . | ||
|
||
typecheck: | ||
poetry run pyright |
Oops, something went wrong.