diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 1ef2d183f..6f319dcd1 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -32,10 +32,10 @@ jobs: run: cargo build - name: Build Python module run: | - pip install --user maturin - pip install . --user + pip install --user maturin hatch + hatch run dev:install - name: Check Python integration - run: python examples/python/main.py + run: hatch run dev:examples/python/main.py - name: Check C++ integration run: | cd examples/cpp diff --git a/pyproject.toml b/pyproject.toml index 9cd9df236..bcc863957 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,9 @@ [build-system] -requires = ["maturin>=0.14,<0.15"] -build-backend = "maturin" +requires = ["maturin>=1.0.1", "hatchling>=1.21.1"] +build-backend = "hatchling.build" + +[tool.hatch.version] +path = "Cargo.toml" [project] name = "bluerobotics_navigator" @@ -23,6 +26,9 @@ Repository = "https://github.com/bluerobotics/navigator-lib" [tool.maturin] features = ["python"] +[tool.hatch.build.targets.wheel] +packages = ["bluerobotics_navigator"] + [tool.hatch.envs.dev] dependencies = [ "maturin >=1.0.1", @@ -34,5 +40,6 @@ dependencies = [ ] [tool.hatch.envs.dev.scripts] +build = "maturin build" install = "maturin develop" build-doc = "install && sphinx-build ./docs/source docs/_build"