Skip to content

Commit bde6d06

Browse files
Merge pull request #99 from boukeversteegh/release-v2.0.0b1
Release v2.0.0b1
2 parents cdddb2f + eaa4f7f commit bde6d06

File tree

4 files changed

+66
-7
lines changed

4 files changed

+66
-7
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
- Versions suffixed with `b*` are in `beta` and can be installed with `pip install --pre betterproto`.
9+
10+
## [2.0.0b1] - 2020-07-04
11+
12+
[Upgrade Guide](./docs/upgrading.md)
13+
14+
> Several bugfixes and improvements required or will require small breaking changes, necessitating a new version.
15+
> `2.0.0` will be released once the interface is stable.
16+
17+
- Add support for gRPC and **stream-stream** [#83](https://github.com/danielgtaylor/python-betterproto/pull/83)
18+
- Switch from to `poetry` for development [#75](https://github.com/danielgtaylor/python-betterproto/pull/75)
19+
- Fix No arguments are generated for stub methods when using import with proto definition
20+
- Fix two packages with the same name suffix should not cause naming conflict [#25](https://github.com/danielgtaylor/python-betterproto/issues/25)
21+
22+
- Fix Import child package from root [#57](https://github.com/danielgtaylor/python-betterproto/issues/57)
23+
- Fix Import child package from package [#58](https://github.com/danielgtaylor/python-betterproto/issues/58)
24+
- Fix Import parent package from child package [#59](https://github.com/danielgtaylor/python-betterproto/issues/59)
25+
- Fix Import root package from child package [#60](https://github.com/danielgtaylor/python-betterproto/issues/60)
26+
- Fix Import root package from root [#61](https://github.com/danielgtaylor/python-betterproto/issues/61)
27+
28+
- Fix ALL_CAPS message fields are parsed incorrectly. [#11](https://github.com/danielgtaylor/python-betterproto/issues/11)
29+
830
## [1.2.5] - 2020-04-27
931

1032
- Add .j2 suffix to python template names to avoid confusing certain build tools [#72](https://github.com/danielgtaylor/python-betterproto/pull/72)

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This project exists because I am unhappy with the state of the official Google p
4040

4141
This project is a reimplementation from the ground up focused on idiomatic modern Python to help fix some of the above. While it may not be a 1:1 drop-in replacement due to changed method names and call patterns, the wire format is identical.
4242

43-
## Installation & Getting Started
43+
## Installation
4444

4545
First, install the package. Note that the `[compiler]` feature flag tells it to install extra dependencies only needed by the `protoc` plugin:
4646

@@ -52,6 +52,12 @@ pip install "betterproto[compiler]"
5252
pip install betterproto
5353
```
5454

55+
*Betterproto* is under active development. To install the latest beta version, use `pip install --pre betterproto`.
56+
57+
## Getting Started
58+
59+
### Compiling proto files
60+
5561
Now, given you installed the compiler and have a proto file, e.g `example.proto`:
5662

5763
```protobuf
@@ -149,7 +155,7 @@ service Echo {
149155

150156
You can use it like so (enable async in the interactive shell first):
151157

152-
```py
158+
```python
153159
>>> import echo
154160
>>> from grpclib.client import Channel
155161

@@ -174,8 +180,8 @@ Both serializing and parsing are supported to/from JSON and Python dictionaries
174180

175181
For compatibility the default is to convert field names to `camelCase`. You can control this behavior by passing a casing value, e.g:
176182

177-
```py
178-
>>> MyMessage().to_dict(casing=betterproto.Casing.SNAKE)
183+
```python
184+
MyMessage().to_dict(casing=betterproto.Casing.SNAKE)
179185
```
180186

181187
### Determining if a message was sent
@@ -300,7 +306,22 @@ datetime.datetime(2019, 1, 1, 11, 59, 58, 800000, tzinfo=datetime.timezone.utc)
300306

301307
Join us on [Slack](https://join.slack.com/t/betterproto/shared_invite/zt-f0n0uolx-iN8gBNrkPxtKHTLpG3o1OQ)!
302308

303-
First, make sure you have Python 3.6+ and `poetry` installed, along with the official [Protobuf Compiler](https://github.com/protocolbuffers/protobuf/releases) for your platform. Then:
309+
### Requirements
310+
311+
- Python (3.6 or higher)
312+
313+
- [protoc](https://grpc.io/docs/protoc-installation/) (3.12 or higher)
314+
*Needed to compile `.proto` files and run the tests*
315+
316+
- [poetry](https://python-poetry.org/docs/#installation)
317+
*Needed to install dependencies in a virtual environment*
318+
319+
- make ([ubuntu](https://www.howtoinstall.me/ubuntu/18-04/make/), [windows](https://stackoverflow.com/questions/32127524/how-to-install-and-use-make-in-windows), [mac](https://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/))
320+
321+
*Needed to conveniently run development tasks.*
322+
*Alternatively, manually run the commands defined in the [Makefile](./Makefile)*
323+
324+
### Setup
304325

305326
```sh
306327
# Get set up with the virtual env & dependencies
@@ -310,7 +331,7 @@ poetry install
310331
poetry shell
311332
```
312333

313-
To benefit from the collection of standard development tasks ensure you have make installed and run `make help` to see available tasks.
334+
Run `make help` to see all available development tasks.
314335

315336
### Code style
316337

docs/upgrading.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Upgrade Guide
2+
3+
## [1.2.5] to [2.0.0b1]
4+
5+
### Updated package structures
6+
7+
Generated code now strictly follows the *package structure* of the `.proto` files.
8+
Consequently `.proto` files without a package will be combined in a single `__init__.py` file.
9+
To avoid overwriting existing `__init__.py` files, its best to compile into a dedicated subdirectory.
10+
11+
Upgrading:
12+
13+
- Remove your previously compiled `.py` files.
14+
- Create a new *empty* directory, e.g. `generated` or `lib/generated/proto` etcetera.
15+
- Regenerate your python files into this directory
16+
- Update import statements, e.g. `import ExampleMessage from generated`

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "betterproto"
3-
version = "1.2.5"
3+
version = "2.0.0b1"
44
description = "A better Protobuf / gRPC generator & library"
55
authors = ["Daniel G. Taylor <danielgtaylor@gmail.com>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)