compile.vyper
Module¶
The compile.vyper
module
Vyper utilities
-
solidbyte.compile.vyper.
dirs_in_dir
(searchpath)[source]¶ Return a list of all child directories of a directory
Parameters: searchpath – ( pathlib.Path
) The Path of a directory to searchReturns: ( list
) A list of paths of each child directory
-
solidbyte.compile.vyper.
is_bodyless_func
(func_text)[source]¶ Identify if a code block is a bodyless/interface function
Parameters: func_text – ( str
) The source code for a functionReturns: ( str
) If the function is “bodyless”. (empty or onlypass
)
-
solidbyte.compile.vyper.
is_vyper_interface
(source_text)[source]¶ Identify if the provided source text is a vyper interface
Parameters: source_text – ( str
) The full source codeReturns: ( bool
) If the provided source code is a Vyper interface
-
solidbyte.compile.vyper.
source_extract
(source_text, start_ln, end_ln)[source]¶ Extract a section of source code given start and end line numbers.
Parameters: - source_text – (
str
) The full source code - start_ln – (
int
) The start line number - end_ln – (
int
) The end line number
Returns: (
str
) The source code snippet- source_text – (
-
solidbyte.compile.vyper.
vyper_funcs_from_source
(source_text)[source]¶ Generate an AST and pull all function defs from it
Parameters: source_text – ( str
) The full source codeReturns: ( list
) The source code definition of the functions
-
solidbyte.compile.vyper.
vyper_import_to_file_paths
(workdir, importpath)[source]¶ Resolve a Vyper import path to a file
Parameters: - workdir – (
pathlib.Path
) The Path to a directory to search - importpath – (
str
) The vyper import statement to resolve
Returns: (
pathlib.path
) The Path to the file the import resolves to- workdir – (