|
4 | 4 | [](https://pypi.org/project/xarray-dataclasses/) |
5 | 5 | [](https://pepy.tech/project/xarray-dataclasses) |
6 | 6 | [](https://doi.org/10.5281/zenodo.4624819) |
7 | | -[](https://github.com/astropenguin/xarray-dataclasses/actions) |
| 7 | +[](https://github.com/astropenguin/xarray-dataclasses/actions/workflows/tests.yaml) |
| 8 | +[](https://github.com/melonora/xarray-dataclasses/actions/workflows/pypi.yaml) |
8 | 9 |
|
9 | 10 | xarray data creation by data classes |
10 | 11 |
|
@@ -46,8 +47,13 @@ class Image(AsDataArray): |
46 | 47 |
|
47 | 48 | ### Installation |
48 | 49 |
|
| 50 | +There are multiple ways you can install xarray-dataclasses, dependent on what kind of dependency manager you use. |
| 51 | + |
49 | 52 | ```shell |
50 | 53 | pip install xarray-dataclasses |
| 54 | +conda install -c conda-forge xarray-dataclasses |
| 55 | +pixi add xarray-dataclasses |
| 56 | +pixi add --pypi xarray-dataclasses |
51 | 57 | ``` |
52 | 58 |
|
53 | 59 | ## Basic usage |
@@ -338,6 +344,69 @@ class Image: |
338 | 344 | image = asdataarray(Image([[0, 1], [2, 3]], [0, 1], [0, 1])) |
339 | 345 | ``` |
340 | 346 |
|
| 347 | +## How to contribute |
| 348 | + |
| 349 | +Thank you for being willing to contribute! If you have some ideas to propose, please open an [issue](https://github.com/xarray-contrib/xarray-dataclasses/issues). |
| 350 | +We use [GitHub flow](https://docs.github.com/en/get-started/using-github/github-flow) for developing and managing the project. |
| 351 | +The first section describes how to contribute with it. |
| 352 | +The second and third sections explain how to prepare a local development environment and our automated workflows in GitHub Actions, respectively. |
| 353 | + |
| 354 | + |
| 355 | +### Get the source code |
| 356 | + |
| 357 | +```shell |
| 358 | +git clone https://github.com/xarray-contrib/xarray-dataclasses |
| 359 | +cd xarray-dataclasses |
| 360 | +``` |
| 361 | + |
| 362 | +### Install dependencies |
| 363 | + |
| 364 | +First install [pixi](https://pixi.sh/latest/installation/). Then, install project dependencies: |
| 365 | + |
| 366 | +```shell |
| 367 | +pixi install -a |
| 368 | +pixi run pre-commit-install |
| 369 | +``` |
| 370 | + |
| 371 | +### Testing, linting, and formatting |
| 372 | +We have [a test workflow][test-workflow] for testing, static type checking, linting, and formatting the code. |
| 373 | +It is used for status checks when a pull request is created. |
| 374 | +If you would like to check them in local, the following commands are almost equivalent (the difference is that the workflow is run under multiple Python versions). |
| 375 | +Furthermore, these tasks are defined only in the `dev` environment. Pixi does not require you to specify the environment |
| 376 | +in that case. |
| 377 | + |
| 378 | +```shell |
| 379 | +pixi run tests |
| 380 | +pixi run flake8 |
| 381 | +pixi run black |
| 382 | +pixi run pyright |
| 383 | +``` |
| 384 | + |
| 385 | +### Creating documentation |
| 386 | +We also have a [documentation workflow] (Add link). However, if you want to locally create the documentation |
| 387 | +run the following: |
| 388 | + |
| 389 | +```shell |
| 390 | +pixi run doc_build |
| 391 | +``` |
| 392 | + |
| 393 | +### Create a release |
| 394 | + |
| 395 | +This section is relevant only for maintainers. |
| 396 | + |
| 397 | +1. Pull `git`'s `main` branch. |
| 398 | +2. `pixi install -a` |
| 399 | +3. `pixi run pre-commit-install` |
| 400 | +4. `pixi run -e test test` |
| 401 | +5. `pixi shell` |
| 402 | +6. `hatch version <new-version>` |
| 403 | +7. `git add .` |
| 404 | +8. `git commit -m "ENH: Bump version to <version>"` |
| 405 | +9. `hatch build` |
| 406 | +10. `hatch publish` |
| 407 | +11. `git push upstream main` |
| 408 | +12. Create a new tag and Release via the GitHub UI. Auto-generate release notes |
| 409 | + and add additional notes as needed. |
341 | 410 |
|
342 | 411 | <!-- References --> |
343 | 412 | [Pyright]: https://github.com/microsoft/pyright |
|
0 commit comments