Skip to content

Commit

Permalink
lint: fix trailing line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Nov 23, 2020
1 parent ed610ed commit cdc4e56
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ exclude =
.pytest_cache
.github
_legacy
_internal
_internal
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ make update
```

### gNMI Target Server
You can use the [google/gnxi/gnmi_target](https://github.com/google/gnxi/tree/master/gnmi_target) to test the client
code. You can set this up using the the following commands (assuming you have ``golang` and `GOPATH` configured
You can use the [google/gnxi/gnmi_target](https://github.com/google/gnxi/tree/master/gnmi_target) to test the client
code. You can set this up using the the following commands (assuming you have ``golang` and `GOPATH` configured
correctly).

#### Installation
Expand All @@ -23,7 +23,7 @@ go install -v github.com/google/gnxi/gnmi_target
```

#### Sample Configuration
You can use the provided [sample configuration](tests/integration/fixtures/config.json). If you do not have a local copy
You can use the provided [sample configuration](tests/integration/fixtures/config.json). If you do not have a local copy
of the repository, fetch it using `curl`.

```sh
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@

This project aims to be a base building block for [gNMI](https://github.com/openconfig/gnmi) projects written in Python.

The process of building pythonic libraries and applications using [gRPC](https://grpc.io/) and [Protocol Buffers](https://developers.google.com/protocol-buffers)
have been fragmented. This often means that a developer needs to copy over `proto` files, generate Python source from
these using `protoc` and use them in-tree for their project. There already exists several projects built in this fashion.
The process of building pythonic libraries and applications using [gRPC](https://grpc.io/) and [Protocol Buffers](https://developers.google.com/protocol-buffers)
have been fragmented. This often means that a developer needs to copy over `proto` files, generate Python source from
these using `protoc` and use them in-tree for their project. There already exists several projects built in this fashion.
While functional, these can be hard to reuse or maintain, often times resulting stale code and no versioning.

`gnmi-proto` builds on top of the improvement already done by [betterproto](https://pypi.org/project/betterproto/) and
in turn by the [grpclib](https://pypi.org/project/grpclib/) library. Here, we make available, as versioned packages,
`gnmi-proto` builds on top of the improvement already done by [betterproto](https://pypi.org/project/betterproto/) and
in turn by the [grpclib](https://pypi.org/project/grpclib/) library. Here, we make available, as versioned packages,
code generated from [gNMI protocol buffers](https://github.com/openconfig/gnmi/tree/master/proto).

The default implementation makes use of the [betterproto](https://pypi.org/project/betterproto/) `protoc` plugin to
generate clean modern code. In addition, this also provides a `gnmi.proto.legacy` module exposing code generated by
The default implementation makes use of the [betterproto](https://pypi.org/project/betterproto/) `protoc` plugin to
generate clean modern code. In addition, this also provides a `gnmi.proto.legacy` module exposing code generated by
`protoc` using the the in-built Python generator.

## Example Usage
### Client
The following code expects a server at `127.0.0.1:9339` with the [test configuration](https://github.com/python-gnxi/python-gnmi-proto/blob/master/tests/integration/fixtures/config.json). Refer to [gNMI Target Server](https://github.com/python-gnxi/python-gnmi-proto/blob/master/CONTRIBUTING.md#gnmi-target-server) section in [CONTRIBUTING.md](https://github.com/python-gnxi/python-gnmi-proto/blob/master/CONTRIBUTING.md) for information on how to set it up.

#### Using betterproto and grpclib
```py
```py
import gnmi.proto
import grpclib.client

Expand All @@ -35,7 +35,7 @@ async def main():
service = gnmi.proto.gNMIStub(
channel, metadata={"username": "admin", "password": "secret"}
)

response = await service.capabilities()
print(response.to_json(indent=2))

Expand Down

0 comments on commit cdc4e56

Please sign in to comment.