Packaging API¶
OrionTestPackage¶
A utility class for constructing Orion packages dynamically.
- class artemis.packaging.OrionTestPackage(manifest: Optional[Dict] = None, use_setup: bool = False, module_path: Optional[str] = None, validate: bool = True)¶
- add_directory(src: Union[str, bytes, os.PathLike], dest: Optional[Union[str, bytes, os.PathLike]] = None) None ¶
Copies the contents of the directory to the package directory
Default location is the top level of the package. Will create any subdirectories necessary
- add_file(src: Union[str, bytes, os.PathLike], dest: Optional[Union[str, bytes, os.PathLike]] = None) None ¶
Adds a file to the package
Default location is the top level of the package
- mkdir(path: Union[str, bytes, os.PathLike]) None ¶
Creates a directory within the package
If a path that has multiple levels is specified, it will honor the levels within the package
- package(add_hash: bool = True) str ¶
Returns the path to the generated package
- remove_directory(rel_path: Union[str, bytes, os.PathLike]) None ¶
Removes a directory from the package directory
Takes a relative path
- remove_file(rel_path: Union[str, bytes, os.PathLike]) None ¶
Removes a file from the package directory
Takes a relative path
- save(dest: Union[str, bytes, os.PathLike], add_hash: bool = True) None ¶
Method to save the package to a directory, handy for debugging the construction of your package