From 52e6752c97963be1c5c8dcb05c95f60abdb9fc02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20H=C3=B6chenberger?= Date: Mon, 11 Dec 2023 13:59:36 +0100 Subject: [PATCH 1/3] Switch build backend to hatchling Fixes #111 --- .github/workflows/run-tests.yml | 7 +++++-- pyproject.toml | 18 +++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 8946b0b..0069178 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -41,8 +41,11 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install --upgrade wheel + python -m pip install --upgrade pip python-build + - name: Test building sdist + python -m build -s . + - name: Test building wheel + python -m build -w . - name: Install openneuro-py run: pip install .[tests] - name: Test with pytest diff --git a/pyproject.toml b/pyproject.toml index 187a49a..b1871bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["hatchling", "hatch-vcs"] +build-backend = "hatchling.build" + [project] name = "openneuro-py" description = "A Python client for OpenNeuro." @@ -35,16 +39,12 @@ openneuro-py = "openneuro.openneuro:cli" homepage = "https://github.com/hoechenberger/openneuro-py" changelog = "https://github.com/hoechenberger/openneuro-py/CHANGES.md" -[build-system] -requires = [ - "setuptools >= 45", - "setuptools_scm[toml] >= 6.2", - "wheel" -] -build-backend = "setuptools.build_meta" +[tool.hatch.version] +source = "vcs" +raw-options = { version_scheme = "release-branch-semver" } -[tool.setuptools_scm] -# can be left blank +[tool.hatch.build.targets.wheel] +packages = ["openneuro"] [tool.pytest.ini_options] addopts = "-ra -vv --tb=short --durations=10" From 8698e0cdf509539e7a462459ade50674c2d2fc03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20H=C3=B6chenberger?= Date: Mon, 11 Dec 2023 14:14:42 +0100 Subject: [PATCH 2/3] Fix GH config --- .github/workflows/run-tests.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 0069178..f161146 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -40,14 +40,12 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: | - python -m pip install --upgrade pip python-build + run: python -m pip install --upgrade pip python-build - name: Test building sdist - python -m build -s . + run: python -m build -s . - name: Test building wheel - python -m build -w . + run: python -m build -w . - name: Install openneuro-py run: pip install .[tests] - name: Test with pytest - run: | - pytest + run: pytest From 78b8b990444ccaa4cff0b399cbc98134079a0774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20H=C3=B6chenberger?= Date: Mon, 11 Dec 2023 14:17:33 +0100 Subject: [PATCH 3/3] Install correct package --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f161146..eedfe6a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -40,7 +40,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: python -m pip install --upgrade pip python-build + run: python -m pip install --upgrade pip build - name: Test building sdist run: python -m build -s . - name: Test building wheel