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

Replace environment.yml with conda-lock.yml #442

Merged
merged 35 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2ddeee1
Replace environment.yml with conda-lock.yml
sverhoeven Jul 23, 2024
5591c14
Configure conda-lock in pyproject.toml
sverhoeven Jul 23, 2024
efc4066
Switched to hatch + deleted unneeded setup.cfg and setup.py
sverhoeven Jul 23, 2024
9ba50b6
Make pyproject.toml valid + add sections not migrated by hatch
sverhoeven Jul 23, 2024
e75820d
Merge branch 'hatch' into lock
sverhoeven Jul 23, 2024
ce0ed7e
Remove esmvaltool as python dep
sverhoeven Jul 23, 2024
f401970
Remove docs and test from sdist + mypy stricter and fix
sverhoeven Jul 23, 2024
9468c26
Merge remote-tracking branch 'origin/hatch' into lock
sverhoeven Jul 23, 2024
e99deb4
Move mypy from precommit to ci + remove pyroma as it is not useful an…
sverhoeven Jul 23, 2024
6746f7f
Move mypy from precommit to ci + remove pyroma as it is not useful an…
sverhoeven Jul 23, 2024
a521171
Use lock in ci
sverhoeven Jul 23, 2024
56e12ed
Add env name to ci
sverhoeven Jul 23, 2024
1815c9f
Use shell for mypy
sverhoeven Jul 23, 2024
71d0eb0
Use shell for mypy
sverhoeven Jul 23, 2024
03a6abb
Merge branch 'hatch' into lock
sverhoeven Jul 23, 2024
80a80f9
Exclude lock from lint
sverhoeven Jul 23, 2024
1c8876c
Merge remote-tracking branch 'origin/main' into lock
sverhoeven Jul 23, 2024
67d91f8
Use lock in docs
sverhoeven Jul 23, 2024
661ddfe
Typo
sverhoeven Jul 23, 2024
cfbe9ff
No longer need MANIFEST.in
sverhoeven Jul 24, 2024
a400dc5
Exclude dev deps during install
sverhoeven Jul 24, 2024
0f7910c
Merge remote-tracking branch 'origin/main' into lock
sverhoeven Jul 24, 2024
42bc30f
Use lock file to install dev deps
sverhoeven Jul 24, 2024
e9470b9
Remove unused dependencies
sverhoeven Jul 24, 2024
6847038
Add osx-64 + lock grpc4bmi deps
sverhoeven Jul 24, 2024
6272453
Regenerate lock file
sverhoeven Jul 24, 2024
6a127f5
Add missing fsspec dep
sverhoeven Jul 24, 2024
af51dfe
changelog entry
sverhoeven Jul 24, 2024
127ca02
Add cartopy as dep
sverhoeven Jul 24, 2024
b1f9083
Give nicer error when esmvaltool/esmvalcore package can not be found
sverhoeven Jul 24, 2024
27b3e63
Use custom error
sverhoeven Jul 24, 2024
3c7f21d
Add test for ESMValToolNotFoundError
sverhoeven Jul 24, 2024
e983e76
Use importlib from standard library
sverhoeven Jul 29, 2024
2460632
On ci use python version that is in lock file
sverhoeven Jul 29, 2024
bf444e9
Group importlib with other standard libs
sverhoeven Jul 29, 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
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
fail-fast: false
name: Run tests in conda environment ${{ matrix.python-version }}
name: Run tests in conda environment
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-file: conda-lock.yml
environment-name: ci
cache-environment: true
init-shell: bash
- name: Install dependencies
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- name: Set up Python
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-file: conda-lock.yml
environment-name: ci
cache-environment: true
init-shell: bash
- name: Install dependencies
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ repos:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/adrienverge/yamllint
rev: "v1.29.0"
rev: "v1.35.1"
hooks:
- id: yamllint
exclude: conda-lock.yml
- repo: https://github.com/psf/black
rev: "22.3.0"
hooks:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Formatted as described on [https://keepachangelog.com](https://keepachangelog.co

## [Unreleased]

## Changed

- Use [conda-lock](https://conda.github.io/conda-lock/) to install reproducible conda dependencies. Instead of loosely pinned environment.yml ([#442](https://github.com/eWaterCycle/ewatercycle/pull/442))
- Esmvaltool is no longer a Python dependency, but a conda dependency ([#442](https://github.com/eWaterCycle/ewatercycle/pull/442))

### [2.2.0] (2024-07-08)

### Added
Expand Down
25 changes: 14 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ The sections below outline the steps in each case.
repository (follow the instructions
[here](https://help.github.com/articles/configuring-a-remote-for-a-fork/)
and [here](https://help.github.com/articles/syncing-a-fork/));
4. install the package in editable mode and its dependencies with
`pip3 install -e .[dev]`;
4. install package main and dev dependencies in a conda environment with
`conda-lock install -n ewatercycle` and activate it with `conda activate ewatercycle`;
4. install the package in editable mode with
`pip3 install -e .`;
4. make sure pre commit hook is installed by running `pre-commit install`, causes linting and formatting to be applied during commit;
5. make sure the existing tests still work by running `pytest`;
6. make sure the existing documentation can still by generated without
Expand All @@ -79,22 +81,23 @@ your pull request.
This section is for maintainers of the package.

1. Checkout ``HEAD`` of ``main`` branch with ``git checkout main`` and ``git pull``.
2. Determine what new version (major, minor or patch) to use. Package uses `semantic versioning <https://semver.org>`_.
3. Run ``bump2version <major|minor|patch>`` to update version in package files.
4. Update CHANGELOG.md with changes between current and new version. (Don't forget to also update the links at the bottom of the file)
5. Make sure pre-commit hooks are green for all files by running ``pre-commit run --all-files``.
6. Commit & push changes to GitHub.
7. Wait for [GitHub
2. If dependencies have changed then create a new [conda lock](https://conda.github.io/conda-lock/) file with ``conda-lock lock -f pyproject.toml``.
3. Determine what new version (major, minor or patch) to use. Package uses `semantic versioning <https://semver.org>`_.
4. Run ``bump2version <major|minor|patch>`` to update version in package files.
sverhoeven marked this conversation as resolved.
Show resolved Hide resolved
5. Update CHANGELOG.md with changes between current and new version. (Don't forget to also update the links at the bottom of the file)
6. Make sure pre-commit hooks are green for all files by running ``pre-commit run --all-files``.
7. Commit & push changes to GitHub.
8. Wait for [GitHub
actions](https://github.com/eWaterCycle/ewatercycle/actions?query=branch%3Amain+)
to be completed and green.

8. Create a [GitHub release](https://github.com/eWaterCycle/ewatercycle/releases/new)
9. Create a [GitHub release](https://github.com/eWaterCycle/ewatercycle/releases/new)

- Use version as title and tag version.
- As description use intro text from README.md (to give context to
Zenodo record) and changes from CHANGELOG.md

9. Verify
10. Verify

1. Has [new Zenodo
record](https://zenodo.org/search?page=1&size=20&q=ewatercycle)
Expand All @@ -107,4 +110,4 @@ This section is for maintainers of the package.
4. Can new version be installed with pip using
`pip3 install ewatercycle==<new version>`?

10. Celebrate
11. Celebrate
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ generate forcing data. It is preferred to create a Conda environment to
install those dependencies:

```shell
wget https://raw.githubusercontent.com/eWaterCycle/ewatercycle/main/environment.yml
conda install mamba -n base -c conda-forge -y
mamba env create --file environment.yml
wget https://raw.githubusercontent.com/eWaterCycle/ewatercycle/main/conda-lock.yml
conda install mamba conda-lock -n base -c conda-forge -y
conda-lock install --no-dev -n ewatercycle
conda activate ewatercycle
```

Expand Down
Loading
Loading