-
-
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
fs.Digest is declared in Rust #10905
Changes from all commits
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 |
---|---|---|
|
@@ -23,7 +23,10 @@ python_integration_tests( | |
|
||
python_library( | ||
name='native', | ||
sources=['native.py'], | ||
sources=[ | ||
'native.py', | ||
'native_engine.pyi', | ||
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. Woot! This is exciting to see used. |
||
], | ||
dependencies=[ | ||
':native_engine', | ||
], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
from pants.base.exiter import ExitCode | ||
from pants.engine.fs import PathGlobs | ||
from pants.engine.internals import native_engine | ||
from pants.engine.internals.native_engine import ( # type: ignore[import] | ||
from pants.engine.internals.native_engine import ( | ||
PyExecutionRequest, | ||
PyExecutionStrategyOptions, | ||
PyExecutor, | ||
|
@@ -71,18 +71,18 @@ def generator_send( | |
if isinstance(res, Get): | ||
# Get. | ||
return PyGeneratorResponseGet( | ||
res.output_type, | ||
res.input_type, | ||
res.input, | ||
product=res.output_type, | ||
declared_subject=res.input_type, | ||
subject=res.input, | ||
) | ||
elif type(res) in (tuple, list): | ||
# GetMulti. | ||
return PyGeneratorResponseGetMulti( | ||
tuple( | ||
gets=tuple( | ||
PyGeneratorResponseGet( | ||
get.output_type, | ||
get.input_type, | ||
get.input, | ||
product=get.output_type, | ||
declared_subject=get.input_type, | ||
subject=get.input, | ||
Comment on lines
+83
to
+85
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. Hm, fine to not fix, but I thought I had fixed most of the Rust code to call this |
||
) | ||
for get in res | ||
) | ||
|
@@ -94,7 +94,7 @@ def generator_send( | |
raise | ||
# This was a `return` from a coroutine, as opposed to a `StopIteration` raised | ||
# by calling `next()` on an empty iterator. | ||
return PyGeneratorResponseBreak(e.value) | ||
return PyGeneratorResponseBreak(val=e.value) | ||
|
||
|
||
class RawFdRunner(Protocol): | ||
|
@@ -211,11 +211,11 @@ def new_session( | |
session_values: SessionValues, | ||
) -> PySession: | ||
return PySession( | ||
scheduler, | ||
dynamic_ui, | ||
build_id, | ||
should_report_workunits, | ||
session_values, | ||
scheduler=scheduler, | ||
should_render_ui=dynamic_ui, | ||
build_id=build_id, | ||
should_report_workunits=should_report_workunits, | ||
session_values=session_values, | ||
) | ||
|
||
def new_scheduler( | ||
|
@@ -266,20 +266,23 @@ def new_scheduler( | |
local_enable_nailgun=execution_options.process_execution_local_enable_nailgun, | ||
) | ||
|
||
return self.lib.scheduler_create( | ||
self._executor, | ||
tasks, | ||
types, | ||
# Project tree. | ||
build_root, | ||
local_store_dir, | ||
local_execution_root_dir, | ||
named_caches_dir, | ||
ca_certs_path, | ||
ignore_patterns, | ||
use_gitignore, | ||
remoting_options, | ||
exec_stategy_opts, | ||
return cast( | ||
PyScheduler, | ||
self.lib.scheduler_create( | ||
self._executor, | ||
tasks, | ||
types, | ||
# Project tree. | ||
build_root, | ||
local_store_dir, | ||
local_execution_root_dir, | ||
named_caches_dir, | ||
ca_certs_path, | ||
ignore_patterns, | ||
use_gitignore, | ||
remoting_options, | ||
exec_stategy_opts, | ||
), | ||
) | ||
|
||
def set_panic_handler(self): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from typing import Any | ||
|
||
# TODO: black and flake8 disagree about the content of this file: | ||
# see https://github.com/psf/black/issues/1548 | ||
# flake8: noqa: E302 | ||
|
||
class PyDigest: | ||
def __init__(self, fingerprint: str, serialized_bytes_length: int) -> None: ... | ||
@property | ||
def fingerprint(self) -> str: ... | ||
@property | ||
def serialized_bytes_length(self) -> int: ... | ||
|
||
class PyExecutionRequest: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
||
class PyExecutionStrategyOptions: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
||
class PyExecutor: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
||
class PyGeneratorResponseBreak: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
||
class PyGeneratorResponseGet: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
||
class PyGeneratorResponseGetMulti: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
||
class PyNailgunServer: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
||
class PyRemotingOptions: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
||
class PyScheduler: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
||
class PySession: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
||
class PyTasks: | ||
def __init__(self, **kwargs: Any) -> None: ... | ||
|
||
class PyTypes: | ||
def __init__(self, **kwargs: Any) -> None: ... |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ authors = [ "Pants Build <[email protected]>" ] | |
publish = false | ||
|
||
[dependencies] | ||
byteorder = "1.3" | ||
digest = "0.9" | ||
generic-array = "0.14" | ||
hex = "0.3.1" | ||
|
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.
s/set/get/ ?