Commit ce1ba1d
committed
Enhance P3 implementation and remove NuoDB Agent support
Since NuoDB 4.2 we no longer support NuoDB Agent and only support
nuoadmin for our administration layer. Remove the integration with
NuoDB Agent from the pynuodb module.
Additionally a lot of other work was done:
Add support for direct NuoDB TE connections, using the 'direct'
connection parameter.
Add mypy and pylint checking. Provide Makefile targets to run Mypy and
Pylint on the codebase. Provide a pylintrc file. Improve the code to
satisfy these checkers.
Since we still support Python2, we use the comment-based type:
decorators instead of Python 3 inline type definitions for mypy.
We could switch to .pyi files but I didn't do that.
Enhance the exceptions to more closely align with PEP 249, and add
proper docstrings. Document the BatchError and EndOfStream special
exceptions.
Add PEP 249 standard Connection.autocommit and setautocommit() and
deprecate the non-standard auto_commit. Also support an 'autocommit'
argument to the connect() method.
Align the types of elements and clean up the Python 3 support. We do
this by settling on using the bytearray type for message creation and
storage on both P2 and P3, rather than converting to/from latin-1 etc.
I wanted to use bytes which would be a better fit for at least received
messages, but this is difficult in Python2 because str and bytes are
essentially the same type which means we'd need to do a lot of special
handling if we were running P2.
Most of the P2 vs. P3 differences are encapsulated in the crypto
library, where we have methods to convert from bytes to a
bytearray and from a bytearray to a str. Using bytearray allows the
implementations of methods like toByteString and fromByteString to be
the same between P2 and P3.
Modify the datatype.Binary object to inherit from bytes. For backward-
compatibility, preserve the string data member and __str__().
Use integer comparison for encodedsession rather than range(), and make
more use of protocol values and less of magic numbers. Create some
simplifying helper methods.
Keep latin-1 encoding when we want to treat strings as lists of bytes,
but choose utf-8 encoding for XML etc.
Modify tests to be more correct, and add a test of Session.authorize()
and performing Engine requests.1 parent 059b731 commit ce1ba1d
File tree
27 files changed
+2379
-3175
lines changed- .circleci
- pynuodb
- test-performance
- tests
27 files changed
+2379
-3175
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
14 | 23 | | |
15 | 24 | | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
21 | | - | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
29 | 43 | | |
30 | 44 | | |
31 | 45 | | |
| |||
41 | 55 | | |
42 | 56 | | |
43 | 57 | | |
| 58 | + | |
44 | 59 | | |
45 | 60 | | |
46 | 61 | | |
47 | | - | |
| 62 | + | |
48 | 63 | | |
49 | 64 | | |
50 | 65 | | |
51 | 66 | | |
52 | 67 | | |
53 | 68 | | |
54 | 69 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
62 | | - | |
| 73 | + | |
0 commit comments