Skip to content

Commit

Permalink
Move some configuration from setup.cfg to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Jun 7, 2024
1 parent b9cddf0 commit 2230fd4
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 25 deletions.
2 changes: 1 addition & 1 deletion gnosis/eth/contracts/contract_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(
address: ChecksumAddress,
ethereum_client: "EthereumClient", # noqa F821
*args,
**kwargs
**kwargs,
):
self.address = address
self.ethereum_client = ethereum_client
Expand Down
2 changes: 1 addition & 1 deletion gnosis/eth/django/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(
self,
allow_zero_address: bool = False,
allow_sentinel_address: bool = False,
**kwargs
**kwargs,
):
self.allow_zero_address = allow_zero_address
self.allow_sentinel_address = allow_sentinel_address
Expand Down
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
]
Expand Down Expand Up @@ -61,6 +62,39 @@ Tracker = "https://github.com/safe-global/safe-eth-py/issues"
[tool.hatch.version]
path = "gnosis/__init__.py"

[tool.hatch.envs.types]
extra-dependencies = [
"mypy>=1.0.0",
]

[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive {args:gnosis tests}"

[tool.coverage.run]
include = ["gnosis/*"]
# source_pkgs = ["prueba", "tests"]
branch = true
parallel = true
omit = [
"*__init__.py*",
"*tests*",
"*/migrations/*",
]

#[tool.coverage.paths]
#prueba = ["src/prueba", "*/prueba/src/prueba"]
#tests = ["tests", "*/prueba/tests"]

[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if settings.DEBUG",
"raise NotImplementedError",
"pass",
]

[tool.hatch.build.targets.sdist]
include = [
"/gnosis",
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-r requirements-test.txt
flake8
gitpython
hatch
ipdb
ipython
isort
Expand Down
24 changes: 1 addition & 23 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,9 @@ env =
DJANGO_SETTINGS_MODULE=config.settings.test

[mypy]
python_version = 3.10
python_version = 3.12
check_untyped_defs = True
ignore_missing_imports = True
warn_unused_ignores = True
warn_redundant_casts = True
warn_unused_configs = True

[coverage:report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain if tests don't hit defensive assertion code:
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if __name__ == .__main__.:
if settings.DEBUG

# Ignore pass lines
pass

[coverage:run]
include = safe_transaction_service/*
omit =
*__init__.py*
*tests*
*/migrations/*

0 comments on commit 2230fd4

Please sign in to comment.