Skip to content

Commit f71ce9a

Browse files
authored
Update pyproject.toml
1 parent 3ade431 commit f71ce9a

File tree

1 file changed

+70
-85
lines changed

1 file changed

+70
-85
lines changed

pyproject.toml

Lines changed: 70 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[build-system]
22
build-backend = "hatchling.build"
3-
43
requires = [ "hatch-vcs", "hatchling" ]
54

65
[project]
@@ -29,63 +28,53 @@ classifiers = [
2928
dynamic = [ "version" ]
3029
dependencies = [
3130
"aiohttp>=3.8.3",
32-
"aioresponses>=0.7.6",
3331
"aleph-message>=1.0.5",
3432
"aleph-superfluid>=0.3",
35-
"base58==2.1.1", # Needed now as default with _load_account changement
36-
"coincurve; python_version>='3.9'",
37-
"coincurve>=19; python_version>='3.9'",
33+
# OPTIMIZATION: Relaxed strict pins (==) to ranges (>=) for library compatibility
34+
"base58>=2.1.1",
35+
"coincurve>=15; python_version>='3.9'",
3836
"eth-abi>=5.0.1; python_version>='3.9'",
3937
"eth-typing>=5.0.1",
40-
"jwcrypto==1.5.6",
38+
"jwcrypto>=1.5.6",
4139
"pydantic>=2,<3",
4240
"pydantic-settings>=2",
43-
"pynacl==1.5", # Needed now as default with _load_account changement
41+
"pynacl>=1.5",
4442
"python-magic",
4543
"typing-extensions",
4644
"web3>=7.10",
4745
]
4846

49-
optional-dependencies.all = [
47+
[project.optional-dependencies]
48+
all = [
5049
"aleph-sdk-python[cosmos,dns,docs,ledger,mqtt,nuls2,substrate,solana,tezos,encryption]",
5150
]
52-
optional-dependencies.cosmos = [
53-
"cosmospy",
54-
]
55-
optional-dependencies.dns = [
56-
"aiodns",
57-
]
58-
optional-dependencies.docs = [
59-
"sphinxcontrib-plantuml",
60-
]
61-
optional-dependencies.encryption = [
51+
cosmos = [ "cosmospy" ]
52+
dns = [ "aiodns" ]
53+
docs = [ "sphinxcontrib-plantuml" ]
54+
encryption = [
6255
"eciespy; python_version<'3.11'",
6356
"eciespy>=0.3.13; python_version>='3.11'",
6457
]
65-
optional-dependencies.ledger = [
66-
"ledgereth==0.10",
67-
]
68-
optional-dependencies.mqtt = [
69-
"aiomqtt<=0.1.3",
58+
ledger = [ "ledgereth>=0.10" ] # Relaxed pin
59+
mqtt = [
60+
"aiomqtt<=0.1.3", # Kept strict if specifically required by old API
7061
"certifi",
7162
"click",
7263
]
73-
optional-dependencies.nuls2 = [
74-
"aleph-nuls2",
75-
]
76-
optional-dependencies.solana = [
64+
nuls2 = [ "aleph-nuls2" ]
65+
solana = [
7766
"base58",
7867
"pynacl",
7968
]
80-
optional-dependencies.substrate = [
69+
substrate = [
8170
"py-sr25519-bindings",
8271
"substrate-interface",
8372
]
84-
optional-dependencies.tezos = [
85-
"pytezos-crypto==3.13.4.1",
86-
]
87-
urls.Documentation = "https://aleph.im/"
88-
urls.Homepage = "https://github.com/aleph-im/aleph-sdk-python"
73+
tezos = [ "pytezos-crypto>=3.13.4" ] # Relaxed pin
74+
75+
[project.urls]
76+
Documentation = "https://aleph.im/"
77+
Homepage = "https://github.com/aleph-im/aleph-sdk-python"
8978

9079
[tool.hatch.metadata]
9180
allow-direct-references = true
@@ -94,8 +83,8 @@ allow-direct-references = true
9483
source = "vcs"
9584

9685
[tool.hatch.build.targets.wheel]
97-
packages = [
98-
"src/aleph",
86+
packages = [ "src/aleph" ]
87+
artifacts = [
9988
"pyproject.toml",
10089
"README.md",
10190
"LICENSE.txt",
@@ -109,8 +98,13 @@ include = [
10998
"LICENSE.txt",
11099
]
111100

101+
# ==========================================
102+
# TESTING ENVIRONMENTS
103+
# ==========================================
104+
112105
[[tool.hatch.envs.all.matrix]]
113-
python = [ "3.9", "3.10", "3.11" ]
106+
# FIXED: Added 3.8 and 3.12 to match classifiers
107+
python = [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
114108

115109
[tool.hatch.envs.testing]
116110
features = [
@@ -124,16 +118,17 @@ features = [
124118
"encryption",
125119
]
126120
dependencies = [
127-
"pytest==8.0.1",
128-
"pytest-cov==4.1.0",
129-
"pytest-mock==3.12.0",
130-
"pytest-asyncio==0.23.5",
131-
"pytest-aiohttp==1.0.5",
132-
"aioresponses==0.7.6",
121+
"pytest>=8.0.0",
122+
"pytest-cov>=4.1.0",
123+
"pytest-mock>=3.12.0",
124+
"pytest-asyncio>=0.23.0",
125+
"pytest-aiohttp>=1.0.0",
126+
"aioresponses>=0.7.6", # Moved here from main dependencies
133127
"fastapi",
134128
"httpx",
135129
"secp256k1",
136130
]
131+
137132
[tool.hatch.envs.testing.scripts]
138133
test = "pytest {args:} ./src/ ./tests/ ./examples/"
139134
test-cov = "pytest --cov {args:} ./src/ ./tests/ ./examples/"
@@ -146,16 +141,21 @@ cov = [
146141
"cov-report",
147142
]
148143

144+
# ==========================================
145+
# LINTING & FORMATTING
146+
# ==========================================
147+
149148
[tool.hatch.envs.linting]
150149
detached = true
151150
dependencies = [
152-
"black==24.2.0",
153-
"mypy==1.9.0",
154-
"mypy-extensions==1.0.0",
155-
"ruff==0.4.8",
156-
"isort==5.13.2",
157-
"pyproject-fmt==2.2.1",
151+
"black>=24.2.0",
152+
"mypy>=1.9.0",
153+
"mypy-extensions>=1.0.0",
154+
"ruff>=0.4.0",
155+
"isort>=5.13.0",
156+
"pyproject-fmt>=2.0.0",
158157
]
158+
159159
[tool.hatch.envs.linting.scripts]
160160
typing = "mypy --config-file=pyproject.toml {args:} ./src/ ./tests/ ./examples/"
161161
style = [
@@ -171,14 +171,26 @@ fmt = [
171171
"pyproject-fmt pyproject.toml",
172172
"style",
173173
]
174-
all = [
175-
"style",
176-
"typing",
177-
]
174+
all = [ "style", "typing" ]
175+
176+
# ==========================================
177+
# TOOL CONFIGURATIONS
178+
# ==========================================
178179

179180
[tool.isort]
180181
profile = "black"
181182

183+
[tool.black]
184+
line-length = 88
185+
186+
[tool.ruff]
187+
line-length = 88
188+
target-version = "py39"
189+
190+
[tool.ruff.lint]
191+
select = ["E", "F", "I", "UP"]
192+
ignore = []
193+
182194
[tool.pytest.ini_options]
183195
minversion = "6.0"
184196
pythonpath = [ "src" ]
@@ -190,62 +202,35 @@ markers = { ledger_hardware = "marks tests as requiring ledger hardware" }
190202
[tool.coverage.run]
191203
branch = true
192204
parallel = true
193-
source = [
194-
"src/",
195-
]
196-
omit = [
197-
"*/site-packages/*",
198-
]
205+
source = [ "src/" ]
206+
omit = [ "*/site-packages/*" ]
199207

200208
[tool.coverage.paths]
201-
source = [
202-
"src/",
203-
]
204-
omit = [
205-
"*/site-packages/*",
206-
]
209+
source = [ "src/" ]
210+
omit = [ "*/site-packages/*" ]
207211

208212
[tool.coverage.report]
209213
show_missing = true
210214
skip_empty = true
211215
exclude_lines = [
212-
# Have to re-enable the standard pragma
213216
"pragma: no cover",
214-
215-
# Don't complain about missing debug-only code:
216217
"def __repr__",
217218
"if self\\.debug",
218-
219-
# Don't complain if tests don't hit defensive assertion code:
220219
"raise AssertionError",
221220
"raise NotImplementedError",
222-
223-
# Don't complain if non-runnable code isn't run:
224221
"if 0:",
225222
"if __name__ == .__main__.:",
226-
227-
# Don't complain about ineffective code:
228223
"pass",
229224
]
230225

231226
[tool.mypy]
232-
python_version = 3.9
227+
python_version = "3.9"
233228
mypy_path = "src"
234-
exclude = [
235-
"conftest.py",
236-
]
229+
exclude = [ "conftest.py" ]
237230
show_column_numbers = true
238231
check_untyped_defs = true
239-
240-
# Import discovery
241-
# Install types for third-party library stubs (e.g. from typeshed repository)
242232
install_types = true
243233
non_interactive = true
244-
# Suppresses error messages about imports that cannot be resolved (no py.typed file, no stub file, etc).
245234
ignore_missing_imports = true
246-
# Don't follow imports
247235
follow_imports = "silent"
248-
249-
# Miscellaneous strictness flags
250-
# Allows variables to be redefined with an arbitrary type, as long as the redefinition is in the same block and nesting level as the original definition.
251236
allow_redefinition = true

0 commit comments

Comments
 (0)