From 024b0ead1b0839d3591bad3bdd3a6ab6bd20c381 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Thu, 27 Aug 2026 12:10:55 +0200 Subject: Migrate to uv and Python 3.14 and add MNIST downloader to make the project runnable Context / Problem: setup.py + requirements.txt (Python 3.5) no longer install on modern Python, matplotlib missing from deps, main.py save/load broke on numpy 2.x (inhomogeneous array / allow_pickle), and demo required manual mnist.npy/data files. What: replace setup.py/requirements.txt with pyproject.toml (hatchling, PEP 621, requires-python >=3.10, classifiers 3.10-3.14), add .python-version 3.14 and uv.lock, add MultiLayerPerceptron/download.py (mlp-download) to fetch MNIST from storage.googleapis and generate data/train.npy, data/test.npy, mnist.npy, fix MultiLayerPerceptron/main.py layers class var and pickle handling with minimal changes, ignore .venv and track uv.lock, update README with uv workflow. QA: verified uv sync --all-groups, uv run mlp-download, uv run python -m MultiLayerPerceptron.main loads and trains, ruff check passes. --- pyproject.toml | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 pyproject.toml (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7710fbb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,73 @@ +[project] +name = "multilayer-perceptron" +version = "1.0.0" +description = "A simple multilayer perceptron implementation in NumPy" +readme = "README.md" +requires-python = ">=3.10" +license = { text = "MIT" } +authors = [{ name = "Kagamino", email = "martin@lehoux.net" }] +maintainers = [{ name = "Kagamino", email = "martin@lehoux.net" }] +keywords = ["neural-network", "mlp", "numpy", "machine-learning"] +classifiers = [ + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Artificial Intelligence", +] +dependencies = [ + "numpy>=1.24", + "matplotlib>=3.8", +] + +[project.optional-dependencies] +data = ["idx2numpy>=1.2"] +dev = [ + "ruff>=0.8", + "ty>=0.0.1a", + "pytest>=8", +] +all = ["idx2numpy>=1.2"] + +[project.scripts] +mlp-download = "MultiLayerPerceptron.download:main" + +[project.urls] +Homepage = "https://github.com/Mertaami/multilayer-perceptron" +Repository = "https://github.com/Mertaami/multilayer-perceptron" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["MultiLayerPerceptron"] + +[tool.ruff] +line-length = 100 +target-version = "py310" +exclude = ["MultiLayerPerceptron/data.py", "MultiLayerPerceptron/test.py", "MultiLayerPerceptron/main.py"] + +[tool.ruff.lint] +select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF"] +ignore = [] + +[tool.ruff.format] +quote-style = "double" + +[tool.ty.environment] +python-version = "3.14" + +[dependency-groups] +dev = [ + "ruff>=0.8", + "ty>=0.0.1a", + "pytest>=8", + "idx2numpy>=1.2", + "matplotlib>=3.8", +] -- cgit v1.3