-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat(restapi): added signature analysis workflow endpoint & tests #719
base: dev
Are you sure you want to change the base?
Conversation
plugin function signatures
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.
Want to have a discussion to make sure we are capturing the types how we want in the output.
json_={"filename": filename, "fileContents": fileContents}, | ||
) | ||
|
||
def signature_analysis_file(self, filename: str) -> T: |
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.
instead of having separate methods, can we overload a single method and either read from file or from contents depending on which args are passed?
This was the guidance James gave me for my import workflow. See here for an example:
dioptra/src/dioptra/client/workflows.py
Line 96 in 16d3401
@overload |
Function signature information data structures, as dicts | ||
""" | ||
if filepath: | ||
ast = ast_module.parse(python_source, filename=filepath, feature_version=(3, 9)) |
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.
Change to feature_version=sys.version_info[0:2]
so this stays current to the version of python we are using.
We are currently using 3.11 in the worker containers if for some reason we don't want to stick to the version of python being used to run the function.
if filepath: | ||
ast = ast_module.parse(python_source, filename=filepath, feature_version=(3, 9)) | ||
else: | ||
ast = ast_module.parse(python_source, feature_version=(3, 9)) |
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.
same as line 687
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.
why are these files in examples showing as changed?
@@ -78,3 +83,36 @@ def get(self): | |||
mimetype=mimetype[parsed_query_params["file_type"]], | |||
download_name=download_name[parsed_query_params["file_type"]], | |||
) | |||
|
|||
|
|||
@api.route("/signatureAnalysis") |
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.
do we want to be more descriptive with the endpoint name? taskPluginSignatureAnalysis
?
would need the same change in the client.
Closes #691