From 70a95698cd9751369c4e8e1f87f900e758ccd116 Mon Sep 17 00:00:00 2001 From: Rhys Goodall Date: Fri, 25 Apr 2025 11:06:01 -0400 Subject: [PATCH 1/4] maint: try out hatchling for build vs setuptools --- pyproject.toml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f621f23a..b3af1663 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,13 +68,9 @@ docs = [ [project.urls] Repo = "https://github.com/radical-ai/torch-sim" -[tool.setuptools.packages.find] -include = ["torch_sim*"] -exclude = ["examples*", "tests*"] - [build-system] -requires = ["setuptools==77.0.3"] -build-backend = "setuptools.build_meta" +requires = ["hatchling>=1.8.0"] +build-backend = "hatchling.build" [tool.pytest.ini_options] testpaths = ["tests/"] From 5a6d95cc6628cfc093671dc2b73e9224533dde27 Mon Sep 17 00:00:00 2001 From: Rhys Goodall Date: Fri, 25 Apr 2025 11:10:39 -0400 Subject: [PATCH 2/4] fix: hatch needs the case to match --- pyproject.toml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b3af1663..ac413a43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,8 +8,8 @@ authors = [ { name = "Orion Cohen", email = "orion@radical-ai.com" }, { name = "Radical AI", email = "info@radical.ai" }, ] -readme = "readme.md" -license = { file = "license" } +readme = "README.md" +license = { file = "LICENSE" } keywords = [ "chemistry", "interatomic-potentials", @@ -72,6 +72,9 @@ Repo = "https://github.com/radical-ai/torch-sim" requires = ["hatchling>=1.8.0"] build-backend = "hatchling.build" +[tool.hatch.build.targets.wheel] +packages = ["torch_sim"] + [tool.pytest.ini_options] testpaths = ["tests/"] addopts = "-p no:warnings" From a3fc9a2dc6af5c30511c56429ae52f721c4b5fdf Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Fri, 25 Apr 2025 11:44:34 -0400 Subject: [PATCH 3/4] bump min hatchling>=1.27 --- .github/workflows/docs.yml | 5 +---- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 095e039f..8ddc37e7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -47,10 +47,7 @@ jobs: rm docs/tutorials/*.traj* - name: Generate package treemap - run: | - uv pip install --system . --config-settings editable-mode=compat - uv pip install --system git+https://github.com/janosh/pymatviz - python docs/_static/draw_pkg_treemap.py + run: uv run docs/_static/draw_pkg_treemap.py - name: Build run: sphinx-build docs docs_build diff --git a/pyproject.toml b/pyproject.toml index ac413a43..1c3af107 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,7 @@ docs = [ Repo = "https://github.com/radical-ai/torch-sim" [build-system] -requires = ["hatchling>=1.8.0"] +requires = ["hatchling>=1.27.0"] build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] From 3d3d587858f0389d8d9e4329d516810a6ff116da Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Fri, 25 Apr 2025 11:55:41 -0400 Subject: [PATCH 4/4] hatchling exclude docs and tests from pkg build --- pyproject.toml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1c3af107..2dda0395 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,9 +75,8 @@ build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] packages = ["torch_sim"] -[tool.pytest.ini_options] -testpaths = ["tests/"] -addopts = "-p no:warnings" +[tool.hatch.build.targets.sdist] +include = ["/torch_sim"] [tool.ruff] target-version = "py311" @@ -137,6 +136,11 @@ docstring-code-format = true check-filenames = true ignore-words-list = ["convertor"] -[tool.pytest] -addopts = ["--cov-report=term-missing", "--cov=torch_sim", "-v"] +[tool.pytest.ini_options] +addopts = [ + "--cov-report=term-missing", + "--cov=torch_sim", + "-p no:warnings", + "-v", +] testpaths = ["tests"]