Skip to content

Commit 2cf03bf

Browse files
committed
Add envs for testing and linting
1 parent 5c450cf commit 2cf03bf

File tree

1 file changed

+49
-4
lines changed

1 file changed

+49
-4
lines changed

pyproject.toml

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,62 @@ norecursedirs = ["dist", "build", ".tox"]
131131
testpaths = ["tests"]
132132
markers = {ledger_hardware = "marks tests as requiring ledger hardware"}
133133

134-
[tool.devpi.upload]
135-
no-vcs = 1
136-
formats = ["bdist_wheel"]
137-
138134
[tool.flake8]
139135
exclude = [".tox", "build", "dist", ".eggs", "docs/conf.py"]
140136
ignore = ["E501", "W291", "W503", "E203", "E704"]
141137

142138
[tool.isort]
143139
profile = "black"
144140

141+
[tool.hatch.envs.testing]
142+
dependencies = [
143+
"pytest==8.0.1",
144+
"pytest-cov==4.1.0",
145+
"pytest-mock==3.12.0",
146+
"pytest-asyncio==0.23.5",
147+
]
148+
[tool.hatch.envs.testing.scripts]
149+
test = "pytest {args:tests}"
150+
test-cov = "pytest --cov {args:tests}"
151+
cov-report = [
152+
"- coverage combine",
153+
"coverage report",
154+
]
155+
cov = [
156+
"test-cov",
157+
"cov-report",
158+
]
159+
160+
[[tool.hatch.envs.all.matrix]]
161+
python = ["3.9", "3.10", "3.11", "3.12"]
162+
163+
[tool.hatch.envs.lint]
164+
detached = true
165+
dependencies = [
166+
"black==24.1.1",
167+
"mypy==1.8.0",
168+
"mypy-extensions==0.4.3",
169+
"ruff==0.1.15",
170+
"isort==5.13.2",
171+
]
172+
[tool.hatch.envs.lint.scripts]
173+
typing = "mypy {args:src/aleph/vm/ tests/ examples/example_fastapi runtimes/aleph-debian-12-python}"
174+
style = [
175+
# "ruff {args:.}",
176+
"black --check --diff {args:.}",
177+
"isort --check-only --profile black {args:.}",
178+
]
179+
fmt = [
180+
"black {args:.}",
181+
# "ruff --fix {args:.}",
182+
"isort --profile black {args:.}",
183+
"style",
184+
]
185+
all = [
186+
"style",
187+
"typing",
188+
]
189+
145190
[tool.mypy]
146191
python_version = 3.8
147192
mypy_path = "src"

0 commit comments

Comments
 (0)