diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c26835b..da6d4df 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: hooks: - id: black - repo: https://github.com/PyCQA/pylint - rev: v3.0.3 + rev: v3.3.6 hooks: - id: pylint args: [--rcfile=.pylintrc] diff --git a/README.md b/README.md index 559079b..97b52e6 100644 --- a/README.md +++ b/README.md @@ -109,16 +109,30 @@ As the schema and API stabilizes a mid-term goal might be to replace PyMC `BaseT Getting rid of `MultiTrace` was a [long-term goal](https://github.com/pymc-devs/pymc/issues/4372#issuecomment-770100410) behind making `pm.sample(return_inferencedata=True)` the default. ## Development -First clone the repository and install `mcbackend` locally: + +First clone the repository and set up a development environment containing the protobuf compiler. ```bash +mamba create -n mcb python=3.11 grpcio-tools protobuf -y +activate mcb +pip install -r requirements-dev.txt +pip install --pre "betterproto[compiler]" pip install -e . ``` +To compile the `*.proto` files for languages other than Python, check the [ProtocolBuffers documentation](https://developers.google.com/protocol-buffers/docs/tutorials). + +The following script compiles them for Python using the [`betterproto`](https://github.com/danielgtaylor/python-betterproto) compiler plugin to get nice-looking dataclasses. +It also copies the generated files to the right place in `mcbackend`. + +```bash +python protobufs/generate.py +pre-commit run --all +``` + To run the tests: ```bash -pip install -r requirements-dev.txt pytest -v ``` @@ -128,19 +142,3 @@ To start one in Docker: ```bash docker run --detach --rm --name mcbackend-db -p 9000:9000 --ulimit nofile=262144:262144 clickhouse/clickhouse-server ``` - -### Compiling the ProtocolBuffers -If you don't already have it, first install the protobuf compiler: -```bash -conda install protobuf -pip install --pre "betterproto[compiler]" -``` - -To compile the `*.proto` files for languages other than Python, check the [ProtocolBuffers documentation](https://developers.google.com/protocol-buffers/docs/tutorials). - -The following script compiles them for Python using the [`betterproto`](https://github.com/danielgtaylor/python-betterproto) compiler plugin to get nice-looking dataclasses. -It also copies the generated files to the right place in `mcbackend`. - -```bash -python protobufs/generate.py -``` diff --git a/mcbackend/__init__.py b/mcbackend/__init__.py index a0eb735..45ae0c8 100644 --- a/mcbackend/__init__.py +++ b/mcbackend/__init__.py @@ -14,7 +14,7 @@ except ModuleNotFoundError: pass -__version__ = "0.5.2" +__version__ = "0.5.3" __all__ = [ "NumPyBackend", "NullBackend", diff --git a/mcbackend/meta.py b/mcbackend/meta.py index 4ba18c2..ccd53b5 100644 --- a/mcbackend/meta.py +++ b/mcbackend/meta.py @@ -1,8 +1,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: meta.proto # plugin: python-betterproto -# This file has been @generated - from dataclasses import dataclass from datetime import datetime, timedelta from typing import Dict, List diff --git a/mcbackend/npproto/__init__.py b/mcbackend/npproto/__init__.py index 72c096a..e3d99a6 100644 --- a/mcbackend/npproto/__init__.py +++ b/mcbackend/npproto/__init__.py @@ -1,8 +1,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: npproto/ndarray.proto # plugin: python-betterproto -# This file has been @generated - from dataclasses import dataclass from typing import List diff --git a/requirements-dev.txt b/requirements-dev.txt index 59a41df..4a24bc9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,7 @@ arviz clickhouse-driver flake8 +pre-commit pytest pytest-cov twine diff --git a/requirements.txt b/requirements.txt index fb25bb6..23b1577 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -betterproto==2.0.0b6 +betterproto==2.0.0b7 hagelkorn numpy pandas