From d9ff7122c022b6759af1e02ec65df27e9b7ee698 Mon Sep 17 00:00:00 2001 From: Lev Gorodetskiy Date: Fri, 20 Oct 2023 09:41:09 -0300 Subject: [PATCH] Add help messages to pyproject.toml scripts (#863) --- CHANGELOG.md | 1 + pdm.lock | 87 +++++++++---------- pyproject.toml | 73 +++++++++++----- requirements.dev.txt | 10 +-- requirements.txt | 8 +- src/demo_auction/models/__init__.py | 1 + src/demo_auction/pyproject.toml | 21 ++++- src/demo_big_maps/models/__init__.py | 1 + src/demo_big_maps/pyproject.toml | 21 ++++- src/demo_blank/pyproject.toml | 21 ++++- src/demo_dao/models/__init__.py | 1 + src/demo_dao/pyproject.toml | 21 ++++- src/demo_dex/models/__init__.py | 1 + src/demo_dex/pyproject.toml | 21 ++++- src/demo_domains/models/__init__.py | 1 + src/demo_domains/pyproject.toml | 21 ++++- src/demo_events/pyproject.toml | 21 ++++- src/demo_evm_events/pyproject.toml | 21 ++++- src/demo_factories/handlers/on_transfer.py | 5 +- src/demo_factories/models/__init__.py | 3 +- src/demo_factories/pyproject.toml | 21 ++++- src/demo_head/pyproject.toml | 21 ++++- src/demo_nft_marketplace/models/__init__.py | 2 + src/demo_nft_marketplace/pyproject.toml | 21 ++++- src/demo_raw/models/__init__.py | 3 +- src/demo_raw/pyproject.toml | 21 ++++- src/demo_token/models/__init__.py | 1 + src/demo_token/pyproject.toml | 21 ++++- src/demo_token_transfers/models/__init__.py | 1 + src/demo_token_transfers/pyproject.toml | 21 ++++- src/demo_uniswap/pyproject.toml | 21 ++++- src/dipdup/cli.py | 2 - src/dipdup/config/__init__.py | 4 + src/dipdup/project.py | 5 +- src/dipdup/projects/base/pyproject.toml.j2 | 21 ++++- .../projects/demo_uniswap/models/repo.py.j2 | 4 +- src/dipdup/sys.py | 3 + 37 files changed, 407 insertions(+), 146 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9e25bf27..0d1510c5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pdm.lock b/pdm.lock index a2c96f1ac..4195bbb51 100644 --- a/pdm.lock +++ b/pdm.lock @@ -236,7 +236,7 @@ files = [ [[package]] name = "black" -version = "23.9.1" +version = "23.10.0" requires_python = ">=3.8" summary = "The uncompromising code formatter." dependencies = [ @@ -247,13 +247,12 @@ dependencies = [ "platformdirs>=2", ] files = [ - {file = "black-23.9.1-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:8431445bf62d2a914b541da7ab3e2b4f3bc052d2ccbf157ebad18ea126efb91f"}, - {file = "black-23.9.1-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:8fc1ddcf83f996247505db6b715294eba56ea9372e107fd54963c7553f2b6dfe"}, - {file = "black-23.9.1-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:7d30ec46de88091e4316b17ae58bbbfc12b2de05e069030f6b747dfc649ad186"}, - {file = "black-23.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:031e8c69f3d3b09e1aa471a926a1eeb0b9071f80b17689a655f7885ac9325a6f"}, - {file = "black-23.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:538efb451cd50f43aba394e9ec7ad55a37598faae3348d723b59ea8e91616300"}, - {file = "black-23.9.1-py3-none-any.whl", hash = "sha256:6ccd59584cc834b6d127628713e4b6b968e5f79572da66284532525a042549f9"}, - {file = "black-23.9.1.tar.gz", hash = "sha256:24b6b3ff5c6d9ea08a8888f6977eae858e1f340d7260cf56d70a49823236b62d"}, + {file = "black-23.10.0-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:30b78ac9b54cf87bcb9910ee3d499d2bc893afd52495066c49d9ee6b21eee06e"}, + {file = "black-23.10.0-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:0e232f24a337fed7a82c1185ae46c56c4a6167fb0fe37411b43e876892c76699"}, + {file = "black-23.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31946ec6f9c54ed7ba431c38bc81d758970dd734b96b8e8c2b17a367d7908171"}, + {file = "black-23.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:c870bee76ad5f7a5ea7bd01dc646028d05568d33b0b09b7ecfc8ec0da3f3f39c"}, + {file = "black-23.10.0-py3-none-any.whl", hash = "sha256:e223b731a0e025f8ef427dd79d8cd69c167da807f5710add30cdf131f13dd62e"}, + {file = "black-23.10.0.tar.gz", hash = "sha256:31b9f87b277a68d0e99d2905edae08807c007973eaa609da5f0c62def6b7c0bd"}, ] [[package]] @@ -954,21 +953,21 @@ files = [ [[package]] name = "orjson" -version = "3.9.8" +version = "3.9.9" requires_python = ">=3.8" summary = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" files = [ - {file = "orjson-3.9.8-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:8a1c92f467f5fd0f8fb79273006b563364b1e45667b3760423498348dc2e22fa"}, - {file = "orjson-3.9.8-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:742d4d16d66579ffff4b2048a8de4a0b03d731847233e92c4edd418a9c582d0f"}, - {file = "orjson-3.9.8-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6d1aab08b373232f568ea9ae048f9f77e09f389068afee6dd44bb6140e2c3ea3"}, - {file = "orjson-3.9.8-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:68ed63273ec4ecdd7865e9d984d65a749c0d780882cf9dde6ab2bc6323f6471a"}, - {file = "orjson-3.9.8-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d23edcb32383f3d86b2f4914f9825ce2d67625abd34be6e5ed1f59ec30127b7a"}, - {file = "orjson-3.9.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9bcd3a48b260d3dfe68b8ce93d11f99a70bd4c908efe22d195a1b1dcfb15ac2"}, - {file = "orjson-3.9.8-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:9ce982f3c1df83f7dc74f3b2690605470ff4790d12558e44359f01e822c5cb08"}, - {file = "orjson-3.9.8-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:4433dd903d5b022a64e9dd1dca94f08ab04d5d928a0ecd33dd46110468960879"}, - {file = "orjson-3.9.8-cp311-none-win32.whl", hash = "sha256:a119c73520192c2882d0549151b9cdd65e0bb5396bedf8951ba5f70d6a873879"}, - {file = "orjson-3.9.8-cp311-none-win_amd64.whl", hash = "sha256:764306f6370e6c76cbbf3139dd9b05be9c4481ee0b15966bd1907827a5777216"}, - {file = "orjson-3.9.8.tar.gz", hash = "sha256:ed1adc6db9841974170a5195b827ee4e392b1e8ca385b19fcdc3248489844059"}, + {file = "orjson-3.9.9-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:31d676bc236f6e919d100fb85d0a99812cff1ebffaa58106eaaec9399693e227"}, + {file = "orjson-3.9.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:678ffb5c0a6b1518b149cc328c610615d70d9297e351e12c01d0beed5d65360f"}, + {file = "orjson-3.9.9-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a71b0cc21f2c324747bc77c35161e0438e3b5e72db6d3b515310457aba743f7f"}, + {file = "orjson-3.9.9-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae72621f216d1d990468291b1ec153e1b46e0ed188a86d54e0941f3dabd09ee8"}, + {file = "orjson-3.9.9-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:512e5a41af008e76451f5a344941d61f48dddcf7d7ddd3073deb555de64596a6"}, + {file = "orjson-3.9.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f89dc338a12f4357f5bf1b098d3dea6072fb0b643fd35fec556f4941b31ae27"}, + {file = "orjson-3.9.9-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:957a45fb201c61b78bcf655a16afbe8a36c2c27f18a998bd6b5d8a35e358d4ad"}, + {file = "orjson-3.9.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d1c01cf4b8e00c7e98a0a7cf606a30a26c32adf2560be2d7d5d6766d6f474b31"}, + {file = "orjson-3.9.9-cp311-none-win32.whl", hash = "sha256:397a185e5dd7f8ebe88a063fe13e34d61d394ebb8c70a443cee7661b9c89bda7"}, + {file = "orjson-3.9.9-cp311-none-win_amd64.whl", hash = "sha256:24301f2d99d670ded4fb5e2f87643bc7428a54ba49176e38deb2887e42fe82fb"}, + {file = "orjson-3.9.9.tar.gz", hash = "sha256:02e693843c2959befdd82d1ebae8b05ed12d1cb821605d5f9fe9f98ca5c9fd2b"}, ] [[package]] @@ -1458,40 +1457,40 @@ files = [ [[package]] name = "ruff" -version = "0.0.292" +version = "0.1.0" requires_python = ">=3.7" summary = "An extremely fast Python linter, written in Rust." files = [ - {file = "ruff-0.0.292-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:02f29db018c9d474270c704e6c6b13b18ed0ecac82761e4fcf0faa3728430c96"}, - {file = "ruff-0.0.292-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:69654e564342f507edfa09ee6897883ca76e331d4bbc3676d8a8403838e9fade"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c3c91859a9b845c33778f11902e7b26440d64b9d5110edd4e4fa1726c41e0a4"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f4476f1243af2d8c29da5f235c13dca52177117935e1f9393f9d90f9833f69e4"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:be8eb50eaf8648070b8e58ece8e69c9322d34afe367eec4210fdee9a555e4ca7"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:9889bac18a0c07018aac75ef6c1e6511d8411724d67cb879103b01758e110a81"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6bdfabd4334684a4418b99b3118793f2c13bb67bf1540a769d7816410402a205"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aa7c77c53bfcd75dbcd4d1f42d6cabf2485d2e1ee0678da850f08e1ab13081a8"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e087b24d0d849c5c81516ec740bf4fd48bf363cfb104545464e0fca749b6af9"}, - {file = "ruff-0.0.292-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f160b5ec26be32362d0774964e218f3fcf0a7da299f7e220ef45ae9e3e67101a"}, - {file = "ruff-0.0.292-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ac153eee6dd4444501c4bb92bff866491d4bfb01ce26dd2fff7ca472c8df9ad0"}, - {file = "ruff-0.0.292-py3-none-musllinux_1_2_i686.whl", hash = "sha256:87616771e72820800b8faea82edd858324b29bb99a920d6aa3d3949dd3f88fb0"}, - {file = "ruff-0.0.292-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b76deb3bdbea2ef97db286cf953488745dd6424c122d275f05836c53f62d4016"}, - {file = "ruff-0.0.292-py3-none-win32.whl", hash = "sha256:e854b05408f7a8033a027e4b1c7f9889563dd2aca545d13d06711e5c39c3d003"}, - {file = "ruff-0.0.292-py3-none-win_amd64.whl", hash = "sha256:f27282bedfd04d4c3492e5c3398360c9d86a295be00eccc63914438b4ac8a83c"}, - {file = "ruff-0.0.292-py3-none-win_arm64.whl", hash = "sha256:7f67a69c8f12fbc8daf6ae6d36705037bde315abf8b82b6e1f4c9e74eb750f68"}, - {file = "ruff-0.0.292.tar.gz", hash = "sha256:1093449e37dd1e9b813798f6ad70932b57cf614e5c2b5c51005bf67d55db33ac"}, + {file = "ruff-0.1.0-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:87114e254dee35e069e1b922d85d4b21a5b61aec759849f393e1dbb308a00439"}, + {file = "ruff-0.1.0-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:764f36d2982cc4a703e69fb73a280b7c539fd74b50c9ee531a4e3fe88152f521"}, + {file = "ruff-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:65f4b7fb539e5cf0f71e9bd74f8ddab74cabdd673c6fb7f17a4dcfd29f126255"}, + {file = "ruff-0.1.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:299fff467a0f163baa282266b310589b21400de0a42d8f68553422fa6bf7ee01"}, + {file = "ruff-0.1.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0d412678bf205787263bb702c984012a4f97e460944c072fd7cfa2bd084857c4"}, + {file = "ruff-0.1.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:a5391b49b1669b540924640587d8d24128e45be17d1a916b1801d6645e831581"}, + {file = "ruff-0.1.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ee8cd57f454cdd77bbcf1e11ff4e0046fb6547cac1922cc6e3583ce4b9c326d1"}, + {file = "ruff-0.1.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fa7aeed7bc23861a2b38319b636737bf11cfa55d2109620b49cf995663d3e888"}, + {file = "ruff-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b04cd4298b43b16824d9a37800e4c145ba75c29c43ce0d74cad1d66d7ae0a4c5"}, + {file = "ruff-0.1.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7186ccf54707801d91e6314a016d1c7895e21d2e4cd614500d55870ed983aa9f"}, + {file = "ruff-0.1.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:d88adfd93849bc62449518228581d132e2023e30ebd2da097f73059900d8dce3"}, + {file = "ruff-0.1.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:ad2ccdb3bad5a61013c76a9c1240fdfadf2c7103a2aeebd7bcbbed61f363138f"}, + {file = "ruff-0.1.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b77f6cfa72c6eb19b5cac967cc49762ae14d036db033f7d97a72912770fd8e1c"}, + {file = "ruff-0.1.0-py3-none-win32.whl", hash = "sha256:480bd704e8af1afe3fd444cc52e3c900b936e6ca0baf4fb0281124330b6ceba2"}, + {file = "ruff-0.1.0-py3-none-win_amd64.whl", hash = "sha256:a76ba81860f7ee1f2d5651983f87beb835def94425022dc5f0803108f1b8bfa2"}, + {file = "ruff-0.1.0-py3-none-win_arm64.whl", hash = "sha256:45abdbdab22509a2c6052ecf7050b3f5c7d6b7898dc07e82869401b531d46da4"}, + {file = "ruff-0.1.0.tar.gz", hash = "sha256:ad6b13824714b19c5f8225871cf532afb994470eecb74631cd3500fe817e6b3f"}, ] [[package]] name = "sentry-sdk" -version = "1.31.0" +version = "1.32.0" summary = "Python client for Sentry (https://sentry.io)" dependencies = [ "certifi", "urllib3>=1.26.11; python_version >= \"3.6\"", ] files = [ - {file = "sentry-sdk-1.31.0.tar.gz", hash = "sha256:6de2e88304873484207fed836388e422aeff000609b104c802749fd89d56ba5b"}, - {file = "sentry_sdk-1.31.0-py2.py3-none-any.whl", hash = "sha256:64a7141005fb775b9db298a30de93e3b83e0ddd1232dc6f36eb38aebc1553291"}, + {file = "sentry-sdk-1.32.0.tar.gz", hash = "sha256:935e8fbd7787a3702457393b74b13d89a5afb67185bc0af85c00cb27cbd42e7c"}, + {file = "sentry_sdk-1.32.0-py2.py3-none-any.whl", hash = "sha256:eeb0b3550536f3bbc05bb1c7e0feb3a78d74acb43b607159a606ed2ec0a33a4d"}, ] [[package]] @@ -1820,7 +1819,7 @@ files = [ [[package]] name = "web3" -version = "6.10.0" +version = "6.11.0" requires_python = ">=3.7.2" summary = "web3.py" dependencies = [ @@ -1841,8 +1840,8 @@ dependencies = [ "websockets>=10.0.0", ] files = [ - {file = "web3-6.10.0-py3-none-any.whl", hash = "sha256:070625a0da4f0fcac090fa95186e0b865a1bbc43efb78fd2ee805f7bf9cd8986"}, - {file = "web3-6.10.0.tar.gz", hash = "sha256:ea89f8a6ee74b74c3ff21954eafe00ec914365adb904c6c374f559bc46d4a61c"}, + {file = "web3-6.11.0-py3-none-any.whl", hash = "sha256:44e79da6a4765eacf137f2f388e37aa0c1e24a93bdfb462cffe9441d1be3d509"}, + {file = "web3-6.11.0.tar.gz", hash = "sha256:050dea52ae73d787272e7ecba7249f096595938c90cce1a384c20375c6b0f720"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index d53fa72dc..28adf8991 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"] diff --git a/requirements.dev.txt b/requirements.dev.txt index 642cc6d9a..0d8d8c184 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/requirements.txt b/requirements.txt index 7e9cbb23d..86c34bdc8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/src/demo_auction/models/__init__.py b/src/demo_auction/models/__init__.py index 34c8f6e15..81bbc1027 100644 --- a/src/demo_auction/models/__init__.py +++ b/src/demo_auction/models/__init__.py @@ -1,5 +1,6 @@ from enum import IntEnum + from dipdup import fields from dipdup.models import Model diff --git a/src/demo_auction/pyproject.toml b/src/demo_auction/pyproject.toml index 87a4c6ba1..e903c5409 100644 --- a/src/demo_auction/pyproject.toml +++ b/src/demo_auction/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_auction" version = "0.0.1" @@ -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 diff --git a/src/demo_big_maps/models/__init__.py b/src/demo_big_maps/models/__init__.py index 7daaa1739..ed7d799e8 100644 --- a/src/demo_big_maps/models/__init__.py +++ b/src/demo_big_maps/models/__init__.py @@ -1,5 +1,6 @@ from dipdup import fields + from dipdup.models import Model diff --git a/src/demo_big_maps/pyproject.toml b/src/demo_big_maps/pyproject.toml index 0753b612d..0b8be9e98 100644 --- a/src/demo_big_maps/pyproject.toml +++ b/src/demo_big_maps/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_big_maps" version = "0.0.1" @@ -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 diff --git a/src/demo_blank/pyproject.toml b/src/demo_blank/pyproject.toml index b2691dfc8..d7b9a5f2a 100644 --- a/src/demo_blank/pyproject.toml +++ b/src/demo_blank/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_blank" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_blank ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_blank: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_blank:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_dao/models/__init__.py b/src/demo_dao/models/__init__.py index 6ccb9d8cc..6afee512f 100644 --- a/src/demo_dao/models/__init__.py +++ b/src/demo_dao/models/__init__.py @@ -1,5 +1,6 @@ from dipdup import fields + from dipdup.models import Model diff --git a/src/demo_dao/pyproject.toml b/src/demo_dao/pyproject.toml index 314dcfdda..ed8e09859 100644 --- a/src/demo_dao/pyproject.toml +++ b/src/demo_dao/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_dao" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_dao ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_dao: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_dao:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_dex/models/__init__.py b/src/demo_dex/models/__init__.py index 4738efd55..abaa84fd9 100644 --- a/src/demo_dex/models/__init__.py +++ b/src/demo_dex/models/__init__.py @@ -1,6 +1,7 @@ from enum import IntEnum from dipdup import fields + from dipdup.models import Model diff --git a/src/demo_dex/pyproject.toml b/src/demo_dex/pyproject.toml index 3086a4c0a..7a78a63a4 100644 --- a/src/demo_dex/pyproject.toml +++ b/src/demo_dex/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_dex" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_dex ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_dex: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_dex:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_domains/models/__init__.py b/src/demo_domains/models/__init__.py index 0b8afea86..02e2e637c 100644 --- a/src/demo_domains/models/__init__.py +++ b/src/demo_domains/models/__init__.py @@ -1,5 +1,6 @@ from dipdup import fields + from dipdup.models import Model diff --git a/src/demo_domains/pyproject.toml b/src/demo_domains/pyproject.toml index ca4300aa0..83d7de114 100644 --- a/src/demo_domains/pyproject.toml +++ b/src/demo_domains/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_domains" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_domains ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_domains: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_domains:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_events/pyproject.toml b/src/demo_events/pyproject.toml index 3adf9be74..a0d28f383 100644 --- a/src/demo_events/pyproject.toml +++ b/src/demo_events/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_events" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_events ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_events: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_events:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_evm_events/pyproject.toml b/src/demo_evm_events/pyproject.toml index c597edef7..4a660e146 100644 --- a/src/demo_evm_events/pyproject.toml +++ b/src/demo_evm_events/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_evm_events" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_evm_events ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_evm_events: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_evm_events:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_factories/handlers/on_transfer.py b/src/demo_factories/handlers/on_transfer.py index 6c3881545..ef792c5b5 100644 --- a/src/demo_factories/handlers/on_transfer.py +++ b/src/demo_factories/handlers/on_transfer.py @@ -1,8 +1,9 @@ +from dipdup.context import HandlerContext +from dipdup.models.tezos_tzkt import TzktTransaction + import demo_factories.models as models from demo_factories.types.token.tezos_parameters.transfer import TransferParameter from demo_factories.types.token.tezos_storage import TokenStorage -from dipdup.context import HandlerContext -from dipdup.models.tezos_tzkt import TzktTransaction async def on_transfer( diff --git a/src/demo_factories/models/__init__.py b/src/demo_factories/models/__init__.py index 16efd6f76..d6749bf61 100644 --- a/src/demo_factories/models/__init__.py +++ b/src/demo_factories/models/__init__.py @@ -1,7 +1,8 @@ from dipdup import fields -from dipdup.models import Model +from dipdup.models import Model + class Transfer(Model): id = fields.IntField(pk=True) diff --git a/src/demo_factories/pyproject.toml b/src/demo_factories/pyproject.toml index cf8d5f71b..c87acd14f 100644 --- a/src/demo_factories/pyproject.toml +++ b/src/demo_factories/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_factories" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_factories ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_factories: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_factories:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_head/pyproject.toml b/src/demo_head/pyproject.toml index ce9961ad5..f6a880e16 100644 --- a/src/demo_head/pyproject.toml +++ b/src/demo_head/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_head" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_head ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_head: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_head:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_nft_marketplace/models/__init__.py b/src/demo_nft_marketplace/models/__init__.py index 8d6a83557..dabe43e54 100644 --- a/src/demo_nft_marketplace/models/__init__.py +++ b/src/demo_nft_marketplace/models/__init__.py @@ -1,6 +1,8 @@ from enum import IntEnum + from dipdup import fields + from dipdup.models import Model diff --git a/src/demo_nft_marketplace/pyproject.toml b/src/demo_nft_marketplace/pyproject.toml index ec5917fdc..e1456fa61 100644 --- a/src/demo_nft_marketplace/pyproject.toml +++ b/src/demo_nft_marketplace/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_nft_marketplace" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_nft_marketplace ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_nft_marketplace: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_nft_marketplace:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_raw/models/__init__.py b/src/demo_raw/models/__init__.py index 23be1468d..7611bc676 100644 --- a/src/demo_raw/models/__init__.py +++ b/src/demo_raw/models/__init__.py @@ -1,6 +1,7 @@ from dipdup import fields -from dipdup.models import Model + from dipdup.models.tezos_tzkt import TzktOperationType +from dipdup.models import Model class Operation(Model): diff --git a/src/demo_raw/pyproject.toml b/src/demo_raw/pyproject.toml index 1ad94b476..0a0e4da86 100644 --- a/src/demo_raw/pyproject.toml +++ b/src/demo_raw/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_raw" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_raw ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_raw: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_raw:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_token/models/__init__.py b/src/demo_token/models/__init__.py index 5b81565c2..e84aee5e5 100644 --- a/src/demo_token/models/__init__.py +++ b/src/demo_token/models/__init__.py @@ -1,4 +1,5 @@ from dipdup import fields + from dipdup.models import Model diff --git a/src/demo_token/pyproject.toml b/src/demo_token/pyproject.toml index 17f3695cc..8e991f514 100644 --- a/src/demo_token/pyproject.toml +++ b/src/demo_token/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_token" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_token ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_token: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_token:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_token_transfers/models/__init__.py b/src/demo_token_transfers/models/__init__.py index 5b81565c2..e84aee5e5 100644 --- a/src/demo_token_transfers/models/__init__.py +++ b/src/demo_token_transfers/models/__init__.py @@ -1,4 +1,5 @@ from dipdup import fields + from dipdup.models import Model diff --git a/src/demo_token_transfers/pyproject.toml b/src/demo_token_transfers/pyproject.toml index 8eed8325b..9ee68568a 100644 --- a/src/demo_token_transfers/pyproject.toml +++ b/src/demo_token_transfers/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_token_transfers" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_token_transfers ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_token_transfers: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_token_transfers:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/demo_uniswap/pyproject.toml b/src/demo_uniswap/pyproject.toml index 842c82de7..0edbcdadb 100644 --- a/src/demo_uniswap/pyproject.toml +++ b/src/demo_uniswap/pyproject.toml @@ -1,3 +1,4 @@ +# Generated by DipDup 7.0.2+editable [project] name = "demo_uniswap" version = "0.0.1" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude demo_uniswap ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t demo_uniswap: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_uniswap:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = 120 diff --git a/src/dipdup/cli.py b/src/dipdup/cli.py index bb35be168..2fbb676a4 100644 --- a/src/dipdup/cli.py +++ b/src/dipdup/cli.py @@ -217,8 +217,6 @@ async def cli(ctx: click.Context, config: list[str], env_file: list[str]) -> Non from dipdup.sys import set_up_logging set_up_logging() - if env.DEBUG: - logging.getLogger('dipdup').setLevel(logging.DEBUG) env_file_paths = [Path(file) for file in env_file] config_paths = [Path(file) for file in config] diff --git a/src/dipdup/config/__init__.py b/src/dipdup/config/__init__.py index 8740486aa..f045c5199 100644 --- a/src/dipdup/config/__init__.py +++ b/src/dipdup/config/__init__.py @@ -737,6 +737,10 @@ def get_evm_node_datasource(self, name: str) -> EvmNodeDatasourceConfig: return datasource def set_up_logging(self) -> None: + if env.DEBUG: + logging.getLogger('dipdup').setLevel(logging.DEBUG) + logging.getLogger(self.package).setLevel(logging.DEBUG) + loglevels = self.logging if not isinstance(loglevels, dict): loglevels = { diff --git a/src/dipdup/project.py b/src/dipdup/project.py index 58d46bad7..8698b1efc 100644 --- a/src/dipdup/project.py +++ b/src/dipdup/project.py @@ -317,5 +317,8 @@ def _render(answers: Answers, template_path: Path, output_path: Path, force: boo _logger.info('Generating `%s`', output_path) template = load_template(str(template_path)) - content = template.render(project=answers) + content = template.render( + project=answers, + __version__=__version__, + ) write(output_path, content, overwrite=force) diff --git a/src/dipdup/projects/base/pyproject.toml.j2 b/src/dipdup/projects/base/pyproject.toml.j2 index 01a852880..77a96fb5b 100644 --- a/src/dipdup/projects/base/pyproject.toml.j2 +++ b/src/dipdup/projects/base/pyproject.toml.j2 @@ -1,3 +1,4 @@ +# Generated by DipDup {{ __version__ }} [project] name = "{{ project.package }}" version = "{{ project.version }}" @@ -25,10 +26,22 @@ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." _mypy = "mypy --no-incremental --exclude {{ project.package }} ." -all = { composite = ["fmt", "lint"] } -fmt = { composite = ["_isort", "_black"] } -lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t {{ project.package }}: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 {{ project.package }}:latest" + +[tool.pdm.scripts.lint] +help = "Check code with ruff and mypy" +composite = ["_ruff", "_mypy"] [tool.isort] line_length = {{ project.line_length }} diff --git a/src/dipdup/projects/demo_uniswap/models/repo.py.j2 b/src/dipdup/projects/demo_uniswap/models/repo.py.j2 index e2e774ce5..6e0171630 100644 --- a/src/dipdup/projects/demo_uniswap/models/repo.py.j2 +++ b/src/dipdup/projects/demo_uniswap/models/repo.py.j2 @@ -2,7 +2,7 @@ from decimal import Decimal from typing import Any from typing import cast -from lru import LRU # type: ignore[import-untyped] +from lru import LRU # type: ignore[import-not-found] import {{ project.package }}.models as models from dipdup.config.evm import EvmContractConfig @@ -32,7 +32,7 @@ class ModelsRepo: self._pending_positions[idx] = position def get_pending_position(self, idx: str) -> dict[str, Any] | None: - return self._pending_positions.get(idx, None) + return self._pending_positions.get(idx, None) # type: ignore[no-any-return] async def get_ctx_factory(ctx: HandlerContext) -> models.Factory: diff --git a/src/dipdup/sys.py b/src/dipdup/sys.py index 11e52b9f8..a60a55f59 100644 --- a/src/dipdup/sys.py +++ b/src/dipdup/sys.py @@ -38,6 +38,9 @@ def set_up_logging() -> None: # NOTE: Nothing useful there logging.getLogger('tortoise').setLevel(logging.WARNING) + if env.DEBUG: + logging.getLogger('dipdup').setLevel(logging.DEBUG) + def set_up_process(signals: bool) -> None: """Set up interpreter process-wide state"""