From 6cd9889c028725a9c1d798c4958f127cb6188660 Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 17 Nov 2023 15:17:54 -0500 Subject: [PATCH] Migrate from setuptools to hatch --- .github/workflows/release.yml | 4 ++-- pyproject.toml | 16 ++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d32eb7a454..f80d2fb3ced 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,9 +30,9 @@ jobs: with: python-version: "3.12" - name: Install dependencies - run: pip install -U pip build wheel setuptools + run: pip install -U pip hatch - name: Build distributions - run: python -m build + run: hatch build - name: Upload package as artifact to GitHub if: github.repository == 'projectmesa/mesa' && startsWith(github.ref, 'refs/tags') uses: actions/upload-artifact@v4 diff --git a/pyproject.toml b/pyproject.toml index 7e84213dc84..25477e7a0d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,6 @@ [build-system] -requires = [ - "setuptools", - "wheel", -] -build-backend = "setuptools.build_meta" +requires = ["hatchling"] +build-backend = "hatchling.build" [project] name = "Mesa" @@ -73,12 +70,11 @@ repository = "https://github.com/projectmesa/mesa" [project.scripts] mesa = "mesa.main:cli" -[tool.setuptools.packages.find] -include = ["mesa*"] -exclude = ["tests*"] +[tool.hatch.build.targets.wheel] +packages = ["mesa"] -[tool.setuptools.dynamic] -version = {attr = "mesa.__version__"} +[tool.hatch.version] +path = "mesa/__init__.py" [tool.ruff] # See https://github.com/charliermarsh/ruff#rules for error code definitions.