| OLD | NEW |
| 1 Using the infra.git repository | 1 Using the infra.git repository |
| 2 ============================== | 2 ============================== |
| 3 | 3 |
| 4 This page supposes that infra.git has been checked out and configured. See | 4 This page supposes that infra.git has been checked out and configured. See |
| 5 :doc:`installation` for more details. | 5 :doc:`installation` for more details. |
| 6 | 6 |
| 7 Top-level commands | 7 Top-level commands |
| 8 ------------------ | 8 ------------------ |
| 9 | 9 |
| 10 - Launching ``test.py`` without any parameters runs all tests in the infra | 10 - Launching ``test.py test`` runs all tests in the infra repository in parallel,
|
| 11 repository in parallel, including those in appengine applications. | 11 including those in appengine applications. |
| 12 |
| 13 - ``run.py`` is used to run a command located inside the infra package. See |
| 14 next section for details. |
| 12 | 15 |
| 13 - Regenerating this documentation from source is achieved with ``docgen.py``. | 16 - Regenerating this documentation from source is achieved with ``docgen.py``. |
| 14 (see :doc:`documenting` for more details) | 17 (see :doc:`documenting` for more details) |
| 15 | 18 |
| 16 - ``run.py`` is used to run a command located inside the infra package. See | |
| 17 next section for details. | |
| 18 | |
| 19 Invoking tools | 19 Invoking tools |
| 20 -------------- | 20 -------------- |
| 21 | 21 |
| 22 Mixing modules and scripts in the same hierarchy can sometimes be a pain in | 22 Mixing modules and scripts in the same hierarchy can sometimes be a pain in |
| 23 Python, because it usually requires updating the Python path. The goal for | 23 Python, because it usually requires updating the Python path. The goal for |
| 24 infra.git is to be able to check out the repository and be able to run code | 24 infra.git is to be able to check out the repository and be able to run code |
| 25 right away, without setting up anything. The adopted solution is to use | 25 right away, without setting up anything. The adopted solution is to use |
| 26 __main__.py files everywhere. | 26 __main__.py files everywhere. |
| 27 | 27 |
| 28 Example: ``python -m infra.services.lkgr_finder`` will run the lkgr_finder | 28 Example: ``python -m infra.services.lkgr_finder`` will run the lkgr_finder |
| 29 script. | 29 script. |
| 30 | 30 |
| 31 To make things easier, a convenience script is located at root level. This will | 31 To make things easier, a convenience script is located at root level. This will |
| 32 do the same thing: ``run.py infra.services.lkgr_finder``. It also provides some | 32 do the same thing: ``run.py infra.services.lkgr_finder``. It also provides some |
| 33 additional goodness, like listing all available tools (when invoked without any | 33 additional goodness, like listing all available tools (when invoked without any |
| 34 arguments), and allowing for autocompletion. | 34 arguments), and allowing for autocompletion. |
| 35 | 35 |
| 36 If you want run.py to auto-complete, just run:: | 36 If you want run.py to auto-complete, just run:: |
| 37 | 37 |
| 38 # BEGIN = ZSH ONLY | 38 # BEGIN = ZSH ONLY |
| 39 autoload -Uz bashcompinit | 39 autoload -Uz bashcompinit |
| 40 bashcompinit | 40 bashcompinit |
| 41 # END = ZSH ONLY | 41 # END = ZSH ONLY |
| 42 | 42 |
| 43 eval "$(/path/to/infra/ENV/bin/register-python-argcomplete run.py)" | 43 eval "$(/path/to/infra/ENV/bin/register-python-argcomplete run.py)" |
| 44 eval "$(/path/to/infra/ENV/bin/register-python-argcomplete test.py)" | 44 eval "$(/path/to/infra/ENV/bin/register-python-argcomplete test.py)" |
| 45 | 45 |
| 46 And that's it. You may want to put that in your .bashrc somewhere. | 46 And that's it. You may want to put that in your .bashrc somewhere. |
| 47 | 47 |
| 48 | |
| 49 How it works on bots | 48 How it works on bots |
| 50 -------------------- | 49 -------------------- |
| 51 It is not checked-out on bots yet (September 2014) | 50 It is not checked-out on bots yet (September 2014) |
| OLD | NEW |