Skip to content

Commit 21ed6c2

Browse files
committed
release v0.5
1 parent a404aa2 commit 21ed6c2

5 files changed

Lines changed: 42 additions & 8 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ output = client.com.example.my_procedure({'foo': 'bar'}, baz=5)
5252

5353
Note that `-` characters in method NSIDs are converted to `_`s, eg the call above is for the method `com.example.my-procedure`.
5454

55+
To call a method with non-JSON (eg binary) input, pass `bytes` to the call instead of a `dict`, and pass the content type with `headers={'Content-Type': '...'}`.
56+
5557
[Event stream methods](https://atproto.com/specs/event-stream) with type `subscription` are generators that `yield` (header, payload) tuples sent by the server. They take parameters as kwargs, but no positional `input`.
5658

5759
```py
@@ -228,6 +230,14 @@ Here's how to package, test, and ship a new release.
228230
229231
## Changelog
230232
233+
### 0.5 - 2023-12-10
234+
235+
* `Client`:
236+
* Support binary request data automatically based on input type, eg `dict` vs `bytes`.
237+
* Add new `headers` kwarg to `call` and auto-generated lexicon method calls, useful for providing an explicit `Content-Type` when sending binary data.
238+
* Bug fix: don't infinite loop if `refreshSession` fails.
239+
* Other minor authentication bug fixes.
240+
231241
### 0.4 - 2023-10-28
232242
233243
* Bundle [the official lexicons](https://github.com/bluesky-social/atproto/tree/main/lexicons/) for `app.bsky` and `com.atproto`, use them by default.

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@
8888
# built documents.
8989
#
9090
# The short X.Y version.
91-
version = '0.4'
91+
version = '0.5'
9292
# The full version, including alpha/beta/rc tags.
93-
release = '0.4'
93+
release = '0.5'
9494

9595
# The language for content autogenerated by Sphinx. Refer to documentation
9696
# for a list of supported languages.

docs/index.rst

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ schemas.
1313
Install from `PyPI <https://pypi.org/project/lexrpc/>`__ with
1414
``pip install lexrpc`` or ``pip install lexrpc[flask]``.
1515

16-
License: This project is placed in the public domain.
16+
License: This project is placed in the public domain. You may also use
17+
it under the `CC0
18+
License <https://creativecommons.org/publicdomain/zero/1.0/>`__.
1719

1820
- `Client <#client>`__
1921
- `Server <#server>`__
@@ -71,6 +73,10 @@ or use custom lexicons by passing them to the ``Client`` constructor:
7173
Note that ``-`` characters in method NSIDs are converted to ``_``\ s, eg
7274
the call above is for the method ``com.example.my-procedure``.
7375

76+
To call a method with non-JSON (eg binary) input, pass ``bytes`` to the
77+
call instead of a ``dict``, and pass the content type with
78+
``headers={'Content-Type': '...'}``.
79+
7480
`Event stream methods <https://atproto.com/specs/event-stream>`__ with
7581
type ``subscription`` are generators that ``yield`` (header, payload)
7682
tuples sent by the server. They take parameters as kwargs, but no
@@ -315,6 +321,21 @@ Here’s how to package, test, and ship a new release.
315321
Changelog
316322
---------
317323

324+
0.5 - 2023-12-10
325+
~~~~~~~~~~~~~~~~
326+
327+
- ``Client``:
328+
329+
- Support binary request data automatically based on input type, eg
330+
``dict`` vs ``bytes``.
331+
- Add new ``headers`` kwarg to ``call`` and auto-generated lexicon
332+
method calls, useful for providing an explicit ``Content-Type``
333+
when sending binary data.
334+
- Bug fix: don’t infinite loop if ``refreshSession`` fails.
335+
- Other minor authentication bug fixes.
336+
337+
.. _section-1:
338+
318339
0.4 - 2023-10-28
319340
~~~~~~~~~~~~~~~~
320341

@@ -339,7 +360,7 @@ Changelog
339360
``User-Agent: lexrpc (https://lexrpc.readthedocs.io/)`` request
340361
header.
341362

342-
- ``server``:
363+
- ``Server``:
343364

344365
- Add new ``Redirect`` class. Handlers can raise this to indicate
345366
that the web server should serve an HTTP redirect. `Whether this
@@ -354,7 +375,7 @@ Changelog
354375
- Add the ``error`` field to the JSON response bodies for most error
355376
responses.
356377

357-
.. _section-1:
378+
.. _section-2:
358379

359380
0.3 - 2023-08-29
360381
~~~~~~~~~~~~~~~~
@@ -366,7 +387,7 @@ Changelog
366387
- Add new ``Server.register`` method for manually registering handlers.
367388
- Bug fix for server ``@method`` decorator.
368389

369-
.. _section-2:
390+
.. _section-3:
370391

371392
0.2 - 2023-03-13
372393
~~~~~~~~~~~~~~~~
@@ -383,7 +404,7 @@ put more effort into matching and fully implementing them. Stay tuned!
383404
format <https://github.com/snarfed/atproto/commit/63b9873bb1699b6bce54e7a8d3db2fcbd2cfc5ab>`__.
384405
Original format is no longer supported.
385406

386-
.. _section-3:
407+
.. _section-4:
387408

388409
0.1 - 2022-12-13
389410
~~~~~~~~~~~~~~~~

lexrpc/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ def call(self, nsid, input=None, headers={}, **params):
121121
Args:
122122
nsid (str): method NSID
123123
input (dict or bytes): input body, optional for subscriptions
124+
headers (dict): HTTP headers to include in this request. Overrides any
125+
headers passed to the constructor.
124126
params: optional method parameters
125127
126128
Returns:
@@ -135,6 +137,7 @@ def call(self, nsid, input=None, headers={}, **params):
135137
output don't validate against the method's schemas
136138
requests.RequestException: if the connection or HTTP request to the
137139
remote server failed
140+
138141
"""
139142
def loggable(val):
140143
return f'{len(val)} bytes' if isinstance(val, bytes) else val

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ where = ['.']
1616

1717
[project]
1818
name = 'lexrpc'
19-
version = '0.4'
19+
version = '0.5'
2020
authors = [
2121
{ name='Ryan Barrett', email='lexrpc@ryanb.org' },
2222
]

0 commit comments

Comments
 (0)