From bf3f2b89ba7fa93a9c719f21c1141cc6cde30a24 Mon Sep 17 00:00:00 2001 From: Dobson Date: Wed, 25 Sep 2024 19:23:11 +0100 Subject: [PATCH 01/11] add wheel build to ci --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f98b771a..d7905f9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,5 +5,18 @@ on: pull_request: jobs: + build-wheel: + needs: test + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: hynek/build-and-inspect-python-package@v2 + with: + attest-build-provenance-github: true + test: uses: ./.github/workflows/ci_template.yml \ No newline at end of file From 29cab2ec7ea74d7f74d917fab074f656f626bbc2 Mon Sep 17 00:00:00 2001 From: Dobson Date: Wed, 25 Sep 2024 19:25:03 +0100 Subject: [PATCH 02/11] swap order --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7905f9e..1ee5d5bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,9 @@ on: pull_request: jobs: + test: + uses: ./.github/workflows/ci_template.yml + build-wheel: needs: test name: Build source distribution @@ -16,7 +19,4 @@ jobs: - uses: hynek/build-and-inspect-python-package@v2 with: - attest-build-provenance-github: true - - test: - uses: ./.github/workflows/ci_template.yml \ No newline at end of file + attest-build-provenance-github: true \ No newline at end of file From f67fb0904036e58f5f7fdd5b2d84b45488e1833a Mon Sep 17 00:00:00 2001 From: Dobson Date: Wed, 25 Sep 2024 19:26:45 +0100 Subject: [PATCH 03/11] switch order again --- .github/workflows/ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ee5d5bd..624ed6aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,11 +5,7 @@ on: pull_request: jobs: - test: - uses: ./.github/workflows/ci_template.yml - build-wheel: - needs: test name: Build source distribution runs-on: ubuntu-latest steps: @@ -19,4 +15,10 @@ jobs: - uses: hynek/build-and-inspect-python-package@v2 with: - attest-build-provenance-github: true \ No newline at end of file + attest-build-provenance-github: true + + test: + needs: build-wheel + uses: ./.github/workflows/ci_template.yml + + \ No newline at end of file From 17c9ee0b08d39a29327e08fb1617b35e3cb604ac Mon Sep 17 00:00:00 2001 From: Dobson Date: Wed, 25 Sep 2024 19:35:09 +0100 Subject: [PATCH 04/11] try hatch license files --- .github/workflows/ci.yml | 13 ------------- pyproject.toml | 5 ++++- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 624ed6aa..3c30b8c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,20 +5,7 @@ on: pull_request: jobs: - build-wheel: - name: Build source distribution - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: hynek/build-and-inspect-python-package@v2 - with: - attest-build-provenance-github: true - test: - needs: build-wheel uses: ./.github/workflows/ci_template.yml \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b7973344..8378f6f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,6 @@ requires = [ name = "swmmanywhere" description = "SWMManywhere software" readme = "README.md" -license-files = { paths = ["LICENSE", "src/netcomp/LICENSE.txt"] } authors = [ { name = "Barnaby Dobson", email = "b.dobson@imperial.ac.uk" }, { name = "Imperial College London RSE Team", email = "ict-rse-team@imperial.ac.uk" } @@ -92,6 +91,10 @@ packages = [ "src" ] only-include = ["src"] sources = ["src"] +[tool.hatch.metadata] +license = "BSD-3-clause" # Or your primary license name +license-files = ["LICENSE", "src/netcomp/LICENSE.txt"] + [tool.hatch.version] source = "vcs" From f60651812c28457ff9de5e64a06c64c757f6bb92 Mon Sep 17 00:00:00 2001 From: Dobson Date: Wed, 25 Sep 2024 19:35:48 +0100 Subject: [PATCH 05/11] format --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c30b8c9..f98b771a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,4 @@ on: jobs: test: - uses: ./.github/workflows/ci_template.yml - - \ No newline at end of file + uses: ./.github/workflows/ci_template.yml \ No newline at end of file From 194ebd1a876acd2662b7ce48aeed7544b27e3504 Mon Sep 17 00:00:00 2001 From: Dobson Date: Wed, 25 Sep 2024 19:40:53 +0100 Subject: [PATCH 06/11] try same thing for sdist as wheel --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8378f6f5..cf973932 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,7 +85,8 @@ Issues = "https://github.com/ImperialCollegeLondon/SWMManywhere/issues" Source = "https://github.com/ImperialCollegeLondon/SWMManywhere" [tool.hatch.build.targets.sdist] -packages = [ "src" ] +only-include = ["src"] +sources = ["src"] [tool.hatch.build.targets.wheel] only-include = ["src"] From c9dc57092cdb5f5d8d092f4c868f464cbccaacad Mon Sep 17 00:00:00 2001 From: Dobson Date: Wed, 25 Sep 2024 20:04:50 +0100 Subject: [PATCH 07/11] try to mirror black pyprojec.toml --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cf973932..49e4f5b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,10 +84,6 @@ Documentation = "https://imperialcollegelondon.github.io/SWMManywhere/" Issues = "https://github.com/ImperialCollegeLondon/SWMManywhere/issues" Source = "https://github.com/ImperialCollegeLondon/SWMManywhere" -[tool.hatch.build.targets.sdist] -only-include = ["src"] -sources = ["src"] - [tool.hatch.build.targets.wheel] only-include = ["src"] sources = ["src"] From 62db09054c21e49e0276d17247c5e0c9daa9d9be Mon Sep 17 00:00:00 2001 From: Dobson Date: Wed, 25 Sep 2024 20:17:30 +0100 Subject: [PATCH 08/11] another test --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 49e4f5b3..7317b0a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,6 +84,9 @@ Documentation = "https://imperialcollegelondon.github.io/SWMManywhere/" Issues = "https://github.com/ImperialCollegeLondon/SWMManywhere/issues" Source = "https://github.com/ImperialCollegeLondon/SWMManywhere" +[tool.hatch.build] +include = ["src/netcomp/**", "src/swmmanywhere/**"] + [tool.hatch.build.targets.wheel] only-include = ["src"] sources = ["src"] From 7d081f8bc14735cd913c04cbd445f0d715ddd4b5 Mon Sep 17 00:00:00 2001 From: Dobson Date: Wed, 25 Sep 2024 20:38:20 +0100 Subject: [PATCH 09/11] skip wheel in hynek --- .github/workflows/publish.yml | 1 + pyproject.toml | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 934ba1a5..d857d16d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,6 +26,7 @@ jobs: - uses: hynek/build-and-inspect-python-package@v2 with: attest-build-provenance-github: true + skip-wheel: true publish-TestPyPI: needs: build-wheel diff --git a/pyproject.toml b/pyproject.toml index 7317b0a3..49e4f5b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,9 +84,6 @@ Documentation = "https://imperialcollegelondon.github.io/SWMManywhere/" Issues = "https://github.com/ImperialCollegeLondon/SWMManywhere/issues" Source = "https://github.com/ImperialCollegeLondon/SWMManywhere" -[tool.hatch.build] -include = ["src/netcomp/**", "src/swmmanywhere/**"] - [tool.hatch.build.targets.wheel] only-include = ["src"] sources = ["src"] From 9f6383cb693a0c140f9a8cd20b2066f2ea087e5b Mon Sep 17 00:00:00 2001 From: Dobson Date: Wed, 25 Sep 2024 20:47:56 +0100 Subject: [PATCH 10/11] include wheel check separately --- .github/workflows/publish.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d857d16d..b714f88c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,6 +28,11 @@ jobs: attest-build-provenance-github: true skip-wheel: true + - name: Check wheel contents + run: | + pip install check-wheel-contents + check-wheel-contents dist/swmmanywhere-*.whl --toplevel="swmmanywhere","netcomp" + publish-TestPyPI: needs: build-wheel name: Publish SWMManywhere to TestPyPI From e5f88ba5d05d97e5e26d2e981465ff9e55cb72b6 Mon Sep 17 00:00:00 2001 From: Dobson Date: Wed, 25 Sep 2024 20:55:18 +0100 Subject: [PATCH 11/11] remove separate wheel check --- .github/workflows/publish.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b714f88c..d857d16d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,11 +28,6 @@ jobs: attest-build-provenance-github: true skip-wheel: true - - name: Check wheel contents - run: | - pip install check-wheel-contents - check-wheel-contents dist/swmmanywhere-*.whl --toplevel="swmmanywhere","netcomp" - publish-TestPyPI: needs: build-wheel name: Publish SWMManywhere to TestPyPI