From 12660ff4c39faceb6aa237e575f5133ef51403f8 Mon Sep 17 00:00:00 2001 From: Juniper Tyree Date: Thu, 17 Sep 2026 12:19:27 +0200 Subject: [PATCH 1/7] Upgrade CI for PyPI publishing --- .github/dependabot.yml | 6 +++ .github/workflows/ci.yml | 110 +++++++++++++++++++++++++++++++++++---- _typos.toml | 2 + pyproject.toml | 2 +- 4 files changed, 110 insertions(+), 10 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 _typos.toml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f77bea8..6ac13eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,18 @@ jobs: with: args: check + spelling: + name: Spellcheck + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout the Repository + uses: actions/checkout@v7 + + - name: Spellcheck repo + uses: crate-ci/typos@v1 + fmt: name: Formatting runs-on: ubuntu-latest @@ -33,6 +45,31 @@ jobs: with: args: "format --diff --check" + build: + name: Build + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout the Repository + uses: actions/checkout@v7 + + - name: Install uv + uses: astral-sh/setup-uv@v7 + + - name: Build all packages + run: uv build --all-packages + + - name: List the built dist files + run: ls -lh dist/ + + - name: Upload the package sdist and wheels + uses: actions/upload-artifact@v7 + with: + name: dist + path: dist + retention-days: 1 + test: name: Test runs-on: ubuntu-latest @@ -43,14 +80,26 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 - - name: Setup Python - run: uv python install + - name: Download the dist artifact + uses: actions/download-artifact@v8 + with: + name: dist + path: dist + + - name: Install the test dependencies + run: | + uv sync --refresh --no-install-workspace \ + --all-groups \ + --no-build - - name: Install the package - run: uv sync --refresh --all-extras --all-groups && uv pip install . + - name: Install the workspace packages + run: | + uv pip install dist/*.whl \ + --resolution ${{ matrix.resolution }} \ + --no-build - name: Run tests - run: uv run pytest + run: uv run pytest -v mypy: name: Typecheck @@ -62,11 +111,54 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 - - name: Setup Python - run: uv python install + - name: Download the dist artifact + uses: actions/download-artifact@v8 + with: + name: dist + path: dist + + - name: Install the typing dependencies + run: | + uv sync --refresh --no-install-workspace \ + --all-groups \ + --no-build - - name: Install the package - run: uv sync --all-extras --all-groups && uv pip install . + - name: Install the workspace packages + run: | + uv pip install dist/*.whl \ + --resolution ${{ matrix.resolution }} \ + --no-build - name: Typecheck the package run: uv run mypy -p climatebenchpress.data_loader + + publish: + name: Publish to PyPi + runs-on: ubuntu-latest + environment: pypi + permissions: + contents: read + id-token: write + if: ${{ github.event_name == 'release' }} + needs: + # require all jobs to succeed + - check + - spelling + - fmt + - build # includes the dist artifact + - test + - mypy + steps: + - name: Download the dist artifact + uses: actions/download-artifact@v8 + with: + name: dist + path: dist + + - name: List the built dist files + run: ls -lh dist/ + + - name: Publish the packages + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000..9ed670b --- /dev/null +++ b/_typos.toml @@ -0,0 +1,2 @@ +[default.extend-identifiers] +fo = "fo" diff --git a/pyproject.toml b/pyproject.toml index 9a3f7cb..9728de5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "climatebenchpress.data_loader" -version = "0.1.0" +version = "1.0.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.12" From 89b72649b11dc1ea07c9629b698500c12c779f63 Mon Sep 17 00:00:00 2001 From: Juniper Tyree Date: Thu, 17 Sep 2026 12:47:04 +0200 Subject: [PATCH 2/7] Add build-system --- .github/workflows/ci.yml | 10 ++++++++++ pyproject.toml | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ac13eb..2ba14bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,8 @@ jobs: check: name: Check runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout the Repository uses: actions/checkout@v4 @@ -36,6 +38,8 @@ jobs: fmt: name: Formatting runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout the Repository uses: actions/checkout@v4 @@ -73,6 +77,9 @@ jobs: test: name: Test runs-on: ubuntu-latest + permissions: + contents: read + needs: build steps: - name: Checkout the Repository uses: actions/checkout@v4 @@ -104,6 +111,9 @@ jobs: mypy: name: Typecheck runs-on: ubuntu-latest + permissions: + contents: read + needs: build steps: - name: Checkout the Repository uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index 9728de5..e039a5d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + [project] name = "climatebenchpress.data_loader" version = "1.0.0" From 2042b11af4eeb3aa16a57a6982bcb7ff072cc75f Mon Sep 17 00:00:00 2001 From: Juniper Tyree Date: Thu, 17 Sep 2026 13:50:51 +0200 Subject: [PATCH 3/7] Fix hatch packaging --- .gitignore | 1 + pyproject.toml | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6908fc3..007cba2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ **/__pycache__ **/*.egg-info +**/.DS_Store diff --git a/pyproject.toml b/pyproject.toml index e039a5d..cbab216 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,9 +3,9 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "climatebenchpress.data_loader" +name = "climatebenchpress-data-loader" version = "1.0.0" -description = "Add your description here" +description = "Download the datasets for the ClimateBenchPress compression benchmark" readme = "README.md" requires-python = ">=3.12" dependencies = [ @@ -48,8 +48,8 @@ dev = [ "universal-pathlib~=0.2.0", ] -[tool.setuptools.packages.find] -where = ["src"] +[tool.hatch.build.targets.wheel] +packages = ["src/climatebenchpress"] [tool.setuptools.package-data] "climatebenchpress.compressor" = ["py.typed"] From 91596839bff637b618680cb7559ff5edfdd5965c Mon Sep 17 00:00:00 2001 From: Juniper Tyree Date: Thu, 17 Sep 2026 13:56:38 +0200 Subject: [PATCH 4/7] Allow building dependencies in CI --- .github/workflows/ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ba14bb..2177f41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,14 +130,12 @@ jobs: - name: Install the typing dependencies run: | uv sync --refresh --no-install-workspace \ - --all-groups \ - --no-build + --all-groups - name: Install the workspace packages run: | uv pip install dist/*.whl \ - --resolution ${{ matrix.resolution }} \ - --no-build + --resolution ${{ matrix.resolution }} - name: Typecheck the package run: uv run mypy -p climatebenchpress.data_loader From 3985b5a0b29e18157d9488928a0c85577540b5a7 Mon Sep 17 00:00:00 2001 From: Juniper Tyree Date: Thu, 17 Sep 2026 14:03:15 +0200 Subject: [PATCH 5/7] Fix CI --- .github/workflows/ci.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2177f41..a8c9c04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,14 +96,11 @@ jobs: - name: Install the test dependencies run: | uv sync --refresh --no-install-workspace \ - --all-groups \ - --no-build + --all-groups - name: Install the workspace packages run: | - uv pip install dist/*.whl \ - --resolution ${{ matrix.resolution }} \ - --no-build + uv pip install dist/*.whl - name: Run tests run: uv run pytest -v @@ -134,8 +131,7 @@ jobs: - name: Install the workspace packages run: | - uv pip install dist/*.whl \ - --resolution ${{ matrix.resolution }} + uv pip install dist/*.whl - name: Typecheck the package run: uv run mypy -p climatebenchpress.data_loader From d8672e7d7e57587860995da4b941525ebf6eb6e7 Mon Sep 17 00:00:00 2001 From: Juniper Tyree Date: Thu, 17 Sep 2026 14:39:40 +0200 Subject: [PATCH 6/7] Try to fix typos --- _typos.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_typos.toml b/_typos.toml index 9ed670b..7bc569c 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,2 +1,5 @@ +[default] +extend-ignore-identifiers-re = ["Kl\\\"ower"] + [default.extend-identifiers] fo = "fo" From ba6e9c7de501ccb428310f0b1bba8f5ace6b7e0c Mon Sep 17 00:00:00 2001 From: Juniper Tyree Date: Thu, 17 Sep 2026 15:06:30 +0200 Subject: [PATCH 7/7] Fix typos --- _typos.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/_typos.toml b/_typos.toml index 7bc569c..9bcea29 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,5 +1,3 @@ -[default] -extend-ignore-identifiers-re = ["Kl\\\"ower"] - [default.extend-identifiers] fo = "fo" +ower = "ower"