@@ -194,121 +194,104 @@ Release instructions
194194
195195Here’s how to package, test, and ship a new release.
196196
197- 1. Run the unit tests.
197+ 1. Pull from remote to make sure we’re at head.
198+ ``sh git checkout main git pull ``
198199
199- .. code :: sh
200+ 2. Run the unit tests.
201+ ``sh source local/bin/activate.csh python -m unittest discover ``
200202
201- source local/bin/activate.csh
202- python -m unittest discover
203-
204- 2. Bump the version number in ``pyproject.toml `` and ``docs/conf.py ``.
203+ 3. Bump the version number in ``pyproject.toml `` and ``docs/conf.py ``.
205204 ``git grep `` the old version number to make sure it only appears in
206205 the changelog. Change the current changelog entry in ``README.md ``
207206 for this new version from *unreleased * to the current date.
208207
209- 3 . Build the docs. If you added any new modules, add them to the
208+ 4 . Build the docs. If you added any new modules, add them to the
210209 appropriate file(s) in ``docs/source/ ``. Then run
211210 ``./docs/build.sh ``. Check that the generated HTML looks fine by
212211 opening ``docs/_build/html/index.html `` and looking around.
213212
214- 4. ``git commit -am 'release vX.Y' ``
215-
216- 5. Upload to `test.pypi.org <https://test.pypi.org/ >`__ for testing.
217-
218- .. code :: sh
219-
220- python -m build
221- setenv ver X.Y
222- twine upload -r pypitest dist/lexrpc-$ver *
223-
224- 6. Install from test.pypi.org.
225-
226- .. code :: sh
213+ 5. ``git commit -am 'release vX.Y' ``
227214
228- cd /tmp
229- python -m venv local
230- source local/bin/activate.csh
231- pip uninstall lexrpc # make sure we force pip to use the uploaded version
232- pip install --upgrade pip
233- pip install -i https://test.pypi.org/simple --extra-index-url https://pypi.org/simple lexrpc==$ver
234- deactivate
215+ 6. Upload to `test.pypi.org <https://test.pypi.org/ >`__ for testing.
216+ ``sh python -m build setenv ver X.Y twine upload -r pypitest dist/lexrpc-$ver* ``
235217
236- 7. Smoke test that the code trivially loads and runs.
218+ 7. Install from test.pypi.org.
219+ ``sh cd /tmp python -m venv local source local/bin/activate.csh pip uninstall lexrpc # make sure we force pip to use the uploaded version pip install --upgrade pip pip install -i https://test.pypi.org/simple --extra-index-url https://pypi.org/simple lexrpc==$ver ``
237220
238- .. code :: sh
221+ 8. Smoke test that the code trivially loads and runs.
222+ ``sh python # run test code below `` Test code to paste into the
223+ interpreter: \` py from lexrpc import Server
239224
240- source local/bin/activate.csh
241- python
242- # run test code below
243- deactivate
225+ server = Server(lexicons=[{ ‘lexicon’: 1, ‘id’: ‘io.example.ping’,
226+ ‘defs’: { ‘main’: { ‘type’: ‘query’, ‘description’: ‘Ping the
227+ server’, ‘parameters’: {‘message’: { ‘type’: ‘string’ }}, ‘output’:
228+ { ‘encoding’: ‘application/json’, ‘schema’: { ‘type’: ‘object’,
229+ ‘required’: [‘message’], ‘properties’: {‘message’: { ‘type’:
230+ ‘string’ }}, }, }, }, }, }])
244231
245- Test code to paste into the interpreter:
232+ @server.method(‘io.example.ping’) def ping(input, message=’‘):
233+ return {’message’: message}
246234
247- .. code :: py
235+ print(server.call(‘io.example.ping’, {}, message=‘hello world’))
236+ \` `\`
248237
249- from lexrpc import Server
250-
251- server = Server(lexicons = [{
252- ' lexicon' : 1 ,
253- ' id' : ' io.example.ping' ,
254- ' defs' : {
255- ' main' : {
256- ' type' : ' query' ,
257- ' description' : ' Ping the server' ,
258- ' parameters' : {' message' : { ' type' : ' string' }},
259- ' output' : {
260- ' encoding' : ' application/json' ,
261- ' schema' : {
262- ' type' : ' object' ,
263- ' required' : [' message' ],
264- ' properties' : {' message' : { ' type' : ' string' }},
265- },
266- },
267- },
268- },
269- }])
270-
271- @server.method (' io.example.ping' )
272- def ping (input , message = ' ' ):
273- return {' message' : message}
274-
275- print (server.call(' io.example.ping' , {}, message = ' hello world' ))
276-
277- 8. Tag the release in git. In the tag message editor, delete the
238+ 9. Tag the release in git. In the tag message editor, delete the
278239 generated comments at bottom, leave the first line blank (to omit
279240 the release “title” in github), put ``### Notable changes `` on the
280241 second line, then copy and paste this version’s changelog contents
281242 below it.
243+ ``sh git tag -a v$ver --cleanup=verbatim git push && git push --tags ``
282244
283- .. code :: sh
284-
285- git tag -a v$ver --cleanup=verbatim
286- git push && git push --tags
287-
288- 9. `Click here to draft a new release on
245+ 10. `Click here to draft a new release on
289246 GitHub. <https://github.com/snarfed/lexrpc/releases/new> `__ Enter
290247 ``vX.Y `` in the *Tag version * box. Leave *Release title * empty. Copy
291248 ``### Notable changes `` and the changelog contents into the
292249 description text box.
293250
294- 10. Upload to `pypi.org <https://pypi.org/ >`__!
295-
296- .. code :: sh
297-
298- twine upload dist/lexrpc-$ver .tar.gz dist/lexrpc-$ver -py3-none-any.whl
251+ 11. Upload to `pypi.org <https://pypi.org/ >`__!
252+ ``sh twine upload dist/lexrpc-$ver.tar.gz dist/lexrpc-$ver-py3-none-any.whl ``
299253
300- 11 . `Wait for the docs to build on Read the
254+ 12 . `Wait for the docs to build on Read the
301255 Docs <https://readthedocs.org/projects/lexrpc/builds/> `__, then
302256 check that they look ok.
303257
304- 12 . On the `Versions
258+ 13 . On the `Versions
305259 page <https://readthedocs.org/projects/lexrpc/versions/> `__, check
306260 that the new version is active, If it’s not, activate it in the
307261 *Activate a Version * section.
308262
309263Changelog
310264---------
311265
266+ 2.0 - 2025-09-13
267+ ~~~~~~~~~~~~~~~~
268+
269+ *Breaking changes: *
270+
271+ - For queries with non-JSON outputs, ``Client.call `` now returns
272+ ``requests.Response `` instead of the raw output bytes. This gives
273+ callers access to the HTTP response headers, including
274+ ``Content-Type ``.
275+
276+ Non-breaking changes:
277+
278+ - ``Client ``:
279+
280+ - Handle non-JSON output encodings.
281+ - Don’t attempt to refresh access token when a
282+ ``com.atproto.identity `` procedure fails, eg when the PLC code is
283+ wrong.
284+ - Accept arbitrary ``kwargs `` in the ``Client `` constructor, pass them
285+ through to ``requests.get ``/``post ``.
286+
287+ - ``flask_server ``:
288+
289+ - ``init_flask ``: add ``limit_ips `` kwarg for whether to allow more
290+ than one connection to event stream subscription methods per client
291+ IP.
292+
293+ .. _section-1 :
294+
3122951.1 - 2025-03-13
313296~~~~~~~~~~~~~~~~
314297
@@ -343,7 +326,7 @@ Changelog
343326 ``ValidationError ``, ie ``err.args[1] ``, as a dict of additional
344327 HTTP headers to return with the HTTP 400 response.
345328
346- .. _section-1 :
329+ .. _section-2 :
347330
3483311.0 - 2024-10-14
349332~~~~~~~~~~~~~~~~
@@ -367,7 +350,7 @@ Changelog
367350
368351 - Add ``status `` param to ``Redirect ``.
369352
370- .. _section-2 :
353+ .. _section-3 :
371354
3723550.7 - 2024-06-24
373356~~~~~~~~~~~~~~~~
@@ -398,7 +381,7 @@ Changelog
398381- Update bundled ``app.bsky `` and ``com.atproto `` lexicons, as of
399382 `bluesky-social/atproto@15cc6ff37c326d5c186385037c4bfe8b60ea41b1 <https://github.com/bluesky-social/atproto/commit/15cc6ff37c326d5c186385037c4bfe8b60ea41b1 >`__.
400383
401- .. _section-3 :
384+ .. _section-4 :
402385
4033860.6 - 2024-03-16
404387~~~~~~~~~~~~~~~~
@@ -409,7 +392,7 @@ Changelog
409392- Update bundled ``app.bsky `` and ``com.atproto `` lexicons, as of
410393 `bluesky-social/atproto@f45eef3 <https://github.com/bluesky-social/atproto/commit/f45eef3414f8827ba3a6958a7040c7e38bfd6282 >`__.
411394
412- .. _section-4 :
395+ .. _section-5 :
413396
4143970.5 - 2023-12-10
415398~~~~~~~~~~~~~~~~
@@ -424,7 +407,7 @@ Changelog
424407 - Bug fix: don’t infinite loop if ``refreshSession `` fails.
425408 - Other minor authentication bug fixes.
426409
427- .. _section-5 :
410+ .. _section-6 :
428411
4294120.4 - 2023-10-28
430413~~~~~~~~~~~~~~~~
@@ -464,7 +447,7 @@ Changelog
464447 - Add the ``error `` field to the JSON response bodies for most error
465448 responses.
466449
467- .. _section-6 :
450+ .. _section-7 :
468451
4694520.3 - 2023-08-29
470453~~~~~~~~~~~~~~~~
@@ -476,7 +459,7 @@ Changelog
476459- Add new ``Server.register `` method for manually registering handlers.
477460- Bug fix for server ``@method `` decorator.
478461
479- .. _section-7 :
462+ .. _section-8 :
480463
4814640.2 - 2023-03-13
482465~~~~~~~~~~~~~~~~
@@ -493,7 +476,7 @@ put more effort into matching and fully implementing them. Stay tuned!
493476 format <https://github.com/snarfed/atproto/commit/63b9873bb1699b6bce54e7a8d3db2fcbd2cfc5ab> `__.
494477 Original format is no longer supported.
495478
496- .. _section-8 :
479+ .. _section-9 :
497480
4984810.1 - 2022-12-13
499482~~~~~~~~~~~~~~~~
0 commit comments