Skip to content

Commit

Permalink
Add help messages to pyproject.toml scripts (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout authored Oct 20, 2023
1 parent e9c9916 commit d9ff712
Show file tree
Hide file tree
Showing 37 changed files with 407 additions and 146 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic

### Fixed

- cli: Fixed `DIPDUP_DEBUG` not being applied to the package logger.
- tezos.tzkt.token_transfers: Fixed filtering transfers by token_id.

## [7.0.2] - 2023-10-10
Expand Down
87 changes: 43 additions & 44 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 53 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,30 +106,63 @@ dev = [
_black = "black src tests scripts"
_ruff = "ruff check --fix src tests scripts"
_mypy = "mypy src tests scripts"
all = { composite = ["fmt", "lint", "test"] }
fmt = { composite = ["_black"] }
lint = { composite = ["_ruff", "_mypy"] }
test = "pytest --cov-report=term-missing --cov=dipdup --cov-report=xml -n auto -s -v tests"
update = { shell = """
pdm update
pdm export --without-hashes -f requirements --prod -o requirements.txt
pdm export --without-hashes -f requirements --dev -o requirements.dev.txt
""" }
image = "docker buildx build . --load --progress plain -t dipdup:latest"
clean = "git clean -xdf --exclude=.venv"
demos = { shell = """

[tool.pdm.scripts.all]
help = "Run all checks"
composite = ["fmt", "lint", "test"]

[tool.pdm.scripts.demos]
help = "Recreate demo projects from templates"
shell = """
python scripts/update_demos.py
python scripts/init_demos.py
pdm run fmt
# FIXME: Run isort once to fix import sorting (bug in ruff)
isort . --force-single-line -l 120
pdm run lint
""" }
docs_build = "python scripts/docs.py --source docs --destination {args:../interface}/content/docs"
docs_serve = "python scripts/docs.py --source docs --destination {args:../interface}/content/docs --watch --serve"
docs_watch = "python scripts/docs.py --source docs --destination {args:../interface}/content/docs --watch"
docs_references = "python scripts/dump_references.py"
fixme = "grep -r -e 'FIXME: ' -e 'TODO: ' -e 'type: ignore' -n src/dipdup --color"
"""

[tool.pdm.scripts.docs_build]
help = "Build docs"
cmd = "python scripts/docs.py --source docs --destination {args:../interface}/content/docs"

[tool.pdm.scripts.docs_serve]
help = "Build and serve docs"
cmd = "python scripts/docs.py --source docs --destination {args:../interface}/content/docs --serve"

[tool.pdm.scripts.docs_watch]
help = "Watch docs"
cmd = "python scripts/docs.py --source docs --destination {args:../interface}/content/docs --watch"

[tool.pdm.scripts.docs_references]
help = "Dump references"
cmd = "python scripts/dump_references.py"

[tool.pdm.scripts.fixme]
help = "Find FIXME and TODO comments"
cmd = "grep -r -e 'FIXME: ' -e 'TODO: ' -e 'type: ignore' -n src/dipdup --color"

[tool.pdm.scripts.fmt]
help = "Format code with black"
composite = ["_black"]

[tool.pdm.scripts.image]
help = "Build Docker image"
cmd = "docker buildx build . --load --progress plain -t dipdup:latest"

[tool.pdm.scripts.lint]
help = "Check code with ruff and mypy"
composite = ["_ruff", "_mypy"]

[tool.pdm.scripts.test]
help = "Run tests"
cmd = "pytest --cov-report=term-missing --cov=dipdup --cov-report=xml -n auto -s -v tests"

[tool.pdm.scripts.update]
help = "Update dependencies and dump requirements.txt"
shell = """
pdm update
pdm export --without-hashes -f requirements --prod -o requirements.txt
pdm export --without-hashes -f requirements --dev -o requirements.dev.txt
"""

[tool.pdm.build.targets.wheel]
packages = ["src/dipdup"]
Expand Down
10 changes: 5 additions & 5 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ asyncpg==0.28.0
attrs==23.1.0
babel==2.12.1
bitarray==2.8.1
black==23.9.1
black==23.10.0
certifi==2023.7.22
chardet==5.2.0
charset-normalizer==3.2.0
Expand Down Expand Up @@ -59,7 +59,7 @@ mypy-extensions==1.0.0
numpy==1.25.2
openapi-schema-validator==0.4.4
openapi-spec-validator==0.5.7
orjson==3.9.8
orjson==3.9.9
packaging==23.1
parsimonious==0.9.0
pathable==0.4.3
Expand Down Expand Up @@ -94,8 +94,8 @@ rfc3339-validator==0.1.4
rlp==3.0.0
ruamel-yaml==0.17.35
ruamel-yaml-clib==0.2.7
ruff==0.0.292
sentry-sdk==1.31.0
ruff==0.1.0
sentry-sdk==1.32.0
setuptools==68.2.2
six==1.16.0
sniffio==1.3.0
Expand All @@ -121,7 +121,7 @@ typing-extensions==4.7.1
tzlocal==5.0.1
urllib3==2.0.6
watchdog==3.0.0
web3==6.10.0
web3==6.11.0
websocket-client==1.6.1
websockets==10.4
yarl==1.9.2
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ asyncclick==8.1.3.4
asyncpg==0.28.0
attrs==23.1.0
bitarray==2.8.1
black==23.9.1
black==23.10.0
certifi==2023.7.22
chardet==5.2.0
charset-normalizer==3.2.0
Expand Down Expand Up @@ -50,7 +50,7 @@ mypy-extensions==1.0.0
numpy==1.25.2
openapi-schema-validator==0.4.4
openapi-spec-validator==0.5.7
orjson==3.9.8
orjson==3.9.9
packaging==23.1
parsimonious==0.9.0
pathable==0.4.3
Expand All @@ -77,7 +77,7 @@ rfc3339-validator==0.1.4
rlp==3.0.0
ruamel-yaml==0.17.35
ruamel-yaml-clib==0.2.7
sentry-sdk==1.31.0
sentry-sdk==1.32.0
setuptools==68.2.2
six==1.16.0
sniffio==1.3.0
Expand All @@ -90,6 +90,6 @@ tortoise-orm==0.19.3
typing-extensions==4.7.1
tzlocal==5.0.1
urllib3==2.0.6
web3==6.10.0
web3==6.11.0
websockets==10.4
yarl==1.9.2
1 change: 1 addition & 0 deletions src/demo_auction/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from enum import IntEnum


from dipdup import fields
from dipdup.models import Model

Expand Down
21 changes: 17 additions & 4 deletions src/demo_auction/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated by DipDup 7.0.2+editable
[project]
name = "demo_auction"
version = "0.0.1"
Expand Down Expand Up @@ -25,10 +26,22 @@ _isort = "isort ."
_black = "black ."
_ruff = "ruff check --fix ."
_mypy = "mypy --no-incremental --exclude demo_auction ."
all = { composite = ["fmt", "lint"] }
fmt = { composite = ["_isort", "_black"] }
lint = { composite = ["_ruff", "_mypy"] }
image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_auction:latest"

[tool.pdm.scripts.all]
help = "Run all checks"
composite = ["fmt", "lint"]

[tool.pdm.scripts.fmt]
help = "Format code with isort and black"
composite = ["_isort", "_black"]

[tool.pdm.scripts.image]
help = "Build Docker image"
cmd = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_auction:latest"

[tool.pdm.scripts.lint]
help = "Check code with ruff and mypy"
composite = ["_ruff", "_mypy"]

[tool.isort]
line_length = 120
Expand Down
1 change: 1 addition & 0 deletions src/demo_big_maps/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from dipdup import fields

from dipdup.models import Model


Expand Down
21 changes: 17 additions & 4 deletions src/demo_big_maps/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated by DipDup 7.0.2+editable
[project]
name = "demo_big_maps"
version = "0.0.1"
Expand Down Expand Up @@ -25,10 +26,22 @@ _isort = "isort ."
_black = "black ."
_ruff = "ruff check --fix ."
_mypy = "mypy --no-incremental --exclude demo_big_maps ."
all = { composite = ["fmt", "lint"] }
fmt = { composite = ["_isort", "_black"] }
lint = { composite = ["_ruff", "_mypy"] }
image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_big_maps:latest"

[tool.pdm.scripts.all]
help = "Run all checks"
composite = ["fmt", "lint"]

[tool.pdm.scripts.fmt]
help = "Format code with isort and black"
composite = ["_isort", "_black"]

[tool.pdm.scripts.image]
help = "Build Docker image"
cmd = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_big_maps:latest"

[tool.pdm.scripts.lint]
help = "Check code with ruff and mypy"
composite = ["_ruff", "_mypy"]

[tool.isort]
line_length = 120
Expand Down
Loading

0 comments on commit d9ff712

Please sign in to comment.