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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.git_archival.txt export-subst
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
32 changes: 32 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"dependencyDashboard": true,
"schedule": ["on monday"],
"managers": [
{
"managerType": "pixi",
"fileMatch": ["(^|/)pyproject\\.toml$"],
"lockFileMaintenance": true
}
],
"lockFileMaintenance": {
"enabled": true,
"schedule": ["on the first day of the month"],
"automerge": true
},
"packageRules": [
{
"matchManagers": ["pixi"],
"matchUpdateTypes": ["lockFileMaintenance"],
"commitMessagePrefix": "chore(pixi):",
"labels": ["dependencies", "pixi"]
},
{
"matchManagers": ["github-actions"],
"commitMessagePrefix": "chore(ci):",
"labels": ["dependencies", "github-actions"],
"pinDigests": false
}
]
}
21 changes: 8 additions & 13 deletions .github/workflows/unit_tests.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: unit-tests
on:
pull_request:
push:
schedule:
- cron: "0 7 * * 1" # Run every Monday at 7:00 UTC
branches:
- "main"

defaults:
run:
shell: bash -el {0}
concurrency:
group: branch-${{ github.head_ref }}
cancel-in-progress: true

jobs:
unit-test:
Expand All @@ -18,15 +18,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Conda and parcels
uses: ./.github/actions/install-plasticparcels
with:
environment-file: environment.yml
environment-name: py3_parcels
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.5
- name: Unit test
run: |
coverage run -m pytest -v -s tests
coverage xml
run: pixi run tests with-coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ docs/_build/*
.vscode
_version_setup.py

# pixi environments
.pixi/*
!.pixi/config.toml

# coverage
coverage.xml
20 changes: 12 additions & 8 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
version: 2
build:
os: ubuntu-22.04
os: ubuntu-lts-latest
tools:
python: mambaforge-22.9
# just so RTD stops complaining
python: "latest"
jobs:
pre_build:
- pip install . # Need access to version information

create_environment:
- asdf plugin add pixi
- asdf install pixi latest
- asdf global pixi latest
install:
- pixi install --frozen
build:
html:
- pixi run sphinx-build -T -b html docs $READTHEDOCS_OUTPUT/html
sphinx:
configuration: docs/conf.py

conda:
environment: docs/environment_docs.yml
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Contributing

Contributions are welcome, though please for opinionated changes discuss
them first in an issue before making a pull request.

## Developer instructions

We use Pixi for our development workflow (a modern alternative to Conda).

- [install Pixi](https://pixi.prefix.dev/latest/installation/)
- fork and clone the repository, and `cd` into the repository
- run `pixi task list` (which will show you the available commands for the repository - such as building the documentation, or running tests)
- run the command you would like using `pixi run ...` (e.g, `pixi run tests`)

You can also enter the environment for the repository by doing `pixi shell` (this is equivalent to `conda activate ...`).

The installation of the virtual environment will be done automatically by Pixi when running `pixi run` or `pixi shell` - this environment is visible in the `./pixi` folder under the repo root.

The `.pixi` folder and the `pixi.lock` file should not be editted by hand. The `pixi.lock` file should be committed.


## Maintainer instructions

### About the `pixi.lock`

This repo has a committed `pixi.lock` (meaning that the tree of dependencies used in development is static).
This results in perfectly reproducibility between dev machines and CI.

This, however, means that releases of dependencies (e.g., deprecations in Parcels or Xarray) may unknowingly break Plasticparcels.
To mitigate this - there is a Renovate Bot (i.e., an alternative to Dependabot) that will upgrade the Pixi lock on a regular basis and automerge if CI passes.
If CI fails, there is a change upstream that Plasticparcels needs a code adjustment to deal with.

### Release checklist

- Make sure CI is passing on the latest version of `main`
- Go to GitHub, draft new release. Enter name of version and "create new tag" if it doesn't already exist. Click "Generate Release Notes". Currate release notes as needed. Look at a previous version release to match the format (title, header, section organisation etc.)
- Go to [conda-forge/plasticparcels-feedstock](https://github.com/conda-forge/plasticparcels-feedstock), create a new issue (select the "Bot Commands" issue from the menu) with title `@conda-forge-admin, please update version`. This will prompt a build, otherwise there can be a delay in the build.
- Approve PR and merge on green
Loading
Loading