Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare 0.1.5 #35

Merged
merged 28 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ec9402c
fix: change pre-cmmit autoupdate scheule to monthly
theissenhelen Sep 12, 2024
6bc41f0
fix: change the merge strategy for Changelog to Union
theissenhelen Sep 12, 2024
bca8f1d
fix: add .envrc to .gitignore
theissenhelen Sep 12, 2024
3c35207
ci: ignore pre-commit-config and readthedocs for changelog updates
theissenhelen Sep 12, 2024
5f1fe0d
fix: update precommit config
theissenhelen Sep 12, 2024
a3b37a3
fix: formatting
JesperDramsch Sep 12, 2024
3e5dfaa
chore: update pre-commit
JesperDramsch Sep 12, 2024
31e7e8a
chore: update dependencies
JesperDramsch Sep 12, 2024
cbcbbf0
feat: codeowners file
JesperDramsch Sep 12, 2024
5616c38
ci: add changelog release updater
JesperDramsch Sep 12, 2024
b069986
ci: split PR and publish workflows
JesperDramsch Sep 12, 2024
122c44e
docs: Docstrings for classes
JesperDramsch Sep 23, 2024
9914028
fix: triggering event in QA
JesperDramsch Sep 24, 2024
7a28810
Merge branch 'develop' into chore/multiple-fixes-ci-precommit
HCookie Oct 29, 2024
300fa0d
[pre-commit.ci] pre-commit autoupdate (#24)
pre-commit-ci[bot] Nov 15, 2024
38cbfbc
Merge branch 'develop' into chore/multiple-fixes-ci-precommit
HCookie Nov 15, 2024
033990e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 15, 2024
ac5863e
remove direct dependency to anemoi-datasets
floriankrb Nov 15, 2024
baa453a
hack uuid in the dataset to ensure unicity
floriankrb Nov 15, 2024
5ff9a08
Merge pull request #29 from ecmwf/bugfix/fix-tests
floriankrb Nov 15, 2024
5161cdd
[pre-commit.ci] pre-commit autoupdate (#31)
pre-commit-ci[bot] Nov 19, 2024
7e5675e
Merge remote-tracking branch 'origin/develop' into chore/multiple-fix…
theissenhelen Nov 19, 2024
5447402
fix: remove duplicate
theissenhelen Nov 20, 2024
287d649
improve patch
floriankrb Nov 18, 2024
fa4f186
Merge pull request #30 from ecmwf/feature/improve-patch (logging)
floriankrb Nov 20, 2024
def5b0c
Merge pull request #4 from ecmwf/chore/multiple-fixes-ci-precommit
theissenhelen Nov 20, 2024
eb11bdc
fix update to get the right constant fields
b8raoult Dec 2, 2024
617c6d9
add worker to update datasets. refactor tests (#34)
floriankrb Dec 3, 2024
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md merge=union
3 changes: 3 additions & 0 deletions .github/workflows/changelog-pr-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- main
- develop
paths-ignore:
- .pre-commit-config.yaml
- .readthedocs.yaml
jobs:
Check-Changelog:
name: Check Changelog Action
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/changelog-release-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# .github/workflows/update-changelog.yaml
name: "Update Changelog"

on:
release:
types: [released]

workflow_dispatch: ~

permissions:
pull-requests: write
contents: write

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.tag_name }}
heading-text: ${{ github.event.release.name }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: docs/changelog-update-${{ github.event.release.tag_name }}
title: '[Changelog] Update to ${{ github.event.release.tag_name }}'
add-paths: |
CHANGELOG.md
42 changes: 6 additions & 36 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,26 @@
---
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:

push: {}
pull_request:
release:
types: [created]

jobs:
quality:
name: Code QA
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install -y pandoc # Needed by sphinx for notebooks
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.1
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-precommit-run.yml@v2
with:
skip-hooks: "no-commit-to-branch"

checks:
strategy:
fail-fast: false
matrix:
platform: ["ubuntu-latest", "macos-latest"]
python-version: ["3.10"]

name: Python ${{ matrix.python-version }} on ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install
run: |
pip install -e .[all,tests]
pip freeze

- name: Tests
run: |
# disable tests on github to avoid giving away the token
# cd tests && python3 test_all.py
python-version: ["3.9", "3.10"]
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2

deploy:

needs: [checks, quality]
uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2
secrets: inherit
19 changes: 19 additions & 0 deletions .github/workflows/python-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# This workflow will upload a Python Package using Twine when a release is created from main
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Code Quality checks for PRs

on:
push:
pull_request:
types: [opened, synchronize, reopened]

jobs:
quality:
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-precommit-run.yml@v2
with:
skip-hooks: "no-commit-to-branch"

checks:
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ celerybeat.pid

# Environments
.env
.envrc
.venv
env/
venv/
Expand Down Expand Up @@ -186,3 +187,7 @@ _build/
*.sync
_version.py
*.code-workspace


# Environments
.envrc
24 changes: 22 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ repos:
- id: no-commit-to-branch # Prevent committing to main / master
- id: check-added-large-files # Check for large files added to git
- id: check-merge-conflict # Check for files that contain merge conflict
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0 # Use the ref you want to point at
hooks:
- id: python-use-type-annotations # Check for missing type annotations
- id: python-check-blanket-noqa # Check for # noqa: all
- id: python-no-log-warn # Check for log.warn
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
Expand All @@ -34,7 +40,7 @@ repos:
- --force-single-line-imports
- --profile black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.1
rev: v0.7.4
hooks:
- id: ruff
args:
Expand All @@ -59,6 +65,20 @@ repos:
- id: optional-dependencies-all
args: ["--inplace", "--exclude-keys=dev,docs,tests", "--group=dev=all,docs,tests"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.4.3"
rev: "v2.5.0"
hooks:
- id: pyproject-fmt
- repo: https://github.com/jshwi/docsig # Check docstrings against function sig
rev: v0.60.1
hooks:
- id: docsig
args:
- --ignore-no-params # Allow docstrings without parameters
- --check-dunders # Check dunder methods
- --check-overridden # Check overridden methods
- --check-protected # Check protected methods
- --check-class # Check class docstrings
- --disable=E113 # Disable empty docstrings
- --summary # Print a summary
ci:
autoupdate_schedule: monthly
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Keep it human-readable, your future self will thank you!
- Fix docstring errors
- Fix import errors [#18](https://github.com/ecmwf/anemoi-registry/pull/18)
- Remove usage of obsolete upload function from anemoi-utils.
- Add worker to updated datsets.

### Changed
- Replaces the deploy workflow with cd-pypi
Expand Down
2 changes: 1 addition & 1 deletion docs/naming-conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The tables below provides more details and some examples.
aifs-od-an-oper-0001-mars-o96-2020-2020-6h-v5

- - **frequency**
- 1h (could be : 6h)
- 1h (could be : 6h, 10m for 10 minutes)

- - **version**

Expand Down
25 changes: 5 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,13 @@
# nor does it submit to any jurisdiction.

[build-system]
requires = [
"setuptools>=60",
"setuptools-scm>=8",
]
requires = [ "setuptools>=60", "setuptools-scm>=8" ]

[project]
name = "anemoi-registry"

description = "A package to manage a registry or data-driven forecasts."
keywords = [
"ai",
"registry",
"tools",
]
keywords = [ "ai", "registry", "tools" ]

license = { file = "LICENSE" }
authors = [
Expand All @@ -45,15 +38,9 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]

dynamic = [
"version",
]
dynamic = [ "version" ]

dependencies = [
"anemoi-datasets",
"jsonpatch",
"requests",
]
dependencies = [ "anemoi-datasets", "jsonpatch", "requests" ]

optional-dependencies.all = [
"boto3",
Expand Down Expand Up @@ -92,9 +79,7 @@ urls.Repository = "https://github.com/ecmwf/anemoi-registry/"
scripts.anemoi-registry = "anemoi.registry.__main__:main_PYTHON_ARGCOMPLETE_OK"

[tool.setuptools.package-data]
"anemoi.registry" = [
"*.yaml",
]
"anemoi.registry" = [ "*.yaml" ]

[tool.setuptools_scm]
version_file = "src/anemoi/registry/_version.py"
Loading
Loading