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

Format #48

Merged
merged 1 commit into from
Nov 18, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
env:
CARGO_TERM_COLOR: always

jobs:
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
cache-dependency-glob: |
pyproject.toml
Cargo.toml

- name: Install python deps + Build
run: |
uv pip install --system -e ".[test]" maturin --verbose
Expand Down
15 changes: 14 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- id: check-merge-conflict
- id: detect-private-key
- id: no-commit-to-branch
args: ["--branch=main"]
- repo: local
hooks:
- id: rustfmt
Expand All @@ -16,4 +29,4 @@ repos:
# The following can be removed once PLR0917 is out of preview
- name: ruff preview rules
id: ruff
args: ["--preview", "--select=PLR0917"]
args: ["--preview", "--select=PLR0917"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```{warning}
⚠️ The version of `zarr-python` we currently depend on is still in pre-release and this
package is accordingly extremely experimental.
We cannot guarantee any stability or correctness at the moment, although we have
We cannot guarantee any stability or correctness at the moment, although we have
tried to do extensive testing and make clear what we think we support and do not.
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

DiscontiguousArrayError
CollapsedDimensionError
```
```
10 changes: 5 additions & 5 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ You will need `rust` and `cargo` installed on your local system. For more info,

We encourage the use of [uv](https://docs.astral.sh/uv/) for environment management. To install the package for development, run

```
```shell
uv pip install -e ".[test,dev,doc]"
```

However, take note that while this does build the rust package, the rust package will not be rebuilt upon edits despite the `-e` flag. You will need to manually rebuild it using either `uv pip install -e .` or `maturin develop`. Take note that for benchmarking/speed testing, it is advisable to build a release version of the rust package by passing the `-r` flag to `maturin`. For more information on the `rust`-`python` bridge, see the [`PyO3` docs](https://pyo3.rs/v0.22.6/).

## Testing

To install test dependencies, simply run
To install test dependencies, simply run

```
```shell
pytest
```

or

```
```shell
pytest -n auto
```

for parallelized tests. Most tests have been copied from the `zarr-python` repository with the exception of `test_pipeline.py` which we have written.
for parallelized tests. Most tests have been copied from the `zarr-python` repository with the exception of `test_pipeline.py` which we have written.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

api
contributing
```
```
2 changes: 1 addition & 1 deletion hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ features = ["test"]
features = ["doc"]
extra-dependencies = ["setuptools"] # https://bitbucket.org/pybtex-devs/pybtex/issues/169
scripts.build = "sphinx-build -M html docs docs/_build -W --keep-going {args}"
scripts.clean = "git clean -fdX -- {args:docs}"
scripts.clean = "git clean -fdX -- {args:docs}"
10 changes: 8 additions & 2 deletions python/zarrs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from zarr.registry import register_pipeline

from ._internal import __version__
from .pipeline import ZarrsCodecPipeline as _ZarrsCodecPipeline
from .utils import CollapsedDimensionError, DiscontiguousArrayError
from ._internal import __version__


# Need to do this redirection so people can access the pipeline as `zarrs.ZarrsCodecPipeline` instead of `zarrs.pipeline.ZarrsCodecPipeline`
class ZarrsCodecPipeline(_ZarrsCodecPipeline):
Expand All @@ -11,4 +12,9 @@ class ZarrsCodecPipeline(_ZarrsCodecPipeline):

register_pipeline(ZarrsCodecPipeline)

__all__ = ["ZarrsCodecPipeline", "DiscontiguousArrayError", "CollapsedDimensionError"]
__all__ = [
"ZarrsCodecPipeline",
"DiscontiguousArrayError",
"CollapsedDimensionError",
"__version__",
]
1 change: 1 addition & 0 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from importlib.metadata import version

import zarrs


Expand Down