Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

The inv command

(1) There is another command that you should learn now: inv.

(2) The inv command comes from the invoke Python package, which is required by atelier, which was installed when you installed your developer environment.

inv

Run one of the development tasks available for this repository.

(3) You can say inv -l to see a list of available tasks:

$ inv -l
Available tasks:

  bd               Build docs. Build all Sphinx HTML doctrees for this project.
  blog             Edit today's blog entry, create an empty file if it doesn't yet exist.
  check            Check configuration integrity.
  ci               Checkin and push to repository, using today's blog entry as commit message.
  clean            Remove temporary and generated files.
  cov              Run all tests and create a coverage report.
  ct               Print all today's commits to stdout.
  install          Install required Python packages to your Python environment and/or
  mm               Extract messages, then initialize and update all catalogs.
  pd               Publish docs. Upload docs to public web server.
  pepper           Run PEP formatting and checking.
  prep             Run preparation tasks that need to run before testing.
  pull             Pull latest changes, including those from upstream if there is one.
  readme           Generate or update `README.txt` or `README.rst` file from `SETUP_INFO`.
  register         Register this project (and its current version) to PyPI.
  release          Publish a new version to PyPI.
  run              Run a given python script on all the demo projects.
  sdist            Create a source distribution.
  test             Run the test suite of this project.
  test-sdist       Install a previously created sdist into a temporary virtualenv and
  updatefixtures

(4) The inv command looks for a tasks.py file in the current directory. Every Lino repository has such a tasks.py file in its root directory. The tasks.py file is comparable to a Makefile or a package.json, it defines instructions that are run using the inv command.

(5) Note the difference between inv prep and the pm prep command. inv prep runs the pm prep command for each demo project of a repository. The demo projects of a repository are declared in the tasks.py file. You can run the pm prep command for all demo projects by going to the root directory of the book project and saying inv prep:

$ go book   # alias for: cd ~/lino/env/repositories/book
$ inv prep

Examples

(6) Download the latest version of Lino:

$ go lino
$ git pull

(7) Run the full test suite in Developer Guide:

$ go book
$ inv prep test

(inv prep test is equivalent to inv prep followed by inv test.)

(8) Build a local copy of the Lino Developer Guide:

$ go book
$ inv bd

(9) Afterwards you can start your browser on the generated output:

$ python -m webbrowser docs/.build/index.html

(10) Building the docs might not work out of the box, it is a topic of its own. Don’t worry too much about it right now, but if you are curious, have a look at Building the Lino docs.