-
-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[internal] Switch from Rust-Cpython to PyO3 #13526
Changes from 34 commits
ea2332e
0c8359a
91d90c7
01bf069
ee2ff66
3bdbab0
0e9a741
766778d
1e88c1e
108c231
5a5d3f0
96cfc9e
830d1bb
5c15528
ac808c4
192839d
7ed8843
ed423a6
615b3f3
0065c6a
b413cc8
a94bcf5
7ee2abd
47d204e
56d72e2
e3c4ae5
0dae5ef
dfc015a
483c601
2556a9e
25f5ccc
07db0de
c82b723
fff36c3
a04dc32
ce63e69
8082056
0a3d421
eaf83b1
38c8b6e
b718f9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ class RawFdRunner(Protocol): | |
command: str, | ||
args: tuple[str, ...], | ||
env: dict[str, str], | ||
working_directory: bytes, | ||
cancellation_latch: PySessionCancellationLatch, | ||
stdin_fileno: int, | ||
stdout_fileno: int, | ||
|
@@ -149,6 +148,9 @@ class PyDigest: | |
def fingerprint(self) -> str: ... | ||
@property | ||
def serialized_bytes_length(self) -> int: ... | ||
def __eq__(self, other: PyDigest | Any) -> bool: ... | ||
def __hash__(self) -> int: ... | ||
def __repr__(self) -> str: ... | ||
|
||
class PySnapshot: | ||
def __init__(self) -> None: ... | ||
|
@@ -162,6 +164,9 @@ class PySnapshot: | |
def dirs(self) -> tuple[str, ...]: ... | ||
@property | ||
def files(self) -> tuple[str, ...]: ... | ||
def __eq__(self, other: PySnapshot | Any) -> bool: ... | ||
def __hash__(self) -> int: ... | ||
def __repr__(self) -> str: ... | ||
Comment on lines
+167
to
+169
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When is it necessary to declare these? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not strictly necessary. MyPy was not complaining about anything, I was being proactive so users of this API know what is expected to work without having to look at Rust code. I believe Wdyt? Too noisy? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If not necessary, would leave them off probably. But doesn't really matter. |
||
|
||
class PyExecutionRequest: | ||
def __init__( | ||
|
@@ -184,7 +189,7 @@ class PyGeneratorResponseGetMulti: | |
def __init__(self, gets: tuple[PyGeneratorResponseGet, ...]) -> None: ... | ||
|
||
class PyNailgunServer: | ||
pass | ||
def port(self) -> int: ... | ||
|
||
class PyRemotingOptions: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -469,12 +469,12 @@ def execute( | |
|
||
states = [ | ||
Throw( | ||
raw_root.result(), | ||
python_traceback=raw_root.python_traceback(), | ||
engine_traceback=raw_root.engine_traceback(), | ||
raw_root.result, | ||
python_traceback=raw_root.python_traceback, | ||
engine_traceback=raw_root.engine_traceback, | ||
Comment on lines
-472
to
+474
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was able to avoid a lot of boilerplate by making these properties. PyO3 lets you do this: #[pyclass]
struct Foo {
#[pyo3(get)]
v: String,
} |
||
) | ||
if raw_root.is_throw() | ||
else Return(raw_root.result()) | ||
if raw_root.is_throw | ||
else Return(raw_root.result) | ||
for raw_root in raw_roots | ||
] | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was unused and its type conversion was wrong with cpython, so it was easier to delete than port.