compile.vyper Module

The compile.vyper module

Vyper utilities


Return a list of all child directories of a directory

Parameters:searchpath – (pathlib.Path) The Path of a directory to search
Returns:(list) A list of paths of each child directory

Identify if a code block is a bodyless/interface function

Parameters:func_text – (str) The source code for a function
Returns:(str) If the function is “bodyless”. (empty or only pass)

Identify if the provided source text is a vyper interface

Parameters:source_text – (str) The full source code
Returns:(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.

  • source_text – (str) The full source code
  • start_ln – (int) The start line number
  • end_ln – (int) The end line number

(str) The source code snippet


Generate an AST and pull all function defs from it

Parameters:source_text – (str) The full source code
Returns:(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

  • workdir – (pathlib.Path) The Path to a directory to search
  • importpath – (str) The vyper import statement to resolve

(pathlib.path) The Path to the file the import resolves to