Skip to content

Commit 44932ed

Browse files
authored
Merge pull request #70 from tcalmant:docs-update
Convert documentation to Markdown
2 parents b6d450f + cd82cc3 commit 44932ed

16 files changed

+847
-880
lines changed

README.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ import ssl
139139

140140
# Setup the SSL socket
141141
server = SimpleJSONRPCServer(('localhost', 8080), bind_and_activate=False)
142-
server.socket = ssl.wrap_socket(server.socket, certfile='server.pem',
143-
server_side=True)
142+
server.socket = ssl.wrap_socket(
143+
server.socket, certfile='server.pem', server_side=True)
144144
server.server_bind()
145145
server.server_activate()
146146

@@ -258,7 +258,7 @@ finally:
258258
os.remove(socket_name)
259259
```
260260

261-
This feature is tested on Linux during Travis-CI builds. It also has
261+
This feature is tested on Linux during GitHub CI builds. It also has
262262
been tested on Windows Subsystem for Linux (WSL) on Windows 10 1809.
263263

264264
This feature is not available on "pure" Windows, as it doesn't provide
@@ -317,8 +317,8 @@ that in, although the best is just to give a specific configuration to
317317
2.0
318318
>>> config = jsonrpclib.config.Config(version=1.0)
319319
>>> history = jsonrpclib.history.History()
320-
>>> server = jsonrpclib.ServerProxy('http://localhost:8080', config=config,
321-
history=history)
320+
>>> server = jsonrpclib.ServerProxy(
321+
... 'http://localhost:8080', config=config, history=history)
322322
>>> server.add(7, 10)
323323
17
324324
>>> print(history.request)
@@ -363,8 +363,8 @@ using the `headers` keyword argument, when creating the `ServerProxy`:
363363

364364
```python
365365
>>> import jsonrpclib
366-
>>> server = jsonrpclib.ServerProxy("http://localhost:8080",
367-
headers={'X-Test' : 'Test'})
366+
>>> server = jsonrpclib.ServerProxy(
367+
... "http://localhost:8080", headers={'X-Test' : 'Test'})
368368
```
369369

370370
You can also put additional request headers only for certain method
@@ -421,7 +421,7 @@ class TestSerial(object):
421421
return (self.args, {'foo':self.foo,})
422422
```
423423

424-
- Sample usage:
424+
* Sample usage:
425425

426426
```python
427427
>>> import jsonrpclib
@@ -439,12 +439,15 @@ class TestSerial(object):
439439

440440
>>> print(history.request)
441441
{"id": "7805f1f9-9abd-49c6-81dc-dbd47229fe13", "jsonrpc": "2.0",
442-
"method": "ping", "params": [{"__jsonclass__":
443-
["test_obj.TestSerial", []], "foo": "bar"}
444-
]}
442+
"method": "ping", "params": [
443+
{"__jsonclass__": ["test_obj.TestSerial", []], "foo": "bar"}
444+
]}
445445
>>> print(history.response)
446446
{"id": "7805f1f9-9abd-49c6-81dc-dbd47229fe13", "jsonrpc": "2.0",
447-
"result": {"__jsonclass__": ["test_obj.TestSerial", []], "foo": "bar"}}
447+
"result": {
448+
"__jsonclass__": ["test_obj.TestSerial", []],
449+
"foo": "bar"
450+
}}
448451
```
449452

450453
This behavior is turned on by default.
@@ -460,13 +463,22 @@ Feedback on this "feature" is very, VERY much appreciated.
460463

461464
## Tests
462465

463-
Tests are an almost-verbatim drop from the JSON-RPC specification 2.0
464-
page. They can be run using *unittest* or *nosetest*:
466+
Tests are an almost-verbatim drop from the JSON-RPC specification 2.0 page.
465467

466-
```
468+
You can also run the test script, `./run_tests.sh` that will also try
469+
to install then remove the optional JSON parsing libraries (`orJson`, `uJson`, ...).
470+
This is the script executed by GitHub CI and in Docker containers before releases.
471+
472+
The script can also be executed with `uv` to use a virtual environment to run tests:
473+
`uv run ./run_tests.sh`.
474+
475+
You can also run tests for your setup using `unittest`, `nosetest` or `pytest`:
476+
477+
```console
467478
python -m unittest discover tests
468479
python3 -m unittest discover tests
469480
nosetests tests
481+
pytest tests
470482
```
471483

472484
## Why JSON-RPC?

docs/changelog.md

Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
# Release Notes
2+
3+
## 1.0
4+
5+
:Release Date: 2025-11-09
6+
7+
- Disable CGI on Python 3.15 (see [#64](https://github.com/tcalmant/jsonrpclib/issues/64)).
8+
Python 3.15 will drop support for CGI, removing the parent classes we relied onto.
9+
Thanks [@mtelka](https://github.com/mtelka) for spotting this.
10+
- GitHub CI configuration now runs tests from Python 3.8 to 3.15 (alpha).
11+
The code is manually tested on Python 2.7 and 3.6 Docker containers before releases.
12+
- Bumping version to 1.0 as we didn't have big issues for a while and we can consider
13+
the project stable.
14+
15+
## 0.4.3.4
16+
17+
:Release Date: 2025-03-03
18+
19+
- Add `orjson` support (see [#62](https://github.com/tcalmant/jsonrpclib/pull/62)).
20+
Thanks [@fhaeuser](https://github.com/fhaeuser) for this.
21+
- Updated GitHub CI configuration to support testing from Python 3.6 to 3.14.
22+
23+
## 0.4.3.3
24+
25+
:Release Date: 2024-06-14
26+
27+
- Added support for `decimal.Decimal` objects (see [#60](https://github.com/tcalmant/jsonrpclib/pull/60)).
28+
Thanks [@pourhouse](https://github.com/pourhouse) for this improvement.
29+
30+
## 0.4.3.2
31+
32+
:Release Date: 2022-02-19
33+
34+
- Reordered `PooledJSONRPCServer` inheritance definition ([#55](https://github.com/tcalmant/jsonrpclib/issues/55))
35+
- Migration of Continuous Integration:
36+
37+
- Use PyTest instead of Nose
38+
- Run CI with GitHub Actions instead of Travis-CI
39+
40+
## 0.4.3.2
41+
42+
:Release Date: 2021-09-28
43+
44+
- Removed remaining print statements ([#52](https://github.com/tcalmant/jsonrpclib/issues/52))
45+
46+
## 0.4.3
47+
48+
:Release Date: 2021-09-26
49+
50+
- `ServerProxy` keeps the given query string, as before 0.4.2.
51+
This release fixes [#51](https://github.com/tcalmant/jsonrpclib/issues/51),
52+
and a unit test has been added to ensure there won't be any regression again on this feature
53+
- JSON library selection is now made in the `jsonrpclib.jsonlib` module,
54+
using a set of handler classes. This will ease the addition of new libraries.
55+
- Added support for ujson
56+
- Fixed Travis-CI builds (migrated from .org to .com and bypassed the coveralls issue with ppc64le)
57+
- Fixed an issue with the CGI test in Python 3-only environments
58+
59+
## 0.4.2
60+
61+
:Release Date: 2020-11-09
62+
63+
- Use `urlparse` from `urllib.parse` (Python 3) or `urlparse` (Python 2)
64+
to prepare for the deprecation of `urllib.parse.splittype`.
65+
Thanks to [@citrus-it](https://github.com/citrus-it) and
66+
[@markmcclain](https://github.com/markmcclain) for this fix.
67+
(see [#44](https://github.com/tcalmant/jsonrpclib/pull/44) and
68+
[#45](https://github.com/tcalmant/jsonrpclib/pull/45) for more details)
69+
- Unix socket clients now send `localhost` as `Host:` HTTP field instead of
70+
the path to the socket (see [#47](https://github.com/tcalmant/jsonrpclib/pull/47)).
71+
Thanks [@markmcclain](https://github.com/markmcclain) for this fix.
72+
- Added a `TransportError` exception, subclass of `ProtocolError`, which
73+
provides more details (see [#49](https://github.com/tcalmant/jsonrpclib/pull/49)).
74+
Thanks [@markmcclain](https://github.com/markmcclain) for this improvement.
75+
76+
## 0.4.1
77+
78+
:Release Date: 2020-04-12
79+
80+
- Fixed a size computation issue in the request handler (see #42)
81+
82+
## 0.4.0
83+
84+
:Release Date: 2019-01-13
85+
86+
- Added back support of Unix sockets on both server and client side.
87+
**Note:** HTTPS is not supported on server-side Unix sockets
88+
- Fixed the CGI request handler
89+
- Fixed the request handler wrapping on server side
90+
- Documentation is now hosted on ReadTheDocs: <https://jsonrpclib-pelix.readthedocs.io/>
91+
92+
## 0.3.2
93+
94+
:Release Date: 2018-10-26
95+
96+
- Fixed a memory leak in the Thread Pool, causing the `PooledJSONRPCServer`
97+
to crash after some uptime (see [#35](https://github.com/tcalmant/jsonrpclib/pull/35)).
98+
Thanks [@animalmutch](https://github.com/animalmutch) for reporting it.
99+
100+
101+
## 0.3.1
102+
103+
:Release Date: 2017-06-27
104+
105+
- Hide *dunder* methods from remote calls (thanks to [@MarcSchmitzer](https://github.com/MarcSchmitzer)).
106+
This avoids weird behaviours with special/meta methods (`__len__`, `__add__`, ...).
107+
See [#32](https://github.com/tcalmant/jsonrpclib/pull/32) for reference.
108+
109+
110+
## 0.3.0
111+
112+
:Release Date: 2017-04-27
113+
114+
- Handle the potentially incomplete `xmlrpc.server` package when the `future`
115+
package is used (thanks to [@MarcSchmitzer](https://github.com/MarcSchmitzer)).
116+
117+
118+
## 0.2.9
119+
120+
:Release Date: 2016-12-12
121+
122+
- Added support for enumerations (`enum.Enum` classes, added in Python 3.4).
123+
- Removed tests for `pypy3` as it doesn't work with `pip` anymore.
124+
125+
126+
## 0.2.8
127+
128+
:Release Date: 2016-08-23
129+
130+
- Clients can now connect servers using basic authentication. The server URL must be given using this format: `http://user:password@server`.
131+
- The thread pool has been updated to reflect the fixes contributed by
132+
[@Paltoquet](https://github.com/Paltoquet) for the
133+
[iPOPO](https://github.com/tcalmant/ipopo) project.
134+
135+
136+
## 0.2.7
137+
138+
:Release Date: 2016-06-12
139+
140+
- Application of the `TransportMixin` fix developed by [@MarcSchmitzer](https://github.com/MarcSchmitzer) ([#26](https://github.com/tcalmant/jsonrpclib/pull/26)).
141+
142+
143+
## 0.2.6
144+
145+
:Release Date: 2015-08-24
146+
147+
- Removed support for Python 2.6.
148+
- Added a `__repr__` method to the `_Method` class.
149+
- Project is now tested against Python 3.4 and Pypy 3 on Travis-CI.
150+
151+
152+
## 0.2.5
153+
154+
:Release Date: 2015-02-28
155+
156+
- Corrects the `PooledJSONRPCServer`.
157+
- Stops the thread pool of the `PooledJSONRPCServer` in `server_close()`.
158+
- Corrects the `Config.copy()` method: it now uses a copy of local classes
159+
and serialization handlers instead of sharing those dictionaries.
160+
161+
162+
## 0.2.4
163+
164+
:Release Date: 2015-02-16
165+
166+
- Added a thread pool to handle requests.
167+
- Corrects the handling of reused request sockets on the server side.
168+
- Corrects the `additional_header` feature: now supports different headers
169+
for different proxies (thanks to [@MarcSchmitzer](https://github.com/MarcSchmitzer)).
170+
- Adds a `data` field to error responses (thanks to [@MarcSchmitzer](https://github.com/MarcSchmitzer) and [@mbra](https://github.com/mbra)).
171+
172+
173+
## 0.2.3
174+
175+
:Release Date: 2015-01-16
176+
177+
- Added support for a custom `SSLContext` on client side.
178+
179+
180+
## 0.2.2
181+
182+
:Release Date: 2014-12-23
183+
184+
- Fixed support for IronPython.
185+
- Fixed Python 2.6 compatibility in tests.
186+
- Added logs on server side.
187+
188+
189+
## 0.2.1
190+
191+
:Release Date: 2014-09-18
192+
193+
- Return `None` instead of an empty list on empty replies.
194+
- Better lookup of the custom serializer to look for.
195+
196+
197+
## 0.2.0
198+
199+
:Release Date: 2014-08-28
200+
201+
- Code review.
202+
- Fixed propagation of configuration through `jsonclass` (thanks to [@dawryn](https://github.com/dawryn)).
203+
204+
205+
## 0.1.9
206+
207+
:Release Date: 2014-06-09
208+
209+
- Fixed compatibility with JSON-RPC 1.0.
210+
- Propagate configuration through `jsonclass` (thanks to [@dawryn](https://github.com/dawryn)).
211+
212+
213+
## 0.1.8
214+
215+
:Release Date: 2014-06-05
216+
217+
- Enhanced support for bean inheritance.
218+
219+
220+
## 0.1.7
221+
222+
:Release Date: 2014-06-02
223+
224+
- Enhanced support of custom objects (with `__slots__` and handlers), from
225+
[@dawryn](https://github.com/dawryn).
226+
See Pull requests [#5](https://github.com/tcalmant/jsonrpclib/pull/5),
227+
[#6](https://github.com/tcalmant/jsonrpclib/pull/6),
228+
[#7](https://github.com/tcalmant/jsonrpclib/pull/7).
229+
- Added tests.
230+
- First upload as a Wheel file.
231+
232+
233+
## 0.1.6.1
234+
235+
:Release Date: 2013-10-25
236+
237+
- Fixed loading of recursive bean fields (beans can contain other beans).
238+
- `ServerProxy` can now be closed using: `client("close")()`.
239+
240+
241+
## 0.1.6
242+
243+
:Release Date: 2013-10-14
244+
245+
- Fixed bean marshalling.
246+
- Added support for `set` and `frozenset` values.
247+
- Changed configuration singleton to `Config` instances.
248+
249+
250+
## 0.1.5
251+
252+
:Release Date: 2013-06-20
253+
254+
- Requests with ID 0 are not considered notifications anymore.
255+
- Fixed memory leak due to keeping history in `ServerProxy`.
256+
- `Content-Type` can be configured.
257+
- Better feeding of the JSON parser (avoid missing parts of a multi-bytes
258+
character).
259+
- Code formatting/compatibility enhancements.
260+
- Applied enhancements found on other forks:
261+
262+
- Less strict error response handling from [drdaeman](https://github.com/drdaeman/jsonrpclib).
263+
- In case of a non-predefined error, raise an `AppError` and give access
264+
to `error.data`, from [tuomassalo](https://github.com/tuomassalo/jsonrpclib).
265+
266+
267+
## 0.1.4
268+
269+
:Release Date: 2013-05-22
270+
271+
- First published version of this fork, with support for Python 3.
272+
- Version number was following the original project one

0 commit comments

Comments
 (0)