Skip to content

Commit bdc210c

Browse files
committed
change to dynamic versioning, change doc build
1 parent 7a8175b commit bdc210c

File tree

7 files changed

+88
-40
lines changed

7 files changed

+88
-40
lines changed

.github/workflows/pypi.yml

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

README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ class Image(AsDataArray):
4747

4848
### Installation
4949

50+
There are multiple ways you can install xarray-dataclasses, dependent on what kind of dependency manager you use.
51+
5052
```shell
5153
pip install xarray-dataclasses
54+
conda install -c conda-forge xarray-dataclasses
55+
pixi add xarray-dataclasses
56+
pixi add --pypi xarray-dataclasses
5257
```
5358

5459
## Basic usage
@@ -339,6 +344,69 @@ class Image:
339344
image = asdataarray(Image([[0, 1], [2, 3]], [0, 1], [0, 1]))
340345
```
341346

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.
342410

343411
<!-- References -->
344412
[Pyright]: https://github.com/microsoft/pyright

docs/build

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

pixi.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "xarray-dataclasses"
7-
version = "1.9.1"
7+
dynamic = ["version"]
88
description = "xarray data creation by data classes"
99
authors = [
1010
{name = "Akio Taniguchi", email = "[email protected]"},
@@ -24,16 +24,16 @@ classifiers = [
2424
]
2525
keywords = ["xarray", "dataclass", "dataarray", "dataset", "typing"]
2626

27-
requires-python = ">=3.8, <3.14"
27+
requires-python = ">=3.9, <3.14"
2828
dependencies = [
2929
"numpy >=2.0.0,<3",
3030
"xarray >=2022.3,<2026",
3131
"typing-extensions>=4.10.0,<5"]
3232

3333
[project.urls]
34-
Homepage = "https://github.com/melonora/xarray-dataclasses/"
35-
Repository = "https://github.com/melonora/xarray-dataclasses/"
36-
Documentation = "https://melonora.github.io/xarray-dataclasses/"
34+
Homepage = "https://github.com/xarray-contrib/xarray-dataclasses/"
35+
Repository = "https://github.com/xarray-contrib/xarray-dataclasses/"
36+
Documentation = "https://xarray-contrib.github.io/xarray-dataclasses/"
3737

3838

3939
[project.optional-dependencies]
@@ -56,6 +56,9 @@ include = [
5656
"LICENSE"
5757
]
5858

59+
[tool.hatch.version]
60+
path = "src/xarray_dataclasses/__about__.py"
61+
5962
[tool.hatch.build.targets.wheel]
6063
packages = ["src/xarray_dataclasses"]
6164

@@ -68,8 +71,11 @@ default = { solve-group = "default" }
6871
dev = { features = ["dev"], solve-group = "default" }
6972

7073
[tool.pixi.feature.dev.tasks]
71-
test = "pytest"
72-
doc_build = "python -m sphinx -b html docs docs/_build"
74+
tests = "pytest"
75+
flake8 = "flake8 docs tests src/xarray_dataclasses"
76+
black = "black --check docs tests xarray_dataclasses"
77+
doc_build = { cmd = "sphinx-apidoc -efT -o docs/_apidoc src/xarray_dataclasses && sphinx-build -a docs docs/_build" }
78+
pyright = "pyright docs tests src/xarray_dataclasses"
7379

7480
[tool.pyright]
7581
reportImportCycles = "warning"

src/xarray_dataclasses/__about__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SPDX-License-Identifier: MIT
2+
__version__ = "1.9.1"

src/xarray_dataclasses/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"datamodel",
1717
"dataoptions",
1818
"typing",
19+
"__version__"
1920
]
20-
__version__ = "1.9.1"
2121

2222

2323
# submodules
@@ -26,6 +26,7 @@
2626
from . import datamodel
2727
from . import dataoptions
2828
from . import typing
29+
from .__about__ import __version__
2930
from .dataarray import *
3031
from .dataset import *
3132
from .datamodel import *

0 commit comments

Comments
 (0)