Skip to content

Commit

Permalink
Update base template
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout committed Aug 12, 2024
1 parent f45a6dd commit 012712b
Show file tree
Hide file tree
Showing 99 changed files with 361 additions and 383 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ python_version = "3.12"
plugins = ["pydantic.mypy"]
strict = true

[tool.mypy-ruamel.yaml]
ignore_missing_imports = true

[tool.pytest.ini_options]
addopts="--cov-report=term-missing --cov=dipdup --cov-report=xml -n auto -s -v"
asyncio_mode = "auto"
Expand Down
2 changes: 1 addition & 1 deletion scripts/demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _init_demo(path: Path) -> None:
)

# NOTE: We don't need magic symlinks in demo projects.
Path(package_path).joinpath(package).unlink()
Path(package_path).joinpath(package).unlink(missing_ok=True)


def _rm_demo(path: Path) -> None:
Expand Down
11 changes: 10 additions & 1 deletion src/demo_blank/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ help: ## Show this help (default)
all: ## Run an entire CI pipeline
make format lint

##

install: ## Install dependencies
pdm install

update: ## Update dependencies
pdm update
dipdup self update -q

format: ## Format with all tools
make black

Expand All @@ -28,7 +37,7 @@ ruff: ## Lint with ruff
ruff check --fix .

mypy: ## Lint with mypy
mypy --no-incremental --exclude ${PACKAGE} .
mypy .

##

Expand Down
1 change: 0 additions & 1 deletion src/demo_blank/deploy/compose.sqlite.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
name: demo_blank

services:
Expand Down
3 changes: 1 addition & 2 deletions src/demo_blank/deploy/compose.swarm.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
name: demo_blank

services:
Expand Down Expand Up @@ -38,7 +37,7 @@ services:
- POSTGRES_DB=dipdup
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
Expand Down
7 changes: 3 additions & 4 deletions src/demo_blank/deploy/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
name: demo_blank

services:
Expand All @@ -19,7 +18,7 @@ services:
db:
image: postgres:15
ports:
- 5432
- "${POSTGRES_HOST_PORT:-5432}:5432"
volumes:
- db:/var/lib/postgresql/data
restart: always
Expand All @@ -29,15 +28,15 @@ services:
- POSTGRES_DB=dipdup
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dipdup"]
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5

hasura:
image: hasura/graphql-engine:latest
ports:
- 8080
- "${HASURA_HOST_PORT:-8080}:8080"
depends_on:
- db
restart: always
Expand Down
16 changes: 4 additions & 12 deletions src/demo_blank/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ dev = [
"mypy",
]

[tool.pdm.scripts]
help = {cmd = "make help", help = "Show this help (default)"}
all = {cmd = "make all", help = "Run an entire CI pipeline"}
format = {cmd = "make format", help = "Format with all tools"}
lint = {cmd = "make lint", help = "Lint with all tools"}
black = {cmd = "make black", help = "Format with black"}
ruff = {cmd = "make ruff", help = "Lint with ruff"}
mypy = {cmd = "make mypy", help = "Lint with mypy"}
image = {cmd = "make image", help = "Build Docker image"}
up = {cmd = "make up", help = "Start Compose stack"}
down = {cmd = "make down", help = "Stop Compose stack"}

[tool.black]
line-length = 120
target-version = ['py312']
Expand All @@ -50,6 +38,10 @@ isort = { force-single-line = true}
python_version = "3.12"
plugins = ["pydantic.mypy"]
strict = false
exclude = "demo_blank"

[tool.mypy-ruamel.yaml]
ignore-missing-imports = true

[build-system]
requires = ["pdm-backend"]
Expand Down
11 changes: 10 additions & 1 deletion src/demo_evm_events/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ help: ## Show this help (default)
all: ## Run an entire CI pipeline
make format lint

##

install: ## Install dependencies
pdm install

update: ## Update dependencies
pdm update
dipdup self update -q

format: ## Format with all tools
make black

Expand All @@ -28,7 +37,7 @@ ruff: ## Lint with ruff
ruff check --fix .

mypy: ## Lint with mypy
mypy --no-incremental --exclude ${PACKAGE} .
mypy .

##

Expand Down
1 change: 0 additions & 1 deletion src/demo_evm_events/deploy/compose.sqlite.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
name: demo_evm_events

services:
Expand Down
3 changes: 1 addition & 2 deletions src/demo_evm_events/deploy/compose.swarm.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
name: demo_evm_events

services:
Expand Down Expand Up @@ -38,7 +37,7 @@ services:
- POSTGRES_DB=dipdup
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
Expand Down
7 changes: 3 additions & 4 deletions src/demo_evm_events/deploy/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
name: demo_evm_events

services:
Expand All @@ -19,7 +18,7 @@ services:
db:
image: postgres:15
ports:
- 5432
- "${POSTGRES_HOST_PORT:-5432}:5432"
volumes:
- db:/var/lib/postgresql/data
restart: always
Expand All @@ -29,15 +28,15 @@ services:
- POSTGRES_DB=dipdup
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dipdup"]
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5

hasura:
image: hasura/graphql-engine:latest
ports:
- 8080
- "${HASURA_HOST_PORT:-8080}:8080"
depends_on:
- db
restart: always
Expand Down
16 changes: 4 additions & 12 deletions src/demo_evm_events/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ dev = [
"mypy",
]

[tool.pdm.scripts]
help = {cmd = "make help", help = "Show this help (default)"}
all = {cmd = "make all", help = "Run an entire CI pipeline"}
format = {cmd = "make format", help = "Format with all tools"}
lint = {cmd = "make lint", help = "Lint with all tools"}
black = {cmd = "make black", help = "Format with black"}
ruff = {cmd = "make ruff", help = "Lint with ruff"}
mypy = {cmd = "make mypy", help = "Lint with mypy"}
image = {cmd = "make image", help = "Build Docker image"}
up = {cmd = "make up", help = "Start Compose stack"}
down = {cmd = "make down", help = "Stop Compose stack"}

[tool.black]
line-length = 120
target-version = ['py312']
Expand All @@ -50,6 +38,10 @@ isort = { force-single-line = true}
python_version = "3.12"
plugins = ["pydantic.mypy"]
strict = false
exclude = "demo_evm_events"

[tool.mypy-ruamel.yaml]
ignore-missing-imports = true

[build-system]
requires = ["pdm-backend"]
Expand Down
11 changes: 10 additions & 1 deletion src/demo_evm_transactions/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ help: ## Show this help (default)
all: ## Run an entire CI pipeline
make format lint

##

install: ## Install dependencies
pdm install

update: ## Update dependencies
pdm update
dipdup self update -q

format: ## Format with all tools
make black

Expand All @@ -28,7 +37,7 @@ ruff: ## Lint with ruff
ruff check --fix .

mypy: ## Lint with mypy
mypy --no-incremental --exclude ${PACKAGE} .
mypy .

##

Expand Down
1 change: 0 additions & 1 deletion src/demo_evm_transactions/deploy/compose.sqlite.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
name: demo_evm_transactions

services:
Expand Down
3 changes: 1 addition & 2 deletions src/demo_evm_transactions/deploy/compose.swarm.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
name: demo_evm_transactions

services:
Expand Down Expand Up @@ -38,7 +37,7 @@ services:
- POSTGRES_DB=dipdup
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
Expand Down
7 changes: 3 additions & 4 deletions src/demo_evm_transactions/deploy/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
name: demo_evm_transactions

services:
Expand All @@ -19,7 +18,7 @@ services:
db:
image: postgres:15
ports:
- 5432
- "${POSTGRES_HOST_PORT:-5432}:5432"
volumes:
- db:/var/lib/postgresql/data
restart: always
Expand All @@ -29,15 +28,15 @@ services:
- POSTGRES_DB=dipdup
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dipdup"]
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5

hasura:
image: hasura/graphql-engine:latest
ports:
- 8080
- "${HASURA_HOST_PORT:-8080}:8080"
depends_on:
- db
restart: always
Expand Down
16 changes: 4 additions & 12 deletions src/demo_evm_transactions/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ dev = [
"mypy",
]

[tool.pdm.scripts]
help = {cmd = "make help", help = "Show this help (default)"}
all = {cmd = "make all", help = "Run an entire CI pipeline"}
format = {cmd = "make format", help = "Format with all tools"}
lint = {cmd = "make lint", help = "Lint with all tools"}
black = {cmd = "make black", help = "Format with black"}
ruff = {cmd = "make ruff", help = "Lint with ruff"}
mypy = {cmd = "make mypy", help = "Lint with mypy"}
image = {cmd = "make image", help = "Build Docker image"}
up = {cmd = "make up", help = "Start Compose stack"}
down = {cmd = "make down", help = "Stop Compose stack"}

[tool.black]
line-length = 120
target-version = ['py312']
Expand All @@ -50,6 +38,10 @@ isort = { force-single-line = true}
python_version = "3.12"
plugins = ["pydantic.mypy"]
strict = false
exclude = "demo_evm_transactions"

[tool.mypy-ruamel.yaml]
ignore-missing-imports = true

[build-system]
requires = ["pdm-backend"]
Expand Down
11 changes: 10 additions & 1 deletion src/demo_evm_uniswap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ help: ## Show this help (default)
all: ## Run an entire CI pipeline
make format lint

##

install: ## Install dependencies
pdm install

update: ## Update dependencies
pdm update
dipdup self update -q

format: ## Format with all tools
make black

Expand All @@ -28,7 +37,7 @@ ruff: ## Lint with ruff
ruff check --fix .

mypy: ## Lint with mypy
mypy --no-incremental --exclude ${PACKAGE} .
mypy .

##

Expand Down
1 change: 0 additions & 1 deletion src/demo_evm_uniswap/deploy/compose.sqlite.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
name: demo_evm_uniswap

services:
Expand Down
3 changes: 1 addition & 2 deletions src/demo_evm_uniswap/deploy/compose.swarm.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
name: demo_evm_uniswap

services:
Expand Down Expand Up @@ -38,7 +37,7 @@ services:
- POSTGRES_DB=dipdup
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
Expand Down
Loading

0 comments on commit 012712b

Please sign in to comment.