-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update project to use hatch - Update pre-commit, as black previous version was having issues - Use recommended structure: https://docs.pytest.org/en/stable/explanation/goodpractices.html - Update CI - Add run_tests.sh script * Fix coverage * Fix version * Fix module export * Fix linting --------- Co-authored-by: Uxio Fuentefria <6909403+Uxio0@users.noreply.github.com>
- Loading branch information
Showing
36 changed files
with
135 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "safe-cli" | ||
dynamic = ["version"] | ||
description = "Command Line Interface for Safe" | ||
readme = "README.md" | ||
license = "MIT" | ||
requires-python = ">=3.8" | ||
authors = [{ name = "Uxío Fuentefría", email = "uxio@safe.global" }] | ||
classifiers = [ | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
dependencies = [ | ||
"art>=6", | ||
"colorama>=0.4", | ||
"prompt_toolkit>=3", | ||
"pygments>=2", | ||
"requests>=2", | ||
"safe-eth-py==6.0.0b17", | ||
"tabulate>=0.8", | ||
] | ||
|
||
[project.optional-dependencies] | ||
ledger = ["ledgereth==0.9.1"] | ||
trezor = ["trezor==0.13.8"] | ||
|
||
[project.scripts] | ||
safe-cli = "safe_cli.main:main" | ||
safe-creator = "safe_cli.safe_creator:main" | ||
|
||
[project.urls] | ||
Download = "https://github.com/gnosis/safe-cli/releases" | ||
Homepage = "https://github.com/gnosis/safe-cli" | ||
|
||
[tool.hatch.version] | ||
path = "src/safe_cli/__init__.py" | ||
|
||
[tool.hatch.envs.types] | ||
extra-dependencies = ["mypy>=1.0.0"] | ||
|
||
[tool.hatch.envs.types.scripts] | ||
check = "mypy --install-types --non-interactive {args:src/safe_cli tests}" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
include = ["/src/safe_cli"] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["/src/safe_cli"] | ||
|
||
[tool.coverage.run] | ||
source_pkgs = ["safe_cli", "tests"] | ||
branch = true | ||
parallel = true | ||
omit = [ | ||
"*__init__.py*", | ||
"*tests*", | ||
"*/migrations/*" | ||
] | ||
|
||
[tool.coverage.paths] | ||
safe_cli = ["src/safe_cli", "*/safe-cli/src/safe_cli"] | ||
tests = ["tests", "*/safe-cli/tests"] | ||
|
||
[tool.coverage.report] | ||
exclude_lines = [ | ||
"no cov", | ||
"if __name__ == .__main__.:", | ||
"if TYPE_CHECKING:", | ||
"if settings.DEBUG", | ||
"raise NotImplementedError", | ||
"pass", | ||
] | ||
|
||
[tool.isort] | ||
profile = "black" | ||
default_section = "THIRDPARTY" | ||
known_first_party = "safe_cli" | ||
known_safe_foundation = ["py_eth_sig_utils", "gnosis"] | ||
known_django = "django" | ||
sections = [ | ||
"FUTURE", | ||
"STDLIB", | ||
"DJANGO", | ||
"THIRDPARTY", | ||
"SAFE_FOUNDATION", | ||
"FIRSTPARTY", | ||
"LOCALFOLDER", | ||
] | ||
|
||
[tool.mypy] | ||
python_version = "3.12" | ||
check_untyped_defs = true | ||
ignore_missing_imports = true | ||
warn_unused_ignores = true | ||
warn_redundant_casts = true | ||
warn_unused_configs = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
-r requirements.txt | ||
-r requirements-test.txt | ||
flake8 | ||
hatch | ||
ipdb | ||
ipython | ||
isort | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#/usr/bin/env sh | ||
pip install -e . | ||
pytest |
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VERSION = "1.1.0" |
File renamed without changes.
3 changes: 2 additions & 1 deletion
3
safe_cli/contracts/__init__.py → src/safe_cli/contracts/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# flake8: noqa F401 | ||
from .safe_to_l2_migration import safe_to_l2_migration | ||
|
||
__all__ = ["safe_to_l2_migration"] |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
safe_cli/operators/__init__.py → src/safe_cli/operators/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# flake8: noqa F401 | ||
from .enums import SafeOperatorMode | ||
from .exceptions import SafeServiceNotAvailable | ||
from .safe_operator import SafeOperator | ||
from .safe_tx_service_operator import SafeTxServiceOperator | ||
|
||
__all__ = [ | ||
"SafeOperator", | ||
"SafeOperatorMode", | ||
"SafeServiceNotAvailable", | ||
"SafeTxServiceOperator", | ||
] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters