Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 70 additions & 85 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[build-system]
build-backend = "hatchling.build"

requires = [ "hatch-vcs", "hatchling" ]

[project]
Expand Down Expand Up @@ -29,63 +28,53 @@ classifiers = [
dynamic = [ "version" ]
dependencies = [
"aiohttp>=3.8.3",
"aioresponses>=0.7.6",
"aleph-message>=1.0.5",
"aleph-superfluid>=0.3",
"base58==2.1.1", # Needed now as default with _load_account changement
"coincurve; python_version>='3.9'",
"coincurve>=19; python_version>='3.9'",
# OPTIMIZATION: Relaxed strict pins (==) to ranges (>=) for library compatibility
"base58>=2.1.1",
"coincurve>=15; python_version>='3.9'",
"eth-abi>=5.0.1; python_version>='3.9'",
"eth-typing>=5.0.1",
"jwcrypto==1.5.6",
"jwcrypto>=1.5.6",
"pydantic>=2,<3",
"pydantic-settings>=2",
"pynacl==1.5", # Needed now as default with _load_account changement
"pynacl>=1.5",
"python-magic",
"typing-extensions",
"web3>=7.10",
]

optional-dependencies.all = [
[project.optional-dependencies]
all = [
"aleph-sdk-python[cosmos,dns,docs,ledger,mqtt,nuls2,substrate,solana,tezos,encryption]",
]
optional-dependencies.cosmos = [
"cosmospy",
]
optional-dependencies.dns = [
"aiodns",
]
optional-dependencies.docs = [
"sphinxcontrib-plantuml",
]
optional-dependencies.encryption = [
cosmos = [ "cosmospy" ]
dns = [ "aiodns" ]
docs = [ "sphinxcontrib-plantuml" ]
encryption = [
"eciespy; python_version<'3.11'",
"eciespy>=0.3.13; python_version>='3.11'",
]
optional-dependencies.ledger = [
"ledgereth==0.10",
]
optional-dependencies.mqtt = [
"aiomqtt<=0.1.3",
ledger = [ "ledgereth>=0.10" ] # Relaxed pin
mqtt = [
"aiomqtt<=0.1.3", # Kept strict if specifically required by old API
"certifi",
"click",
]
optional-dependencies.nuls2 = [
"aleph-nuls2",
]
optional-dependencies.solana = [
nuls2 = [ "aleph-nuls2" ]
solana = [
"base58",
"pynacl",
]
optional-dependencies.substrate = [
substrate = [
"py-sr25519-bindings",
"substrate-interface",
]
optional-dependencies.tezos = [
"pytezos-crypto==3.13.4.1",
]
urls.Documentation = "https://aleph.im/"
urls.Homepage = "https://github.com/aleph-im/aleph-sdk-python"
tezos = [ "pytezos-crypto>=3.13.4" ] # Relaxed pin

[project.urls]
Documentation = "https://aleph.im/"
Homepage = "https://github.com/aleph-im/aleph-sdk-python"

[tool.hatch.metadata]
allow-direct-references = true
Expand All @@ -94,8 +83,8 @@ allow-direct-references = true
source = "vcs"

[tool.hatch.build.targets.wheel]
packages = [
"src/aleph",
packages = [ "src/aleph" ]
artifacts = [
"pyproject.toml",
"README.md",
"LICENSE.txt",
Expand All @@ -109,8 +98,13 @@ include = [
"LICENSE.txt",
]

# ==========================================
# TESTING ENVIRONMENTS
# ==========================================

[[tool.hatch.envs.all.matrix]]
python = [ "3.9", "3.10", "3.11" ]
# FIXED: Added 3.8 and 3.12 to match classifiers
python = [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

[tool.hatch.envs.testing]
features = [
Expand All @@ -124,16 +118,17 @@ features = [
"encryption",
]
dependencies = [
"pytest==8.0.1",
"pytest-cov==4.1.0",
"pytest-mock==3.12.0",
"pytest-asyncio==0.23.5",
"pytest-aiohttp==1.0.5",
"aioresponses==0.7.6",
"pytest>=8.0.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.12.0",
"pytest-asyncio>=0.23.0",
"pytest-aiohttp>=1.0.0",
"aioresponses>=0.7.6", # Moved here from main dependencies
"fastapi",
"httpx",
"secp256k1",
]

[tool.hatch.envs.testing.scripts]
test = "pytest {args:} ./src/ ./tests/ ./examples/"
test-cov = "pytest --cov {args:} ./src/ ./tests/ ./examples/"
Expand All @@ -146,16 +141,21 @@ cov = [
"cov-report",
]

# ==========================================
# LINTING & FORMATTING
# ==========================================

[tool.hatch.envs.linting]
detached = true
dependencies = [
"black==24.2.0",
"mypy==1.9.0",
"mypy-extensions==1.0.0",
"ruff==0.4.8",
"isort==5.13.2",
"pyproject-fmt==2.2.1",
"black>=24.2.0",
"mypy>=1.9.0",
"mypy-extensions>=1.0.0",
"ruff>=0.4.0",
"isort>=5.13.0",
"pyproject-fmt>=2.0.0",
]

[tool.hatch.envs.linting.scripts]
typing = "mypy --config-file=pyproject.toml {args:} ./src/ ./tests/ ./examples/"
style = [
Expand All @@ -171,14 +171,26 @@ fmt = [
"pyproject-fmt pyproject.toml",
"style",
]
all = [
"style",
"typing",
]
all = [ "style", "typing" ]

# ==========================================
# TOOL CONFIGURATIONS
# ==========================================

[tool.isort]
profile = "black"

[tool.black]
line-length = 88

[tool.ruff]
line-length = 88
target-version = "py39"

[tool.ruff.lint]
select = ["E", "F", "I", "UP"]
ignore = []

[tool.pytest.ini_options]
minversion = "6.0"
pythonpath = [ "src" ]
Expand All @@ -190,62 +202,35 @@ markers = { ledger_hardware = "marks tests as requiring ledger hardware" }
[tool.coverage.run]
branch = true
parallel = true
source = [
"src/",
]
omit = [
"*/site-packages/*",
]
source = [ "src/" ]
omit = [ "*/site-packages/*" ]

[tool.coverage.paths]
source = [
"src/",
]
omit = [
"*/site-packages/*",
]
source = [ "src/" ]
omit = [ "*/site-packages/*" ]

[tool.coverage.report]
show_missing = true
skip_empty = true
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",

# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",

# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",

# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",

# Don't complain about ineffective code:
"pass",
]

[tool.mypy]
python_version = 3.9
python_version = "3.9"
mypy_path = "src"
exclude = [
"conftest.py",
]
exclude = [ "conftest.py" ]
show_column_numbers = true
check_untyped_defs = true

# Import discovery
# Install types for third-party library stubs (e.g. from typeshed repository)
install_types = true
non_interactive = true
# Suppresses error messages about imports that cannot be resolved (no py.typed file, no stub file, etc).
ignore_missing_imports = true
# Don't follow imports
follow_imports = "silent"

# Miscellaneous strictness flags
# 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.
allow_redefinition = true