-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathpyproject.toml
183 lines (158 loc) · 6.9 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
[tool.poetry]
name = "yapapi"
version = "0.13.1"
description = "High-level Python API for the New Golem"
authors = ["GolemFactory <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/yapapi"
documentation = "https://yapapi.readthedocs.io/en/stable/api.html"
readme = "README.md"
[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.dependencies]
python = "^3.8"
aiohttp = "^3.8"
aiohttp-sse-client = "^0.2.1"
async_exit_stack = "^1.0.1"
jsonrpc-base = "^1.0.3"
ya-aioclient = "^0.6.4"
toml = "^0.10.1"
colorama = "^0.4.4"
semantic-version = "^2.8"
attrs = ">=19.3"
Deprecated = "^1.2.12"
python-statemachine = "^0.8.0"
setuptools = "*"
pip = "*"
alive_progress = "3.1"
# Docs
sphinx = { version = "^4.0.1", optional = true }
sphinx-autodoc-typehints = { version = "^1.12.0", optional = true }
sphinx-rtd-theme = { version = "^1.0.0", optional = true}
[tool.poetry.extras]
docs = ['sphinx', 'sphinx-autodoc-typehints', 'sphinx-rtd-theme']
[tool.poetry.group.dev.dependencies]
black = "^24.4.2"
factory-boy = "^3.2.0"
isort = "^5.10.1"
liccheck = "^0.4.7"
mypy = "^1.10.0"
poethepoet = "^0.8.0"
pytest = "^6.2"
pytest-asyncio = "^0.14"
pytest-cov = "^2.11"
pytest-rerunfailures = "^10.1"
autoflake = "^1"
flake8 = "^5"
flake8-docstrings = "^1.6"
Flake8-pyproject = "^1.2.2"
pyproject-autoflake = "^1.0.2"
[tool.poe.tasks]
checks = {sequence = ["checks_codestyle", "checks_typing", "checks_license"], help = "Run all available code checks"}
checks_codestyle = {sequence = ["_checks_codestyle_isort", "_checks_codestyle_black"], help = "Run only code style checks"}
_checks_codestyle_flake8 = "flake8 yapapi 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 = "pautoflake ."
_format_isort = "isort ."
_format_black = "black ."
tests_unit = {cmd = "pytest --cov=yapapi --cov-report html --cov-report term -sv --ignore tests/goth_tests", help = "Run only unit tests"}
tests_integration_init = { sequence = ["_gothv_env", "_gothv_requirements", "_gothv_assets"], help="Initialize the integration test environment"}
tests_integration = { cmd = ".envs/yapapi-goth/bin/python -m pytest -svx tests/goth_tests --config-override docker-compose.build-environment.use-prerelease=false --config-path tests/goth_tests/assets/goth-config.yml --ssh-verify-connection --reruns 3 --only-rerun AssertionError --only-rerun TimeoutError --only-rerun goth.runner.exceptions.TimeoutError --only-rerun goth.runner.exceptions.TemporalAssertionError --only-rerun urllib.error.URLError --only-rerun goth.runner.exceptions.CommandError --only-rerun requests.exceptions.ConnectionError --only-rerun OSError --only-rerun requests.exceptions.ReadTimeout", help = "Run the integration tests"}
_gothv_env = "python -m venv .envs/yapapi-goth"
_gothv_requirements = ".envs/yapapi-goth/bin/pip install -U --extra-index-url https://test.pypi.org/simple/ goth==0.17.0 pip pytest pytest-asyncio pytest-rerunfailures pexpect"
_gothv_assets = ".envs/yapapi-goth/bin/python -m goth create-assets tests/goth_tests/assets"
clean = {cmd = "rm -rf .coverage .requirements.txt dist md handbook build", help = "Clean all development related files" }
clean_examples = {sequence = ["clean_examples_blender", "clean_examples_hello", "clean_examples_http_proxy", "clean_examples_simple_service", "clean_examples_ssh", "clean_examples_webapp", "clean_examples_yacat"], help = "Clean all example related files"}
clean_examples_blender = {cmd = "rm -f examples/blender/*.png examples/blender/*.log", help = "Clean \"blender\" example related files"}
clean_examples_hello = {cmd = "rm -f examples/hello-world/*.log", help = "Clean \"hello\" example related files"}
clean_examples_http_proxy = {cmd = "rm -f examples/http-proxy/*.log", help = "Clean \"http_proxy\" example related files"}
clean_examples_simple_service = {cmd = "rm -f examples/simple-service-poc/*.png examples/simple-service-poc/*.log", help= "Clean example \"simple_service\" related files"}
clean_examples_ssh = {cmd = "rm -f examples/ssh/*.log", help = "Clean \"ssh\" example related files"}
clean_examples_webapp = {cmd = "rm -f examples/webapp/*.log", help = "Clean \"webapp\" example related files"}
clean_examples_yacat = {cmd = "rm -f examples/yacat/*.log", help = "Clean \"yacat\" example related files"}
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",
"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.autoflake]
recursive = true
in-place = true
remove-all-unused-imports = true
ignore-init-module-imports = true
[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: To be fixed by #1087
"D101", # TODO: To be fixed by #1087
"D102", # TODO: To be fixed by #1087
"D103", # TODO: To be fixed by #1087
"D106", # TODO: To be fixed by #1087
"D105", # No docs for magic method
"D104", # No docs for public package
"D107", # No docs for __init__
"D202", # We prefer whitelines after docstrings
]
per-file-ignores = [
"examples/*:E402",
]
[tool.mypy]
exclude = [
"^examples/", # TODO: To be fixed by #1088
"^tests/", # TODO: To be fixed by #1088
]
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 = 36
known_golem = "goth, ya_activity, ya_market, ya_net, ya_payment"
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "GOLEM", "FIRSTPARTY", "LOCALFOLDER"]
line_length = 100
[tool.black]
line-length = 100
target-version = ['py38']
[tool.pytest.ini_options]
asyncio_mode = "auto"