Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
114 changes: 105 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
check:
name: Check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
Expand All @@ -21,9 +23,23 @@ 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
permissions:
contents: read
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
Expand All @@ -33,40 +49,120 @@ 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
permissions:
contents: read
needs: build
steps:
- name: Checkout the Repository
uses: actions/checkout@v4

- 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

- 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

- name: Run tests
run: uv run pytest
run: uv run pytest -v

mypy:
name: Typecheck
runs-on: ubuntu-latest
permissions:
contents: read
needs: build
steps:
- name: Checkout the Repository
uses: actions/checkout@v4

- 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

- 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

- 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@

**/__pycache__
**/*.egg-info
**/.DS_Store
3 changes: 3 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default.extend-identifiers]
fo = "fo"
ower = "ower"
14 changes: 9 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "climatebenchpress.data_loader"
version = "0.1.0"
description = "Add your description here"
name = "climatebenchpress-data-loader"
version = "1.0.0"
description = "Download the datasets for the ClimateBenchPress compression benchmark"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
Expand Down Expand Up @@ -44,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"]
Expand Down
Loading