From 843fe5f80c9216d2c4c2a3f70787b5659693df5f Mon Sep 17 00:00:00 2001 From: David GAILLETON Date: Wed, 1 Apr 2026 14:31:11 +0200 Subject: [PATCH] uv config for build wheel package add clean and fclean method to Makefile --- .gitignore | 1 + Makefile | 11 ++++++++++- __init__.py | 0 a_maze_ing.py | 9 +++++---- pyproject.toml | 8 ++++++++ src/parsing/__init__.py | 6 ------ uv.lock | 2 +- 7 files changed, 25 insertions(+), 12 deletions(-) delete mode 100644 __init__.py delete mode 100644 src/parsing/__init__.py diff --git a/.gitignore b/.gitignore index 4090c3b..33f147a 100644 --- a/.gitignore +++ b/.gitignore @@ -216,3 +216,4 @@ __marimo__/ .streamlit/secrets.toml test.txt +mazegen-1.0.0-py3-none-any.whl diff --git a/Makefile b/Makefile index 258d000..4813398 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +build: + uv build --clear --wheel + cp dist/*.whl mazegen-1.0.0-py3-none-any.whl + install: uv sync uv pip install mlx-2.2-py3-none-any.whl @@ -12,7 +16,10 @@ debug: uv pdb python3 a_maze_ing.py config.txt clean: - rm -rf __pycache__ .mypy_cache .venv + rm -rf */**__pycache__ __pycache__ .mypy_cache .venv dist build */**/*.egg-info *.egg-info + +fclean: clean + rm mazegen-1.0.0-py3-none-any.whl lint: uv run flake8 . --exclude=.venv @@ -34,3 +41,5 @@ run_test: uv run pytest mlx: uv run python3 test.py + +.PHONY: build install run debug clean fclean lint lint-strict run_test diff --git a/__init__.py b/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/a_maze_ing.py b/a_maze_ing.py index 99c2178..6eb9b6f 100644 --- a/a_maze_ing.py +++ b/a_maze_ing.py @@ -1,6 +1,6 @@ from typing import Any from src.AMazeIng import AMazeIng -from src.parsing import Parsing +from src.parsing.Parsing import DataMaze as Parsing from mlx import Mlx import numpy as np import time @@ -308,8 +308,9 @@ class MazeMLX: if keycode == 52: self.close_loop(None) - def handle_key_press_mteriier(self, keycode: int, - amazing: AMazeIng) -> None: + def handle_key_press_mteriier( + self, keycode: int, amazing: AMazeIng + ) -> None: if keycode == 38: self.restart_maze(amazing) self.print_path = False @@ -339,7 +340,7 @@ def main() -> None: mlx = None try: mlx = MazeMLX(1000, 1000) - config = Parsing.DataMaze.get_data_maze("config.txt") + config = Parsing.get_data_maze("config.txt") amazing = AMazeIng(**config) mlx.start(amazing) with open("test.txt", "w") as output: diff --git a/pyproject.toml b/pyproject.toml index 11a0fd9..e3d4f51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,3 +23,11 @@ python_version = "3.10" [tool.pytest.ini_options] pythonpath = ["src"] + +[build-system] +requires = ["setuptools>=78.1.0", "wheel>=0.45.1"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +package-dir = {"" = "src/amaz_lib"} + diff --git a/src/parsing/__init__.py b/src/parsing/__init__.py deleted file mode 100644 index 33ce9ee..0000000 --- a/src/parsing/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -__version__ = "1.0.0" -__author__ = "mteriier, dgaillet" - -from .Parsing import DataMaze - -__all__ = ["DataMaze"] diff --git a/uv.lock b/uv.lock index 92fbe72..bc5e8a2 100644 --- a/uv.lock +++ b/uv.lock @@ -9,7 +9,7 @@ resolution-markers = [ [[package]] name = "a-maze-ing" version = "0.1.0" -source = { virtual = "." } +source = { editable = "." } dependencies = [ { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "numpy", version = "2.4.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" },