Skip to content

Commit

Permalink
Release v1.0.0 (#1066)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaapel authored Sep 26, 2024
2 parents a707d44 + ddbee90 commit c2aa0d9
Show file tree
Hide file tree
Showing 376 changed files with 40,880 additions and 25,041 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
* text eol=lf
*.gpkg binary
*.yaml text eol=lf
*.yml text eol=lf
*.png binary

# GitHub syntax highlighting
pixi.lock linguist-language=YAML
90 changes: 45 additions & 45 deletions .github/workflows/create-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ jobs:

- name: Generate docs
run: |
pixi run --locked -e full-py311 html
pixi run -e full-py311 install
pixi run --locked -e full-py311 doc
- uses: actions/upload-artifact@v4
id: upload-docs-release-artifacts
Expand All @@ -77,53 +78,53 @@ jobs:
path: docs/_build


docker:
runs-on: ubuntu-latest
outputs:
url: ${{ steps.upload-docker-release-artifacts.outputs.artifact-url }}
if: ${{ github.event_name == 'push' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub to check credentials
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and export
uses: docker/build-push-action@v6
with:
outputs: type=docker,dest=/tmp/hydromt-docker-image.tar
tags: hydromt

- name: Run Tests
run: |
docker load --input /tmp/hydromt-docker-image.tar
docker run --env NUMBA_DISABLE_JIT=1 --rm hydromt
- name: Test Binder integration with repo2docker
run: |
pip install jupyter-repo2docker
repo2docker . echo 'success!'
- name: Upload artifact
uses: actions/upload-artifact@v4
id: upload-docker-release-artifacts
with:
name: hydromt-docker-image
path: /tmp/hydromt-docker-image.tar
# docker:
# runs-on: ubuntu-latest
# outputs:
# url: ${{ steps.upload-docker-release-artifacts.outputs.artifact-url }}
# if: ${{ github.event_name == 'push' || github.event.workflow_run.conclusion == 'success' }}
# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Login to Docker Hub to check credentials
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Build and export
# uses: docker/build-push-action@v6
# with:
# outputs: type=docker,dest=/tmp/hydromt-docker-image.tar
# tags: hydromt

# - name: Run Tests
# run: |
# docker load --input /tmp/hydromt-docker-image.tar
# docker run --env NUMBA_DISABLE_JIT=1 --rm hydromt

# - name: Test Binder integration with repo2docker
# run: |
# pip install jupyter-repo2docker
# repo2docker . echo 'success!'


# - name: Upload artifact
# uses: actions/upload-artifact@v4
# id: upload-docker-release-artifacts
# with:
# name: hydromt-docker-image
# path: /tmp/hydromt-docker-image.tar

notify:
needs:
- pypi
- docs
- docker
# - docker
runs-on: ubuntu-24.04
steps:
- name: Checkout
Expand All @@ -133,12 +134,11 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
pypi_url: ${{needs.pypi.outputs.url}}
docker_url: ${{needs.docker.outputs.url}}
# docker_url: ${{needs.docker.outputs.url}}
docs_url: ${{needs.docs.outputs.url}}
run: |
echo "The new release artifacts have been generated and tested. You can download and inspect them if you want by using the links below: " > comment.txt
echo " - pypi: $pypi_url" >> comment.txt
echo " - docker: $docker_url" >> comment.txt
echo " - docs: $docs_url" >> comment.txt
export PR_ID=$(gh pr list --state "open" --author "app/github-actions" --search "release" --json "number" --jq '. | first | .number')
Expand Down
76 changes: 38 additions & 38 deletions .github/workflows/finish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,47 @@ on:
- 'release/**'

jobs:
publish-docker:
if: github.event.pull_request.merged == true
name: Finalise docker (${{ matrix.flavour }}) release
runs-on: ubuntu-24.04 # latest LTS release
strategy:
fail-fast: false
matrix:
flavour: ['min','slim','full']
concurrency:
group: NEW_RELEASE_DOCKER
cancel-in-progress: false # don't abort while we might be creating a PR or something
steps:
- uses: actions/checkout@v4
name: Checkout code
# publish-docker:
# if: github.event.pull_request.merged == true
# name: Finalise docker (${{ matrix.flavour }}) release
# runs-on: ubuntu-24.04 # latest LTS release
# strategy:
# fail-fast: false
# matrix:
# flavour: ['min','slim','full']
# concurrency:
# group: NEW_RELEASE_DOCKER
# cancel-in-progress: false # don't abort while we might be creating a PR or something
# steps:
# - uses: actions/checkout@v4
# name: Checkout code

- uses: actions/download-artifact@v4
with:
name: hydromt-docker-image
# - uses: actions/download-artifact@v4
# with:
# name: hydromt-docker-image

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push ${{ matrix.flavour }} image
uses: docker/build-push-action@v6
with:
context: .
target: ${{ matrix.flavour }}
push: true
tags: deltares/hydromt:${{ env.version }}-${{ matrix.flavour }}
# - name: Build and push ${{ matrix.flavour }} image
# uses: docker/build-push-action@v6
# with:
# context: .
# target: ${{ matrix.flavour }}
# push: true
# tags: deltares/hydromt:${{ env.version }}-${{ matrix.flavour }}

- name: Build and push latest image
if: matrix.flavour == 'slim'
uses: docker/build-push-action@v6
with:
context: .
target: ${{ matrix.flavour }}
push: true
tags: deltares/hydromt:${{ env.version }}, deltares/hydromt:latest
# - name: Build and push latest image
# if: matrix.flavour == 'slim'
# uses: docker/build-push-action@v6
# with:
# context: .
# target: ${{ matrix.flavour }}
# push: true
# tags: deltares/hydromt:${{ env.version }}, deltares/hydromt:latest

publish-pypi:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:

gh-release:
needs:
- publish-docker
# - publish-docker
- publish-pypi
- publish-docs
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/prep-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- patch
- minor
- major
- same
default: minor
description: "Is this a Major, Minor, or Patch release?"
jobs:
Expand Down Expand Up @@ -44,7 +45,7 @@ jobs:
set -e
# check if there already is a release PR open
# parsing of current version
export CURRENT_VERSION=$(grep "version" hydromt/__init__.py | cut -d= -f 2 | tr -d "\" ")
export CURRENT_VERSION=$(grep "__version__" hydromt/__init__.py | cut -d= -f 2 | tr -d "\" ")
export CURRENT_MAJOR=$(echo $CURRENT_VERSION | cut -d'.' -f 1)
export CURRENT_MINOR=$(echo $CURRENT_VERSION | cut -d'.' -f 2)
export CURRENT_PATHCH=$(echo $CURRENT_VERSION | cut -d'.' -f 3)
Expand All @@ -54,6 +55,10 @@ jobs:
## calculate new release number
case $BUMP in
"same")
export NEW_VERSION="$CURRENT_MAJOR.$CURRENT_MINOR.$CURRENT_PATHCH"
;;
"patch")
export NEW_VERSION="$CURRENT_MAJOR.$CURRENT_MINOR.$((CURRENT_PATHCH + 1))"
;;
Expand All @@ -65,7 +70,6 @@ jobs:
"major")
export NEW_VERSION="$((CURRENT_MAJOR + 1)).0.0"
;;
*)
echo "invalid bump: $BUMP"
exit 1
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
- main
- v1
paths:
- tests/*
- hydromt/*
- data/*
- tests/**/*
- hydromt/**/*
- data/**/*
- pyproject.toml
- pixi.lock
- pixi.toml
Expand All @@ -19,9 +19,9 @@ on:
- main
- v1
paths:
- tests/*
- hydromt/*
- data/*
- tests/**/*
- hydromt/**/*
- data/**/*
- pyproject.toml
- pixi.lock
- pixi.toml
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,8 @@ dask-worker-space/
.envrc
pyrightconfig.json

# VsCode
.vscode/launch.json

# Pixi
.pixi
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -12,7 +12,7 @@ repos:
- id: debug-statements
- id: mixed-line-ending
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.2
rev: v0.5.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"ms-python.python",
"ms-python.debugpy",
"ms-python.vscode-pylance",
"ms-python.mypy-type-checker",
"charliermarsh.ruff",
"njpwerner.autodocstring"
"njpwerner.autodocstring",
"stkb.rewrap",
"streetsidesoftware.code-spell-checker"
]
}
13 changes: 0 additions & 13 deletions .vscode/launch.json

This file was deleted.

36 changes: 35 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,39 @@
"source.fixAll": "explicit"
}
},
"editor.formatOnSave": true
"editor.formatOnSave": true,
"editor.wordWrap": "wordWrapColumn",
"editor.wrappingIndent": "same",
"editor.wordWrapColumn": 88,
"files.exclude": {
".mypy_cache": true,
".pixi": true,
".pytest_cache": true,
".ruff_cache": true,
"**/__pycache__": true
},
"mypy-type-checker.importStrategy": "fromEnvironment",
"files.insertFinalNewline": true,
"cSpell.words": [
"dtype",
"GDAL",
"geodataframe",
"geoms",
"geopandas",
"hydromt",
"interbasin",
"ndarray",
"pixi",
"pydantic",
"pygeos",
"pyproj",
"SFINCS",
"subbasin",
"xarray",
"xugrid",
"zarr"
],
"autoDocstring.docstringFormat": "numpy",
"rewrap.autoWrap.enabled": true,
"rewrap.wrappingColumn": 88
}
Loading

0 comments on commit c2aa0d9

Please sign in to comment.