diff options
author | Diana Picus <diana.picus@linaro.org> | 2016-10-13 16:53:18 +0300 |
---|---|---|
committer | Diana Picus <diana.picus@linaro.org> | 2016-12-15 16:52:36 +0200 |
commit | 3b2ef824adf41d86c5371b8c8db4f74bb7ac83c0 (patch) | |
tree | 816320231faf04f54bba8e4c81517e3d7aa9d9c6 /tests/cli/__init__.py | |
parent | 250b7aa1f79ef4377c7ae3e55560849db5b5bcf9 (diff) |
[llvmprojs] Rewrite llvm-projs in python
This is the first step in moving all our scripts to python. For now we keep the
current content of the repo, but we'll start adding a new directory hierarchy
for the python stuff:
* modules: should contain most of the python code, organized as a package that
can be imported by the scripts
* scripts: the scripts themselves, which should be parsing the command line
and calling stuff from 'modules' to do the actual work; can be
broken down into the same categories we had before (helpers, bisect
etc), or we could just have one big pile
* tests: should contain unittests (for the stuff in modules) and command line
interface tests (for the scripts)
The code is heavily using functionality from the tcwg-release-tools repo (which
probably needs to be renamed / reorganized), so you should have that in your
PYTHONPATH when trying to run any of the scripts. To run the tests, just invoke
check.sh.
One of the important changes is that we'll be using python's argparse module to
parse command line flags, which means we'll have to stick to a more traditional
interface for the scripts. In particular, we can't have short options like "+c"
anymore. This isn't much of a problem, because we will keep the bash scripts as
they are and just make them invoke a tool written in python (scripts/llvm.py) to
do the work. The tool will have subcommands for any functionality that we want,
for instance the new interface for adding/removing subprojects is:
llvm.py projects [-a subproject subproject ... subproject]
[-r subproject ... subproject]
The -a and -r options (followed by any number of subprojects) can be used to
selectively enable/disable things. You have to pass the full name of the
subproject (e.g. llvmprojs.py -a clang lld -r libcxx) for it to work. This is
invoked by the llvm-projs bash script, which has the old, more convenient
interface.
For now the bash scripts will live in the same directories as they used to, but
after the transition is complete we will want to move them to the scripts
directory.
Note that we're also eliding any dashes in the names of the scripts, in keeping
with Python best practices for module names (i.e. using valid Python identifiers
as names).
Change-Id: I9ec08632dbb17464673240d6f6881a90f45d5371
Diffstat (limited to 'tests/cli/__init__.py')
-rw-r--r-- | tests/cli/__init__.py | 0 |
1 files changed, 0 insertions, 0 deletions
diff --git a/tests/cli/__init__.py b/tests/cli/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/cli/__init__.py |