Archives and Version Control Systems¶
If you have your programs in a git archive, you can use
GitArchive as input parameter and build
the software every time from scratch in order to have a clean
enviroment for the experiment. Similar you can use a tar achive for
this purpose.
-
class
versuchung.archives.GitArchive(clone_url=None, ref='refs/heads/master', shallow=False)[source]¶ Can be used as: input parameter
The git repository given in
clone_urlwill be cloned to a temporary directory. It will be removed after the experiment is over. Ifshallow == TrueOnly the files and not the .git is copied (cloned). This is especially useful for large git repositories like the Linux kernel tree.clone_urlcan either be astringor any object that has a.pathattribute (like e.g.TarArchive). Of course the refenced path must be a directory.This parameter can be used as argument to the with keyword, to change to the temporary directory:
with self.inputs.git_archive as path: # Here we have path == os.path.abspath(os.curdir) # Do something in the extracted copy print path
-
path¶ Return the string to the extract directory (same as .value.path)
-
value¶ Return a
versuchung.files.Directoryinstance to the cloned git directory
-
-
class
versuchung.archives.TarArchive(filename=None)[source]¶ Can be used as: input parameter
The archive will be extracted to a temporary directory. It will be removed after the experiment is over.
clone_urlcan either be astringor any object that has a.pathattribute (like e.g.File). Of course the referenced file must be a single file.This parameter can be used as argument to the with keyword, to change to the temporary directory:
with self.inputs.tar_archive as path: # Here we have path == os.path.abspath(os.curdir) # Do something in the extracted copy print path
-
path¶ Return the string to the extract directory (same as .value.path)
-
value¶ Return a
versuchung.files.Directoryinstance to the extracted tar archive. If it contains only one directory the instance will point there. Otherwise it will point to a directory containing the contents of the archive
-