Skip to content
Closed
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
6 changes: 2 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ env:
IMAGE_NAME: ${{ github.repository }}/agent0

jobs:
build-and-push:
docker:
name: Docker image
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -22,14 +23,12 @@ jobs:
with:
submodules: recursive
token: ${{secrets.GITHUB_TOKEN}}

- name: Log in to the Container registry
uses: docker/login-action@v2.2.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.5.0
Expand All @@ -40,7 +39,6 @@ jobs:
type=semver,pattern={{version}}
# Add the edge tag to every image to represent the latest commit to main
type=edge,branch=main

- name: Build and push Docker image
uses: docker/build-push-action@v4.1.0
with:
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: lint and test

on:
push:
branches:
- main
pull_request:

jobs:
test-code:
name: Lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
token: ${{github.token}}
- name: install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: install venv
run: |
source $HOME/.cargo/env
uv venv .venv -p 3.10
- name: install requirements
run: |
source $HOME/.cargo/env
source .venv/bin/activate
uv pip install --upgrade -r requirements.txt
uv pip install --upgrade -r requirements-rl.txt
uv pip install --upgrade -r requirements-dev.txt
- name: run black
run: |
source .venv/bin/activate
python -m black --config pyproject.toml --check --diff .
- name: get all Python files
id: list_files
run: |
echo "files=$(git ls-files '*.py' '*.pyi' | xargs)" >> $GITHUB_OUTPUT
- name: run Pylint on files
run: |
source .venv/bin/activate
files="${{ steps.list_files.outputs.files }}"
if [ -n "$files" ]; then
pylint --rcfile=.pylintrc $files
else
echo "No Python files found."
fi
- name: Analyse code with pyright
run: |
source .venv/bin/activate
python -m pyright $(git ls-files '*.py' '*.pyi')
- name: install node
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: install packages
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command
env:
# A warning is thrown here unnecessarily. tracking issue here:
# https://github.com/github/vscode-github-actions/issues/222
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # if needed
- name: install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: run pytest with coverage
run: |
source .venv/bin/activate
IN_CI=true coverage run -m pytest
- name: generate coverage report
run: |
source .venv/bin/activate
coverage xml -i
coverage html -i
- name: upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
flags: unittests
fail_ci_if_error: true
# A warning is thrown here unnecessarily. tracking issue here:
# https://github.com/github/vscode-github-actions/issues/222
token: ${{ secrets.CODECOV_TOKEN }}
49 changes: 0 additions & 49 deletions .github/workflows/lint.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/static.yml

This file was deleted.

69 changes: 0 additions & 69 deletions .github/workflows/test.yml

This file was deleted.

16 changes: 2 additions & 14 deletions lib/agent0/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,17 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
]

[project.optional-dependencies]
# This flag installs all dependencies and should be ran when installing this subpackage in isolation
with-dependencies = ["agent0[base, lateral]"]
base = [
"fixedpointmath",
dependencies = [
"numpy",
"python-dotenv",
# will include eth- packages
"web3",
"hexbytes",
"pandas",
"nest_asyncio",
"rollbar",
"dill",
"fixedpointmath @ git+https://github.com/delvtech/fixedpointmath.git",
]
lateral = [
# Lateral dependencies across subpackages are pointing to github
"hyperlogs[with-dependencies] @ git+https://github.com/delvtech/agent0.git/#subdirectory=lib/hyperlogs",
"ethpy[with-dependencies] @ git+https://github.com/delvtech/agent0.git/#subdirectory=lib/ethpy",
"chainsync[with-dependencies] @ git+https://github.com/delvtech/agent0.git/#subdirectory=lib/chainsync",
]


[build-system]
requires = ["flit_core>=3.2"]
Expand Down
13 changes: 1 addition & 12 deletions lib/chainsync/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
]

[project.optional-dependencies]
# This flag installs all dependencies and should be ran when installing this subpackage in isolation
with-dependencies = [
"chainsync[base, lateral]"
]
base = [
dependencies = [
"fixedpointmath",
"matplotlib",
"numpy",
Expand All @@ -37,11 +31,6 @@ base = [
"pandas-stubs",
"requests",
]
lateral = [
# Lateral dependencies across subpackages are pointing to github
"hyperlogs[with-dependencies] @ git+https://github.com/delvtech/agent0.git/#subdirectory=lib/hyperlogs",
"ethpy[with-dependencies] @ git+https://github.com/delvtech/agent0.git/#subdirectory=lib/ethpy",
]

[build-system]
requires = ["flit_core>=3.2"]
Expand Down
12 changes: 1 addition & 11 deletions lib/ethpy/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,12 @@ classifiers = [
"License :: OSI Approved :: Apache License 2.0",
"Operating System :: OS Independent",
]

[project.optional-dependencies]
# This flag installs all dependencies and should be run when installing this subpackage in isolation
with-dependencies = [
"ethpy[base, lateral]"
]
base = [
dependencies = [
"fixedpointmath",
"numpy",
"python-dotenv",
"web3",
]
lateral = [
# Lateral dependencies across subpackages are pointing to github
"hypertypes[with-dependencies] @ git+https://github.com/delvtech/agent0.git/#subdirectory=lib/hypertypes",
]

[project.urls]
"Homepage" = "https://github.com/delvtech/agent0"
Expand Down
8 changes: 0 additions & 8 deletions lib/hyperlogs/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ classifiers = [
"Operating System :: OS Independent",
]

[project.optional-dependencies]
# This flag installs all dependencies and should be ran when installing this subpackage in isolation
with-dependencies = [
"hyperlogs[base, lateral]"
]
base = []
lateral = []

[build-system]
requires = ["flit_core>=3.2"]
build-backend = "flit_core.buildapi"
8 changes: 4 additions & 4 deletions lib/hypertypes/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ classifiers = [
"License :: OSI Approved :: Apache License 2.0",
"Operating System :: OS Independent",
]

[project.optional-dependencies]
with-dependencies = ["hypertypes[base]"]
base = ["web3", "pypechain"]
dependencies = [
"web3",
"pypechain",
]

[build-system]
requires = ["flit_core>=3.2"]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
-e lib/chainsync[base]
-e lib/ethpy[base]
-e lib/hypertypes[base]
--find-links="packages/hyperdrivepy"
--find-links=packages/hyperdrivepy
hyperdrivepy
rollbar