Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Release 11/11/24 (#131)
Browse files Browse the repository at this point in the history
- Setup PIP
- Remove Prefect from repo
- Remove any leftover references of participation rewards

---------

Co-authored-by: Haris Angelidakis <[email protected]>
  • Loading branch information
bram-vdberg and harisang authored Nov 11, 2024
1 parent 92e702d commit 748478c
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 282 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/prefect.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,3 @@ build-image:
run-image:
echo "using ${PWD}/data"
docker run -v ${PWD}/data:/app/data --env-file .env local_dune_sync

prefect:
@if [ -z "$(VIRTUAL_ENV)" ]; then \
echo "Error: Not in a virtual environment. Please activate a virtual environment before running this command."; \
exit 1; \
else \
pip install -r requirements/prefect.txt; \
prefect server start; \
fi

deployment:
@if [ -z "$(VIRTUAL_ENV)" ]; then \
echo "Error: Not in a virtual environment. Please activate a virtual environment before running this command."; \
exit 1; \
else \
pip install -r requirements/prefect.txt; \
pip install -r requirements/prod.txt; \
python -m src.deploy_prefect.local_deploy; \
fi
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ To execute the main binary (inside the container) run
python3 -m src.main --sync-table <job>
```

Another way to install the repo is with pip:
``
pip install git+https://github.com/cowprotocol/dune-sync.git@<branch-name>
```
This allows you to install the repo as a module to your local environment and automatically install the required dependencies.
# Docker
### Build
Expand Down
2 changes: 2 additions & 0 deletions manifest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include logging.conf
include requirements/prod.txt
5 changes: 0 additions & 5 deletions requirements/prefect.txt

This file was deleted.

28 changes: 28 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os
from setuptools import setup, find_packages

subpackages = find_packages("src")
packages = ["src"] + ["src." + p for p in subpackages]


def read_requirements(filename):
with open(filename, "r") as f:
return [line.strip() for line in f.readlines() if line.strip()]


setup(
name="src",
version="1.6.4",
packages=packages,
package_dir={"dune_sync": "src/dune_sync"},
include_package_data=True,
data_files=[
(
os.path.join(
"lib", "python{0}.{1}".format(*os.sys.version_info[:2]), "site-packages"
),
["logging.conf"],
)
],
install_requires=read_requirements("requirements/prod.txt"),
)
Empty file removed src/deploy_prefect/__init__.py
Empty file.
166 changes: 0 additions & 166 deletions src/deploy_prefect/deployment.py

This file was deleted.

40 changes: 0 additions & 40 deletions src/deploy_prefect/local_deploy.py

This file was deleted.

1 change: 0 additions & 1 deletion src/models/batch_rewards_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def from_pdf_to_dune_records(cls, rewards_df: DataFrame) -> list[dict[str, Any]]
"fee": int(row["network_fee"]),
"winning_score": int(row["winning_score"]),
"reference_score": int(row["reference_score"]),
"participating_solvers": row["participating_solvers"],
},
}
for row in rewards_df.to_dict(orient="records")
Expand Down
24 changes: 0 additions & 24 deletions tests/unit/test_batch_rewards_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,6 @@ def test_order_rewards_transformation(self):
"capped_payment": [-1000000000000000, -1000000000000000],
"winning_score": [123456 * ONE_ETH, 6789 * ONE_ETH],
"reference_score": [ONE_ETH, 2 * ONE_ETH],
"participating_solvers": [
[
"0x51",
"0x52",
"0x53",
],
[
"0x51",
"0x52",
"0x53",
"0x54",
"0x55",
"0x56",
],
],
}
)

Expand All @@ -61,7 +46,6 @@ def test_order_rewards_transformation(self):
"capped_payment": -1000000000000000,
"execution_cost": 9999000000000000000000,
"fee": 1000000000000000,
"participating_solvers": ["0x51", "0x52", "0x53"],
"protocol_fee": 2000000000000000,
"reference_score": 1000000000000000000,
"surplus": 2000000000000000000,
Expand All @@ -78,14 +62,6 @@ def test_order_rewards_transformation(self):
"capped_payment": -1000000000000000,
"execution_cost": 1,
"fee": max_uint,
"participating_solvers": [
"0x51",
"0x52",
"0x53",
"0x54",
"0x55",
"0x56",
],
"protocol_fee": 0,
"reference_score": 2000000000000000000,
"surplus": 3000000000000000000,
Expand Down

0 comments on commit 748478c

Please sign in to comment.