Skip to content

Commit 1a546d0

Browse files
authored
chore: simplify package config (#7)
* tests: fix assert message * tests: add docstring with requirements for running the tests * chore: remove pinned (and unnecessary) deps from setup.cfg * chore: consolidate package config to pyproject.toml * tests: update hive command in docstring * chore: move pytest ini config to pyproject.toml
1 parent b805423 commit 1a546d0

File tree

5 files changed

+55
-67
lines changed

5 files changed

+55
-67
lines changed

pyproject.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,48 @@
22
requires = ["setuptools", "wheel"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
name = "hive.py"
7+
description = "Ethereum Hive Simulators Python Interface"
8+
readme = "README.md"
9+
version = "0.1.0"
10+
urls = { "Homepage" = "https://github.com/marioevz/hive.py" }
11+
license = { file = "LICENSE" }
12+
classifiers = [
13+
"License :: OSI Approved :: GPL3 License",
14+
"Programming Language :: Python :: 3.10",
15+
]
16+
requires-python = ">=3.10"
17+
dependencies = [
18+
"requests>=2.31.0,<3"
19+
]
20+
21+
[project.optional-dependencies]
22+
test = [
23+
"pytest>=7.4.0,<8",
24+
"pytest-cov>=4.1.0,<5"
25+
]
26+
lint = [
27+
"black==22.3.0; implementation_name == 'cpython'",
28+
"isort>=5.8,<6",
29+
"mypy>=1.4.1,<2",
30+
"types-requests>=2.25.0,<3"
31+
]
32+
33+
[tool.setuptools.packages.find]
34+
where = ["src"]
35+
exclude = ["*tests*"]
36+
537
[tool.isort]
638
profile = "black"
739
multi_line_output = 3
840
line_length = 99
941

1042
[tool.black]
1143
line-length = 99
44+
target-version = ["py310"]
45+
46+
[tool.pytest.ini_options]
47+
console_output_style = "count"
48+
minversion = "7.0"
49+
testpaths = ["src"]

pytest.ini

Lines changed: 0 additions & 9 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 48 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/hive/tests/test_sanity.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
"""
2+
Sanity tests for the Hive simulation framework.
3+
4+
Requirements
5+
------------
6+
7+
Start a hive simulator in dev mode with an execution, beacon and validator
8+
client:
9+
10+
```shell
11+
./hive --dev --client go-ethereum,lighthouse-bn,lighthouse-vc --client-file \
12+
--docker.output
13+
```
14+
"""
15+
116
import os
217
from re import match
318

@@ -71,11 +86,11 @@ def test_clients_by_role(sim: Simulation):
7186
)
7287

7388
beacon_clients = sim.client_types(role=ClientRole.BeaconClient)
74-
assert len(beacon_clients) == 1, "Expected 1 execution client, got {}".format(
89+
assert len(beacon_clients) == 1, "Expected 1 consensus client, got {}".format(
7590
len(beacon_clients)
7691
)
7792

7893
validator_clients = sim.client_types(role=ClientRole.ValidatorClient)
79-
assert len(validator_clients) == 1, "Expected 1 execution client, got {}".format(
94+
assert len(validator_clients) == 1, "Expected 1 validator client, got {}".format(
8095
len(validator_clients)
8196
)

0 commit comments

Comments
 (0)