aboutsummaryrefslogtreecommitdiff
path: root/python/arti_rpc
Commit message (Collapse)AuthorAgeFilesLines
* typo fixes from @jnewsomeNick Mathewson2026-03-231-4/+4
|
* rpc: Python wrappers (and tests) for pollable FFI.Nick Mathewson2026-03-232-1/+255
| | | | | This provides an API and tests for create_polling(), poll(), and related APIs.
* rpc: Add pythonic wrappers nonblocking requests.Nick Mathewson2026-03-231-1/+174
| | | | | | | These wrappers present a "pythonic" API to the C functions for submit and wait. Tests included.
* rpc: Add python ctypes wrappers for new FFI functions.Nick Mathewson2026-03-231-11/+82
| | | | | These are low-level wrappers that let us call the relevant C code, but are not suitable for general use.
* python rpc: Add wrapper for prefer-superuser method.Nick Mathewson2026-03-162-0/+22
|
* python rpc wrapper: Use socket types that work on windows.Nick Mathewson2026-01-121-2/+3
| | | | | | | | | Previously we were using c_int unconditionally, which works everywhere else. Closes #2305. Co-Authored-By: Carti
* rpc.py: fix formattingJim Newsome2025-09-151-1/+1
|
* doc: Remove dead reference to rpc_demo.pyClara Engler2025-04-011-9/+0
| | | | It was removed in 08847ab290a8d554ccf18e49b3de3abe7d6be9f2.
* Merge branch 'rpc_document_internal_optimism' into 'main'Nick Mathewson2025-01-301-6/+0
|\ | | | | | | | | | | | | rpc: Document what is actually going on with stream optimism. Closes #1583 See merge request tpo/core/arti!2753
| * rpc: Correct API documentation about optimismNick Mathewson2025-01-301-6/+0
| | | | | | | | | | | | | | | | | | | | | | Our documentation had dated to an older version of our RPC stream code, where all streams were automatically optimistic. But as explained, our use of "optimistic"ness in RPC stream code is now purely internal, to make it possible to get an DataStreamCtrl. This isn't user-visible in our rpc_conn_open_stream code. Closes #1583
* | fix: fix typosDimitris Apostolou2025-01-301-1/+1
|/
* rpc.py: Copy stream caveats.Nick Mathewson2025-01-291-2/+20
|
* rpc.py: New preamble documentNick Mathewson2025-01-291-3/+6
|
* python rpc: Add support for cancelling requests.Nick Mathewson2025-01-222-2/+30
|
* python rpc: Document with_meta arguments.Nick Mathewson2025-01-221-0/+3
|
* python rpc: Expose an ArtiRpcObject for the "connection" object.Nick Mathewson2025-01-221-0/+11
|
* fix: fix typosDimitris Apostolou2025-01-061-2/+2
|
* ffi.py: Resolve newer mypy warning.Nick Mathewson2025-01-051-5/+5
|
* artilib: Revise C and Python APIs for builders.Nick Mathewson2024-12-093-14/+142
| | | | | | | | | | | | | | | Expose ArtiRpcConnBuilder and appropriate C wrapper functions in our FFI code, and wrap those functions in our python wrapper. This breaks the old C API, but that's allowed since the API is still experimental. Some design decisions: * I've wrapped the builder in a Mutex, so that we can continue our FFI rule that we do not require non-Rust code to wrap `&mut`. * I've removed the non-builder connect() function from the C API as extraneous. * I've made a single function to prepend elements to the search path.
* python: Fix warnings about unused variables and modules.Nick Mathewson2024-10-242-2/+2
|
* Remove obsolete "rpc_demo.py"Nick Mathewson2024-10-241-24/+0
| | | | | | It no longer reflects our current API, refers to no-longer-extant bugs, and was never a terribly good example of what you were supposed to do with RPC.
* Run "black" to reformat all our pythonNick Mathewson2024-10-243-39/+64
| | | | | | | | | | | | | | | | | "Black" is an "opinionated" python formatter, whose opinionatedness is somewhat in the spirit of rustfmt. This MR runs black with default settings on all of our python code in Arti. It was produced by the following commands ``` # Everything in python/ black python/ # Everything with a .py extension fd '.py$' -X black # Everything with a python shebang. git grep -l '#! */usr/bin/env *python' | xargs black ```
* python: Use logging to report nonfatal errors.Nick Mathewson2024-10-231-2/+5
|
* python: Automatically release RPC objects on __del__Nick Mathewson2024-10-231-3/+31
|
* python rpc: Avoid sneaky use-after-free errors.Nick Mathewson2024-10-231-4/+10
| | | | | | After calling a `foo_free()` method on a ctypes pointer object, we now set that pointer to None, so that we cannot inadvertently pass the freed pointer to anything else.
* python: Enforce that a response has just one type.Nick Mathewson2024-10-211-3/+13
|
* Typo fixes from @jnewsomeNick Mathewson2024-10-221-2/+2
|
* python: Expose RPC status code from errors.Nick Mathewson2024-10-212-1/+47
|
* python: Rename connect to open_stream, for consistency.Nick Mathewson2024-10-211-1/+1
|
* python: avoid redundant error messages.Nick Mathewson2024-10-211-1/+4
|
* python: remove an unused importNick Mathewson2024-10-211-1/+0
|
* python: Return "stream" as an object.Nick Mathewson2024-10-211-3/+4
| | | | Make the return type from connect() more sensible.
* python: Provide a sensible way to set metaparams in requestsNick Mathewson2024-10-211-2/+22
|
* python: Decode JSON in rpc responses more aggressivelyNick Mathewson2024-10-212-20/+88
| | | | | | | | | | | This tweaks the APIs to return a dict in cases where we know that we are getting a result, and to return an ArtiRpcResponse in cases where we don't know what kind of response we're getting. It also expands our Error objects to support decoding. Rationale: everybody who is using this libaray will want to decode the json objects that they receive. By doing it in the library, we can save them some annoyance.
* python: Allow execute methods to accept dictsNick Mathewson2024-10-211-2/+18
| | | | | Previously, they only took strings, which sometimes required the caller to use json.
* python: fix a return type annotation.Nick Mathewson2024-10-171-1/+1
| | | | (Found while writing a test.)
* python: Note two methods which will need new argsNick Mathewson2024-10-101-0/+2
|
* python: Use mypy option for cleaner code wrt rebinding.Nick Mathewson2024-10-031-11/+24
|
* python: Fix annotation typo.Nick Mathewson2024-10-031-1/+1
|
* python: Remove TODO about WinDLLNick Mathewson2024-10-031-5/+0
| | | | | | @opara says that we'll want to have our API functions be `extern "C"` everywhere, and so `ctypes.CDLL` should work fine for them on Windows. This sounds good to me.
* python: annotate CDLL-related functionsNick Mathewson2024-10-031-16/+11
| | | | This, incidentally, turned up a repeated mistake in the code.
* python: Remove todos about annotating "params"Nick Mathewson2024-10-031-2/+0
| | | | | Since params can be "anything encodeable to json", there isn't a lot of point in restricting its type.
* python: Prefer Optional over Union.Nick Mathewson2024-10-031-4/+4
|
* python: Type-annotate rpc.pyNick Mathewson2024-10-012-38/+66
| | | | | | | | | | | | | | | This has required a few code changes and turned up a few bugs. The type annotations pass with `mypy`. Notable code changes: With type annotations, variable assignment may no longer change the type of a variable. (I disagree with these semantics, but here we are.) Note that some TODOs remain: I have no clear sense how to annotate the library type from `ctypes`, and better wrappers are needed in some cases.
* python: Add minimal annotations for "mypy" to pass.Nick Mathewson2024-10-011-4/+6
|
* Python: Use the correct library extension on osx, windows.Nick Mathewson2024-09-301-2/+11
| | | | (The windows case is untested; the osx case worked fine.)
* python/arti_rpc: Add an initial pyproject.tomlNick Mathewson2024-09-261-0/+23
| | | | | I've tried "python -m build" to make sure it works; haven't tested anything else.
* python: Move arti_rpc package into new subdirectoryNick Mathewson2024-09-265-0/+72
| | | | | This will make it easier to add other Python packages in the future as needed.
* Python: Add a pythonic wrapper for arti-rpc-client-coreNick Mathewson2024-09-262-0/+339
| | | | | This module tries to provide a set of APIs more closely resembling those you'd expect to use in a real python program.
* Python: Add a ctypes wrapper for arti-rpc-client-coreNick Mathewson2024-09-261-0/+191
This wrapper uses Python's `ctypes` module to wrap the APIs from `arti-rpc-client-core`. It needs more work on Windows (and likely MacOS too), but that will come later. This is not a suitable API for direct use in Python.