Skip to content

Commit 4370521

Browse files
Cleanup and fix Python versions in CI (#67)
1 parent 2ce168b commit 4370521

File tree

14 files changed

+117
-127
lines changed

14 files changed

+117
-127
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@ jobs:
1010
- name: Set up Python
1111
uses: actions/setup-python@v2
1212
with:
13-
python-version: '3.6.x'
13+
python-version: '3.8.x'
1414
- uses: snok/[email protected]
15-
- name: Install dependencies
16-
run: |
17-
sudo apt-get update -q
18-
sudo apt-get install libsodium-dev libsecp256k1-dev libgmp-dev -y
1915
- name: Install project
2016
run: make install
2117
- name: Run lint

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
DEV ?= 1
66

77
all: install lint test cover
8-
lint: isort black pylint mypy
8+
lint: isort black flake mypy
99

1010
debug:
1111
pip install . --force --no-deps
@@ -19,8 +19,8 @@ isort:
1919
black:
2020
poetry run black src tests
2121

22-
pylint:
23-
poetry run pylint src tests || poetry run pylint-exit $$?
22+
flake:
23+
poetry run flakehell lint src tests
2424

2525
mypy:
2626
poetry run mypy src tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Python SDK for developing indexers of [Tezos](https://tezos.com/) smart contract
99

1010
## Quickstart
1111

12-
Python 3.9+ is required for dipdup to run.
12+
Python 3.8+ is required for dipdup to run.
1313

1414
```shell
1515
$ pip install dipdup

poetry.lock

Lines changed: 86 additions & 98 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ bump2version = "^1.0.1"
4040
diff-cover = "^5.0.1"
4141
isort = "^5.7.0"
4242
mypy = "^0.812"
43-
pylint = "^2.7.2"
44-
pylint-exit = "^1.2.0"
4543
pytest = "^3.0"
4644
pytest-cov = "^2.4"
45+
flake8 = "3.9.0"
46+
flakehell = "^0.9.0"
4747

4848
[tool.poetry.scripts]
4949
dipdup = 'dipdup.cli:cli'
@@ -53,9 +53,19 @@ line_length = 140
5353

5454
[tool.black]
5555
line-length = 140
56-
target-version = ['py37', 'py38']
56+
target-version = ['py38']
5757
skip-string-normalization = true
5858

59+
[tool.flakehell]
60+
format = "colored"
61+
max_line_length = 140
62+
show_source = true
63+
64+
[tool.flakehell.plugins]
65+
pyflakes = ["+*"]
66+
"flake8-*" = ["+*"]
67+
flake8-docstrings = ["-*"]
68+
5969
[build-system]
6070
requires = ["poetry_core>=1.0.0", "cryptography==3.3.2", "wheel"]
6171
build-backend = "poetry.core.masonry.api"

src/demo_hic_et_nunc/handlers/on_swap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import demo_hic_et_nunc.models as models
22
from demo_hic_et_nunc.types.hen_minter.parameter.swap import SwapParameter
33
from demo_hic_et_nunc.types.hen_minter.storage import HenMinterStorage
4-
from dipdup.context import HandlerContext, RollbackHandlerContext
5-
from dipdup.models import BigMapAction, BigMapData, BigMapDiff, OperationData, Origination, Transaction
4+
from dipdup.context import HandlerContext
5+
from dipdup.models import Transaction
66

77

88
async def on_swap(

src/dipdup/codegen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async def create_package(self) -> None:
5858
self._logger.info('Creating package `%s`', self._config.package)
5959
try:
6060
package_path = self._config.package_path
61-
except (ImportError, ModuleNotFoundError):
61+
except ImportError:
6262
package_path = join(os.getcwd(), self._config.package)
6363
mkdir(package_path)
6464
with open(join(package_path, '__init__.py'), 'w'):

src/dipdup/context.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from typing import Any, Dict, List, Optional
1+
from typing import Any, Dict, Optional
22

33
from dipdup.config import ContractConfig, DipDupConfig, StaticTemplateConfig
44
from dipdup.datasources import DatasourceT
55
from dipdup.exceptions import ConfigurationError
6-
from dipdup.models import OperationData
76
from dipdup.utils import FormattedLogger, reindex, restart
87

98

src/dipdup/index.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ async def _process_operations(self, operations: List[OperationData]) -> None:
189189
operation_groups[key] = []
190190
operation_groups[key].append(operation)
191191

192-
keys = list(operation_groups.keys())
193192
for operation_group, operations in operation_groups.items():
194193
self._logger.debug('Matching %s', key)
195194

tests/integration_tests/test_codegen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def import_submodules(package, recursive=True):
2121
if isinstance(package, str):
2222
package = importlib.import_module(package)
2323
results = {}
24-
for loader, name, is_pkg in pkgutil.walk_packages(package.__path__):
24+
for _loader, name, is_pkg in pkgutil.walk_packages(package.__path__):
2525
full_name = package.__name__ + '.' + name
2626
results[full_name] = importlib.import_module(full_name)
2727
if recursive and is_pkg:

0 commit comments

Comments
 (0)