-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathpyproject.toml
More file actions
139 lines (125 loc) · 5.32 KB
/
pyproject.toml
File metadata and controls
139 lines (125 loc) · 5.32 KB
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
[build-system]
requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "nabla_ml"
version = "26.02251344"
authors = [
{ name = "TilliFe", email = "tillmann.fehrenbach@gmail.com" },
]
description = "Dynamic neural networks and function transformations in Python + Mojo"
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
]
keywords = ["deep learning", "machine learning", "jax", "autodiff", "nabla", "mojo", "max", "gpu", "vmap", "grad"]
dependencies = [
"numpy>=2.0.0",
"modular>=26.2.0.dev2026021705",
]
[project.urls]
Homepage = "https://github.com/nabla-ml/nabla"
Repository = "https://github.com/nabla-ml/nabla"
"Bug Tracker" = "https://github.com/nabla-ml/nabla/issues"
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"ruff",
"black",
"mypy",
"build",
"twine",
"pre-commit",
# "maxsdk-dev" # Placeholder
# "mojo-sdk-dev" # Placeholder
]
[tool.ruff]
line-length = 88
target-version = "py310"
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "N", "B", "C4", "A", "SIM", "PTH"]
ignore = [
"E501", # Line too long - formatter handles wrapping
"UP007", # Use X | Y in annotations - needs Python 3.10+ at runtime without __future__.annotations
"UP038", # Deprecated rule (retracted by ruff) - isinstance(x, (A, B)) can be faster than isinstance(x, A | B)
"N806", # Uppercase variable in function - ML convention for matrix/dimension vars (B, K, N, W, H, etc.)
"N812", # `import functional as F` - PyTorch/ML convention
"N811", # Constant imported as non-constant (e.g. GRAPH as g) - intentional short aliases
"N817", # CamelCase imported as acronym (e.g. Tensor as T) - intentional short aliases
"N802", # Function name should be lowercase - `.T` transpose property follows NumPy/PyTorch convention
"B028", # No explicit stacklevel in warnings - pedantic, only 2 occurrences
]
[tool.ruff.lint.per-file-ignores]
# --- nabla library ---
"nabla/__init__.py" = ["A001", "A004"] # sum/max/min shadowing - NumPy/JAX-like API
"nabla/ops/__init__.py" = ["A004"] # Re-export shadowing
"nabla/ops/binary.py" = ["A001", "A004"] # pow shadowing
"nabla/ops/reduce.py" = ["A001"] # sum shadowing
"nabla/ops/unary.py" = ["A001"] # abs/max/min shadowing
"nabla/ops/*.py" = ["A001"] # Built-in shadowing in ops modules
"nabla/ops/base.py" = ["E402", "B027"] # Circular import avoidance; kernel() is optional override, not abstract
"nabla/core/autograd/utils.py" = ["E402"] # Circular import avoidance
"nabla/core/graph/engine.py" = ["E402"] # Circular import avoidance
"nabla/core/sharding/spmd.py" = ["N803"] # `Tensor: type` parameter - dependency injection pattern
"nabla/transforms/__init__.py" = ["A004"] # compile import shadowing
"nabla/transforms/compile.py" = ["A001"] # compile shadowing
# --- tests ---
"tests/**/*.py" = ["E402"] # sys.path manipulation before imports is standard test pattern
"tests/**/test_compile*.py" = ["A004"] # compile import shadowing
"tests/depr/test_pp_dp*.py" = ["N801"] # PP_DP class naming convention
"tests/depr/test_sharded_*.py" = ["E731"] # Lambda assignments in test fixtures
"tests/depr/test_gradients_vs_jax.py" = ["N803"] # Uppercase W, W1, W2 math args
"tests/depr/test_streaming_pipeline.py" = ["N803"] # Uppercase W_bg arg
"tests/depr/utils.py" = ["E731"] # Lambda assignments in test utilities
"tests/unit/test_unified.py" = ["E731"] # Lambda assignments in test definitions
"tests/integration/test_nested_dict_vjp.py" = ["E721"] # Type comparison with ==
"tests/integration/test_new_vjp.py" = ["E731"] # Lambda assignments
"tests/integration/test_vjp_edge_cases.py" = ["N803", "N806"] # Uppercase matrix vars
"tests/integration/vjp_compatibility_demo.py" = ["N803", "N806"] # Uppercase matrix vars
"tests/integration/test_vjp_jax_compatibility.py" = ["F401"] # Unused imports in compatibility tests
# --- examples ---
"examples/*.py" = ["N999", "E402"] # 01_, 02_ prefix naming; imports after setup code
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.black]
line-length = 88
target-version = ['py311']
[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true
# files = "src/nabla, tests"
[tool.setuptools]
py-modules = []
[tool.setuptools.packages.find]
where = ["."]
include = ["nabla*"]
exclude = ["tests*", "experimental*"]
[tool.setuptools.package-data]
"nabla" = ["**/*.mojo", "**/*.py"]
[tool.pytest.ini_options]
minversion = "7.0"
addopts = "-ra -q --color=yes"
testpaths = ["tests"]
pythonpath = ["."]
python_files = "test_*.py"
python_classes = "Test*"
python_functions = "test_*"
markers = [
"benchmark: marks tests as performance benchmarks (deselect with '-m \"not benchmark\"')",
"gpu: marks tests as requiring GPU hardware",
"slow: marks tests as slow-running (>10s)",
"mojo: marks tests as requiring Mojo SDK",
]