No solution found
AssertionError: Override list has odd length
AssertionError: Override list has odd length: ['MODEL.WEIGHTS', 'checkpoints/ovseg_swinbase_vitL14_ft_mpt.pthuv', 'run', 'ovsam3-demo.py', '--config-file', 'configs/ovsam_seg_swinB_vitL.yaml', '--input', 'katomoko.png', '--class-names', 'person', 'dog', 'cat', 'car', 'tree', 'sky', '--output', 'output/result.png', 'MODEL.WEIGHTS', 'checkpoints/ovseg_swinbase_vitL14_ft_mpt.pth']; it must be a list of pairs
AssertionError: Override list has odd length: ['MODEL.WEIGHTS', 'checkpoints/ovseg_swinbase_vitL14_ft_mpt.pthuv', 'run', 'ovsam3-demo.py', '--config-file', 'configs/ovsam_seg_swinB_vitL.yaml', '--input', 'katomoko.png', '--class-names', 'person', 'dog', 'cat', 'car', 'tree', 'sky', '--output', 'output/result.png', 'MODEL.WEIGHTS', 'checkpoints/ovseg_swinbase_vitL14_ft_mpt.pth']; it must be a list of pairs
AssertionError even though they should be equal
assert c == engine.Value(-2.0)
^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
Cause
In Python, == for custom classes compares memory addresses.
Solution
- Compare by value:
assert obj.data = expected - Implement
__eq__: define the behavior when==is called
uv sync was unable to install the package because of a package name and build backend configuration mistake
uv run pytest
> from micrograd.engine import Value
E ModuleNotFoundError: No module named 'micrograd'
Cause
There were three issues in pyproject.toml, so uv sync did not install the package into .venv.
[build-systems](plural) → should be[build-system](singular) The PEP 517 table name must bebuild-system. With the plural form, uv cannot recognize the build configuration and the package is not installed.hatching→ should behatchlingA package namedhatchingdoes exist on PyPI, but it is something else (with arequestsdependency). Hatch's official build backend ishatchling.doc- Missing
packages = ["micrograd"]By default, Hatchling looks for a directory with the same name as the project (neural_networks/), but this project's directory ismicrograd/, so auto-detection fails. You need to explicitly specify the package directory.doc
Solution
Modify pyproject.toml as follows and run uv sync again.
[tool.hatch.build.targets.wheel]
packages = ["micrograd"] # ← Added: explicitly specify the package directory
[build-system]
requires = ["hatchling"] # ← corrected: hatching → hatchling
build-backend = "hatchling.build" # ← corrected: hatching → hatchling
[tool.hatch.build.targets.wheel]
packages = ["micrograd"] # ← Added: explicitly specify the package directory
[build-system]
requires = ["hatchling"] # ← corrected: hatching → hatchling
build-backend = "hatchling.build" # ← corrected: hatching → hatchling
→ After uv sync, micrograd will be installed into the .venv site-packages, and pytest will pass.