Skip to content

Commit 6dd4583

Browse files
authored
Merge pull request #106 from bcdev/forman-x-switch_to_ruff
Repo and package maintenance
2 parents 8129c59 + 8777eca commit 6dd4583

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+308
-278
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright © 2023 Norman Fomferra
1+
# Copyright © 2024, 2025 Brockmann Consult
22
# Permission granted under conditions of the MIT license,
33
# see https://mit-license.org/
44

.flake8

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
pip install .[dev,doc]
31-
- name: Lint with flake8
31+
- name: Lint with ruff
3232
run: |
33-
# stop the build if there are Python syntax errors or undefined names
34-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
33+
ruff check
3734
- name: Test with pytest
3835
run: |
3936
pytest --cov=zappend

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## Version 0.8.1 (in development)
2+
3+
* Replaced dev tools black and flake8 by isort and ruff.
4+
* Reformatted code and fixed linter issues.
5+
* Added `environment.yml` to setup a conda/mamba development environment.
6+
* Updated copyright notice.
7+
8+
19
## Version 0.8.0 (from 2024-10-04)
210

311
* Added module `zappend.contrib` that contributes functions to

CONTRIBUTING.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ checklist are addressed in your PR.
2020

2121
**PR checklist**
2222

23-
* Format code using [black](https://black.readthedocs.io/) with default settings.
23+
* Format code using first [isort](https://pycqa.github.io/isort/)
24+
then [ruff](https://black.readthedocs.io/) with default settings
25+
(`ruff format .`).
2426
Check also section [code style](#code-style) below.
2527
* Your change shall not break existing unit tests.
2628
`pytest` must run without errors.
@@ -38,10 +40,9 @@ checklist are addressed in your PR.
3840
## Code style
3941

4042
The `zappend` code compliant to [PEP-8](https://pep8.org/) except for a line
41-
length of 88 characters as recommended by [black](https://black.readthedocs.io/).
42-
Since black is un-opinionated regarding the order of imports,
43-
we use the following three import blocks separated by an empty
44-
line:
43+
length of 88 characters as used by `ruff format`.
44+
We structure imports using three blocks separated by an empty
45+
line and sort them using `isort` _before_ applying `ruff`:
4546

4647
1. Python standard library imports, e.g., `os`, `typing`, etc
4748
2. 3rd-party imports, e.g., `xarray`, `zarr`, etc

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![codecov](https://codecov.io/gh/bcdev/zappend/graph/badge.svg?token=B3R6bNmAUp)](https://codecov.io/gh/bcdev/zappend)
1010
[![PyPI Version](https://img.shields.io/pypi/v/zappend)](https://pypi.org/project/zappend/)
1111
[![Conda Version](https://anaconda.org/conda-forge/zappend/badges/version.svg)](https://anaconda.org/conda-forge/zappend)
12-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
12+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v0.json)](https://github.com/charliermarsh/ruff)
1313
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/bcdev/zappend/HEAD?labpath=examples%2Fzappend-demo.ipynb)
1414
[![GitHub License](https://img.shields.io/github/license/bcdev/zappend)](https://github.com/bcdev/zappend)
1515

docs/about.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ pytest --cov=zappend tests
4545

4646
### Code Style
4747

48-
`zappend` source code is formatted using the [black](https://black.readthedocs.io/) tool.
48+
`zappend` source code is formatted using the
49+
[ruff](https://github.com/charliermarsh/ruff) tool.
4950

5051
```bash
51-
black zappend
52+
ruff format .
5253
```
5354

5455
### Documentation

environment.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: zappend
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python >=3.10
6+
# Library Dependencies
7+
- click
8+
- dask
9+
- fsspec
10+
- jsonschema
11+
- numcodecs
12+
- numpy
13+
- pyyaml
14+
- xarray
15+
- zarr >=2.18,<3
16+
# Dev Dependencies
17+
- isort
18+
- pytest
19+
- pytest-cov
20+
- ruff
21+
# Doc Dependencies
22+
- mkdocs
23+
- mkdocs-autorefs
24+
- mkdocs-material
25+
- mkdocstrings
26+
- mkdocstrings-python
27+
# Testing Datasets
28+
- dask
29+
- pandas
30+
- pyproj
31+
- netcdf4
32+
- h5netcdf
33+
- s3fs
34+
- scipy

examples/zappend-demo.ipynb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818
"outputs": [],
1919
"source": [
2020
"import glob\n",
21-
"import math\n",
2221
"import os\n",
2322
"import os.path\n",
2423
"import shutil\n",
2524
"\n",
26-
"import numpy as np\n",
2725
"import xarray as xr"
2826
]
2927
},
@@ -2951,10 +2949,7 @@
29512949
"id": "e3b5f156-88c7-4ce1-908e-88ddc7b7e18c",
29522950
"metadata": {},
29532951
"outputs": [],
2954-
"source": [
2955-
"from IPython.display import Markdown\n",
2956-
"from zappend.config import get_config_schema"
2957-
]
2952+
"source": []
29582953
},
29592954
{
29602955
"cell_type": "code",
@@ -3023,7 +3018,7 @@
30233018
"metadata": {},
30243019
"outputs": [],
30253020
"source": [
3026-
"config_path = f\"zappend-config.yaml\""
3021+
"config_path = \"zappend-config.yaml\""
30273022
]
30283023
},
30293024
{

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ site_name: zappend
22
repo_url: https://github.com/bcdev/zappend
33
repo_name: bcdev/zappend
44

5-
copyright: Copyright &copy; 2024 Brockmann Consult
5+
copyright: Copyright &copy; 2024, 2025 Brockmann Consult and contributors
66

77
nav:
88
- Overview: index.md

0 commit comments

Comments
 (0)