Skip to content

Commit de80252

Browse files
mypy --strict, rewrite tests, bugfixes (#543)
1 parent 4bbf8e4 commit de80252

File tree

167 files changed

+1828
-1681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+1828
-1681
lines changed

CHANGELOG.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,26 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning].
66

7-
## [Unreleased]
7+
## [6.3.1] - 2022-11-25
88

99
### Fixed
1010

11-
* codegen: Include PEP 561 marker in generated packages.
12-
* codegen: Untyped originations are now correctly handled.
13-
* codegen: Fixed `alias` config field having no effect on originations.
14-
* codegen: Fixed optional arguments in generated callbacks.
15-
* config: Suggest snake_case for package name.
16-
* index: Do not deserialize originations matched by the `source` filter.
17-
* index: Wrap storage deserialization exceptions with `InvalidDataError`.
11+
- cli: Do not apply cli hacks on module import.
12+
- codegen: Include PEP 561 marker in generated packages.
13+
- codegen: Untyped originations are now correctly handled.
14+
- codegen: Fixed `alias` config field having no effect on originations.
15+
- codegen: Fixed optional arguments in generated callbacks.
16+
- config: Suggest snake_case for package name.
17+
- config: Fixed crash with `RuntimeError` when index has no subscriptions.
18+
- http: Limit aiohttp sessions to specific base URL.
19+
- index: Do not deserialize originations matched by the `source` filter.
20+
- index: Wrap storage deserialization exceptions with `InvalidDataError`.
21+
- projects: Fixed Hasura environment in docker-compose examples.
22+
23+
### Other
24+
25+
- ci: `mypy --strict` is now enforced on a codebase.
26+
- ci: Finished migration to `pytest`.
1827

1928
### Security
2029

@@ -831,7 +840,8 @@ This release contains no changes except for the version number.
831840
[semantic versioning]: https://semver.org/spec/v2.0.0.html
832841

833842
<!-- Versions -->
834-
[Unreleased]: https://github.com/dipdup-io/dipdup/compare/6.3.0...HEAD
843+
[Unreleased]: https://github.com/dipdup-io/dipdup/compare/6.3.1...HEAD
844+
[6.3.1]: https://github.com/dipdup-io/dipdup/compare/6.3.0...6.3.1
835845
[6.3.0]: https://github.com/dipdup-io/dipdup/compare/6.2.0...6.3.0
836846
[6.2.0]: https://github.com/dipdup-io/dipdup/compare/6.1.3...6.2.0
837847
[6.1.3]: https://github.com/dipdup-io/dipdup/compare/6.1.2...6.1.3

Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ lint: ## Lint with all tools
3030
test: ## Run test suite
3131
poetry run pytest --cov-report=term-missing --cov=dipdup --cov-report=xml -n auto -s -v tests
3232

33-
test-ci: ## Run test suite without xdist, coverage and some tests (avoid macOS issues)
34-
CI=true poetry run pytest -s -v tests
35-
3633
docs: ## Build docs
3734
scripts/update_cookiecutter.py
3835
cd docs
@@ -50,7 +47,7 @@ flake: ## Lint with flake8
5047
poetry run flakeheaven lint src tests scripts
5148

5249
mypy: ## Lint with mypy
53-
poetry run mypy src tests scripts
50+
poetry run mypy --strict src tests scripts
5451

5552
cover: ## Print coverage for the current branch
5653
poetry run diff-cover --compare-branch `git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'` coverage.xml
@@ -121,6 +118,7 @@ update: ## Update dependencies, export requirements.txt
121118
scripts:
122119
python scripts/update_cookiecutter.py
123120
python scripts/update_demos.py
124-
make lint
121+
rm -r tests/replays/*
122+
make lint test
125123

126124
##

demos/demo-domains-big-map/docker-compose.swarm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ services:
5757
depends_on:
5858
- db
5959
environment:
60-
- HASURA_GRAPHQL_DATABASE_URL=postgres://dipdup:${POSTGRES_PASSWORD:-changeme}@db:5432/dipdup
60+
- HASURA_GRAPHQL_DATABASE_URL=postgres://dipdup:${POSTGRES_PASSWORD:-changeme}@db:5432
6161
- HASURA_GRAPHQL_ENABLE_CONSOLE=true
6262
- HASURA_GRAPHQL_DEV_MODE=false
6363
- HASURA_GRAPHQL_ENABLED_LOG_TYPES=startup, http-log, websocket-log, query-log

demos/demo-domains-big-map/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ services:
3838
- db
3939
restart: always
4040
environment:
41-
- HASURA_GRAPHQL_DATABASE_URL=postgres://dipdup:${POSTGRES_PASSWORD:-changeme}@db:5432/dipdup
41+
- HASURA_GRAPHQL_DATABASE_URL=postgres://dipdup:${POSTGRES_PASSWORD:-changeme}@db:5432
4242
- HASURA_GRAPHQL_ENABLE_CONSOLE=true
4343
- HASURA_GRAPHQL_DEV_MODE=true
4444
- HASURA_GRAPHQL_ENABLED_LOG_TYPES=startup, http-log, webhook-log, websocket-log, query-log

demos/demo-domains-big-map/src/demo_domains_big_map/hooks/on_index_rollback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
async def on_index_rollback(
66
ctx: HookContext,
7-
index: Index,
7+
index: Index, # type: ignore[type-arg]
88
from_level: int,
99
to_level: int,
1010
) -> None:

demos/demo-domains-big-map/src/demo_domains_big_map/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from tortoise import ForeignKeyFieldInstance
21
from tortoise import fields
2+
from tortoise.fields.relational import ForeignKeyFieldInstance
33

44
from dipdup.models import Model
55

demos/demo-domains/docker-compose.swarm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ services:
5757
depends_on:
5858
- db
5959
environment:
60-
- HASURA_GRAPHQL_DATABASE_URL=postgres://dipdup:${POSTGRES_PASSWORD:-changeme}@db:5432/dipdup
60+
- HASURA_GRAPHQL_DATABASE_URL=postgres://dipdup:${POSTGRES_PASSWORD:-changeme}@db:5432
6161
- HASURA_GRAPHQL_ENABLE_CONSOLE=true
6262
- HASURA_GRAPHQL_DEV_MODE=false
6363
- HASURA_GRAPHQL_ENABLED_LOG_TYPES=startup, http-log, websocket-log, query-log

demos/demo-domains/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ services:
3838
- db
3939
restart: always
4040
environment:
41-
- HASURA_GRAPHQL_DATABASE_URL=postgres://dipdup:${POSTGRES_PASSWORD:-changeme}@db:5432/dipdup
41+
- HASURA_GRAPHQL_DATABASE_URL=postgres://dipdup:${POSTGRES_PASSWORD:-changeme}@db:5432
4242
- HASURA_GRAPHQL_ENABLE_CONSOLE=true
4343
- HASURA_GRAPHQL_DEV_MODE=true
4444
- HASURA_GRAPHQL_ENABLED_LOG_TYPES=startup, http-log, webhook-log, websocket-log, query-log

demos/demo-domains/src/demo_domains/hooks/on_index_rollback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
async def on_index_rollback(
66
ctx: HookContext,
7-
index: Index,
7+
index: Index, # type: ignore[type-arg]
88
from_level: int,
99
to_level: int,
1010
) -> None:

demos/demo-domains/src/demo_domains/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Optional
22

3-
from tortoise import ForeignKeyFieldInstance
43
from tortoise import fields
4+
from tortoise.fields.relational import ForeignKeyFieldInstance
55

66
from dipdup.models import Model
77

0 commit comments

Comments
 (0)