-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
166 lines (141 loc) · 4.61 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
[tool.poetry]
name = "golem-core"
version = "0.7.8"
description = "Golem Network (https://golem.network/) API for Python"
authors = ["Golem Factory <contact@golem.network>"]
license = "LGPL-3.0-or-later"
classifiers = [
"Development Status :: 3 - Alpha",
"Framework :: AsyncIO",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Distributed Computing"
]
repository = "https://github.com/golemfactory/golem-core-python"
packages = [{ include = "golem" }]
[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.dependencies]
python = "^3.8.1"
# CLI
prettytable = "^3.4.1"
click = "^8.1.3"
ya-aioclient = "^0.6.4"
jsonrpc-base = "^1.0.3"
srvresolver = "^0.3.5"
semantic-version = "^2.8"
async-exit-stack = "1.0.1"
textx = "^3.1.1"
setuptools = "*" # textx external dependency
[tool.poetry.group.dev.dependencies]
pytest = "^7"
pytest-asyncio = "^0.19"
pytest-cov = "^4"
pytest-mock = "^3"
liccheck = "^0.8"
autoflake = "^1"
isort = "^5"
black = "^23"
mypy = "^1"
flake8 = "^7"
flake8-docstrings = "^1"
Flake8-pyproject = "^1"
sphinx = "^5"
sphinx-autodoc-typehints = "^1"
sphinx-rtd-theme = "^1"
poethepoet = "^0.8"
[tool.poe.tasks]
checks = {sequence = ["checks_codestyle", "checks_typing", "checks_license"], help = "Run all available code checks"}
checks_codestyle = {sequence = ["_checks_codestyle_flake8", "_checks_codestyle_isort", "_checks_codestyle_black"], help = "Run only code style checks"}
_checks_codestyle_flake8 = "flake8 golem tests examples"
_checks_codestyle_isort = "isort --check-only --diff ."
_checks_codestyle_black = "black --check --diff ."
checks_typing = {cmd = "mypy .", help = "Run only code typing checks" }
checks_license = {sequence = ["_checks_license_export", "_checks_license_verify"], help = "Run only license compatibility checks"}
_checks_license_export = "poetry export -f requirements.txt -o .requirements.txt"
_checks_license_verify = "liccheck -r .requirements.txt"
format = {sequence = ["_format_autoflake", "_format_isort", "_format_black"], help = "Run code auto formatting"}
_format_autoflake = "autoflake ."
_format_isort = "isort ."
_format_black = "black ."
tests = {sequence = ["tests_unit", "tests_integration"], help = "Run all available tests"}
tests_unit = {cmd = "pytest --ignore tests/integration --cov golem --cov-report html --cov-report term-missing --no-cov-on-fail -sv", env = { YAGNA_APPKEY = "test" }, help = "Run only unit tests"}
# `tests_integration` require yagna requestor with `YAGNA_APPKEY` in environement
tests_integration = {cmd = "pytest --ignore tests/unit", help = "Run only integration tests"}
sphinx = {cmd = "sphinx-build docs/sphinx/ build -E", help = "Build Sphinx docs"}
[tool.liccheck.authorized_packages]
ya-client-activity = "0.1.0"
ya-client-payment = "0.1.0"
ya-market = "0.1.0"
[tool.liccheck]
authorized_licenses = [
"bsd",
"new bsd",
"bsd license",
"apache 2",
"apache",
"Apache Software",
"Apache Software License",
"MPL-2.0",
"Mozilla Public License 2.0 (MPL 2.0)",
"MIT",
"MIT License",
"LGPL",
"LGPL-3.0-or-later",
"GNU Lesser General Public License v3 or later (LGPLv3+)",
"GNU Lesser General Public License v3 (LGPLv3)",
"Python Software Foundation",
"ISC",
"ISC License (ISCL)",
]
unauthorized_licenses = [
"gpl v3"
]
[tool.flake8]
max-line-length = 100
extend-ignore = [
"E203", # See https://github.com/PyCQA/pycodestyle/issues/373
"E231", # black ignores this rule when formatting
"D100", # TODO: Add missing docstrings
"D101", # TODO: Add missing docstrings
"D102", # TODO: Add missing docstrings
"D103", # TODO: Add missing docstrings
"D106", # TODO: Add missing docstrings
"D105", # No docs for magic method
"D104", # No docs for public package
"D107", # No docs for __init__
"D202", # We prefer whitelines after docstrings
"W604", # Backticks complain on Python 3.12+
]
[tool.mypy]
install_types = true
non_interactive = true
ignore_missing_imports = true
check_untyped_defs = true
show_error_codes = true
warn_unused_ignores = true
[tool.isort]
profile = "black"
py_version = 38
line_length = 100
skip_gitignore = true
[tool.autoflake]
recursive = true
in-place = true
remove-all-unused-imports = true
ignore-init-module-imports = true
[tool.black]
line-length = 100
target-version = ['py38']
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = [
"tests",
]
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
# Don't complain about abstract methods, they aren't run:
"""@(abc\\.)?abstractmethod""",
]