Skip to content

Commit

Permalink
feat: implement all universal router command encodings (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: fubuloubu <[email protected]>
  • Loading branch information
banteg and fubuloubu authored Jun 6, 2024
1 parent 3a2c487 commit 6f104e0
Show file tree
Hide file tree
Showing 8 changed files with 505 additions and 189 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.10"

- name: Install Dependencies
run: pip install .[dev]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[release]
- name: Build
run: python setup.py sdist bdist_wheel

Expand Down
44 changes: 11 additions & 33 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.10"

- name: Install Dependencies
run: pip install .[lint]
Expand All @@ -30,12 +30,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.10"

- name: Install Dependencies
run: pip install .[lint,test] # Might need test deps
Expand All @@ -48,41 +48,19 @@ jobs:

strategy:
matrix:
# TODO: macos-latest doesn't have 3.8,3.9
os: [ubuntu-latest, macos-12] # eventually add `windows-latest`
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest] # eventually add `windows-latest`
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: pip install .[test]

- name: Run Tests
run: pytest -m "not fuzzing" -n 0 -s --cov

# NOTE: uncomment this block after you've marked tests with @pytest.mark.fuzzing
# fuzzing:
# runs-on: ubuntu-latest
#
# strategy:
# fail-fast: true
#
# steps:
# - uses: actions/checkout@v2
#
# - name: Setup Python
# uses: actions/setup-python@v2
# with:
# python-version: 3.8
#
# - name: Install Dependencies
# run: pip install .[test]
#
# - name: Run Tests
# run: pytest -m "fuzzing" --no-cov -s
run: ape test -s
6 changes: 3 additions & 3 deletions .github/workflows/title.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.10"

- name: Install Dependencies
run: pip install commitizen
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ include = '\.pyi?$'

[tool.pytest.ini_options]
addopts = """
-n auto
-p no:ape_test
--cov-branch
--cov-report term
--cov-report html
--cov-report xml
--cov=<MODULE_NAME>
--cov=uniswap_sdk
"""
python_files = "test_*.py"
testpaths = "tests"
Expand All @@ -37,3 +35,6 @@ force_grid_wrap = 0
include_trailing_comma = true
multi_line_output = 3
use_parentheses = true

[tool.ruff]
line-length = 100
16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@

extras_require = {
"test": [ # `test` GitHub Action jobs uses this
"pytest>=6.0,<8", # Core testing package
"pytest", # Core testing package
"pytest-xdist", # multi-process runner
"pytest-cov", # Coverage analyzer plugin
"hypothesis>=6.2.0,<7", # Strategy-based fuzzer
"hypothesis", # Strategy-based fuzzer
],
"lint": [
"black>=24.2.0,<25", # auto-formatter and linter
"mypy>=1.8.0,<2", # Static type analyzer
"flake8>=7.0,<8", # Style linter
"isort>=5.10,<6", # Import sorting linter
"black", # auto-formatter and linter
"mypy", # Static type analyzer
"flake8", # Style linter
"isort", # Import sorting linter
],
"release": [ # `release` GitHub Action job uses this
"setuptools", # Installation tool
"wheel", # Packaging tool
"twine", # Package upload tool
],
"dev": [
"commitizen>=2.40,<3", # Manage commits and publishing releases
"commitizen", # Manage commits and publishing releases
"pre-commit", # Ensure that linters are run prior to commiting
"pytest-watch", # `ptw` test watcher/runner
"IPython", # Console for interacting
Expand Down Expand Up @@ -53,7 +53,7 @@
url="https://github.com/ApeWorX/uniswap-sdk",
include_package_data=True,
install_requires=[
"eth-ape>=0.7,<1",
"eth-ape>=0.8,<1",
"ethpm-types>=0.6.11", # higher peer dep of `eth-ape`, solves typing issue
], # NOTE: Add 3rd party libraries here
python_requires=">=3.8,<4",
Expand Down
Loading

0 comments on commit 6f104e0

Please sign in to comment.