Skip to content

Commit

Permalink
Merge branch 'next' into fix/subsquid-substrate-dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout committed Jan 29, 2025
2 parents 83bdfaa + 798c5d2 commit e58efc9
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 31 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Releases prior to 7.0 has been removed from this file to declutter search result

- substrate.subsquid: Fixed parsing nested structures in response.

### Deprecated

- package: DipDup packages are expected to have `pyproject.toml` and `dipdup.yaml` files in the root directory. This will become a requirement in 9.0.

### Other

- deps: `tortoise-orm` updated to 0.24.0.

## [8.2.0rc1] - 2025-01-24

### Added
Expand Down
5 changes: 5 additions & 0 deletions docs/9.release-notes/_8.0_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
- performance: All time intervals are now measured in seconds.
- performance: Several metrics have been renamed and new ones have been added.

### Deprecated

- package: DipDup packages are expected to have `pyproject.toml` and `dipdup.yaml` files in the root directory. This will become a requirement in 9.0.

### Removed

- config: Removed `advanced.skip_version_check` flag; use `DIPDUP_NO_VERSION_CHECK` environment variable.
Expand All @@ -86,4 +90,5 @@
- deps: `sentry-sdk` updated to 2.1.
- deps: `tortoise-orm` updated to 0.20.1.
- deps: `tortoise-orm` updated to 0.21.2.
- deps: `tortoise-orm` updated to 0.24.0.
- deps: `web3` updated to 6.18.
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,15 @@ dependencies = [
"pyhumps~=3.8",
"pysignalr~=1.0",
"python-dotenv~=1.0",
"python-json-logger~=2.0",
"python-json-logger~=2.0", # pinned
"ruamel.yaml~=0.18.6",
"sentry-sdk~=2.16",
"sqlparse~=0.5",
"starknet-py~=0.25.0", # pinned
"strict-rfc3339~=0.7",
"survey~=5.4",
"tabulate~=0.9",
# TODO: 0.23.0 available
"tortoise-orm==0.21.7", # pinned
"tortoise-orm==0.24.0", # pinned
"uvloop~=0.20",
"web3~=7.2",
]
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ pydantic-core==2.27.2 \
pyhumps==3.8.0 \
--hash=sha256:060e1954d9069f428232a1adda165db0b9d8dfdce1d265d36df7fbff540acfd6 \
--hash=sha256:498026258f7ee1a8e447c2e28526c0bea9407f9a59c03260aee4bd6c04d681a3
pypika-tortoise==0.2.2 \
--hash=sha256:e93190aedd95acb08b69636bc2328cc053b2c9971307b6d44405bc6d9f9b71a5 \
--hash=sha256:f0fbc9e0c3ddc33118a5be69907428863849df60788e125edef1f46a6261d63b
pypika-tortoise==0.5.0 \
--hash=sha256:dbdc47eb52ce17407b05ce9f8560ce93b856d7b28beb01971d956b017846691f \
--hash=sha256:ed0f56761868dc222c03e477578638590b972280b03c7c45cd93345b18b61f58
pysignalr==1.1.0 \
--hash=sha256:17977720e3360403b05e8c764a28c70a3865fef973cc0f08bd877101f06ae815 \
--hash=sha256:f9e9ed611c999043778ebb9e5bd7d92e0afae3f9555eb73d447335e48de3b385
Expand Down Expand Up @@ -526,9 +526,9 @@ tabulate==0.9.0 \
toolz==1.0.0 ; implementation_name == 'cpython' or implementation_name == 'pypy' \
--hash=sha256:292c8f1c4e7516bf9086f8850935c799a874039c8bcf959d47b600e4c44a6236 \
--hash=sha256:2c86e3d9a04798ac556793bced838816296a2f085017664e4995cb40a1047a02
tortoise-orm==0.21.7 \
--hash=sha256:2229925885461f424673223ea1875bd5e6961384c766833af55a1ea11a9b25eb \
--hash=sha256:8a790a931828aa37ac364b344c561e603422aced2af5e403f6790575da0f19c5
tortoise-orm==0.24.0 \
--hash=sha256:ae0704a93ea27931724fc899e57268c8081afce3b32b110b00037ec206553e7d \
--hash=sha256:ee3b72b226767293b24c5c4906ae5f027d7cc84496cd503352c918564b4fd687
typeguard==4.4.1 \
--hash=sha256:0d22a89d00b453b47c49875f42b6601b961757541a2e1e0ef517b6e24213c21b \
--hash=sha256:9324ec07a27ec67fc54a9c063020ca4c0ae6abad5e9f0f9804ca59aee68c6e21
Expand Down
2 changes: 2 additions & 0 deletions src/dipdup/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,7 @@ async def self_install(
editable=editable,
with_pdm=replay is not None and replay['package_manager'] == 'pdm',
with_poetry=replay is not None and replay['package_manager'] == 'poetry',
with_uv=replay is not None and replay['package_manager'] == 'uv',
)


Expand Down Expand Up @@ -972,6 +973,7 @@ async def self_update(
update=True,
with_pdm=replay is not None and replay['package_manager'] == 'pdm',
with_poetry=replay is not None and replay['package_manager'] == 'poetry',
with_uv=replay is not None and replay['package_manager'] == 'uv',
)


Expand Down
2 changes: 1 addition & 1 deletion src/dipdup/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@


JSONField = partial(
_JSONField,
_JSONField[Any],
encoder=json_dumps_plain,
decoder=orjson.loads,
)
Expand Down
14 changes: 7 additions & 7 deletions src/dipdup/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,30 +309,30 @@ async def _execute(self) -> int:


class BulkUpdateQuery(TortoiseBulkUpdateQuery): # type: ignore[type-arg]
async def _execute(self) -> int:
for model in self.objects:
async def _execute_many(self, queries_with_params: list[tuple[str, list[Any]]]) -> int:
for model in self._objects:
if update := ModelUpdate.from_model(
cast(Model, model),
ModelUpdateAction.UPDATE,
):
get_pending_updates().append(update)

return await super()._execute()
return await super()._execute_many(queries_with_params)


class BulkCreateQuery(TortoiseBulkCreateQuery): # type: ignore[type-arg]
async def _execute(self) -> None:
for model in self.objects:
async def _execute_many(self, insert_sql: str, insert_sql_all: str) -> None:
for model in self._objects:
if update := ModelUpdate.from_model(
cast(Model, model),
ModelUpdateAction.INSERT,
):
get_pending_updates().append(update)

await super()._execute()
await super()._execute_many(insert_sql, insert_sql_all)

# NOTE: A bug; raises "You should first call .save()..." otherwise
for model in self.objects:
for model in self._objects:
model._saved_in_db = True


Expand Down
14 changes: 14 additions & 0 deletions src/dipdup/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def __init__(self, root: Path, quiet: bool = False) -> None:
self.root = root
self.name = root.name

# NOTE: Paths expected to exist in package root
self.pyproject = root.parent / 'pyproject.toml'
self.root_config = root.parent / 'dipdup.yaml'

# NOTE: Package sections with .keep markers
self.abi = root / 'abi'
self.configs = root / 'configs'
Expand Down Expand Up @@ -164,6 +168,16 @@ def _pre_init(self) -> None:
if self.root.exists() and not self.root.is_dir():
raise ProjectPackageError(f'`{self.root}` exists and not a directory')

# TODO: Remove in 9.0
def act(x: str) -> None:
if env.NEXT:
raise ProjectPackageError(x)
_logger.warning(x)

for path in (self.root_config, self.pyproject):
if not path.is_file():
act(f'`{path}` not found. Have you created a project with `dipdup new` command?')

def _post_init(self) -> None:
# NOTE: Allows plain package structure to be imported
if self.root != Path.cwd() or env.NO_SYMLINK:
Expand Down
27 changes: 13 additions & 14 deletions uv.lock

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

0 comments on commit e58efc9

Please sign in to comment.