This guide is for hacking on osh itself. If you want to use osh to manage an
Odoo project, see README.md. If you want to extend osh with plugins, see
PLUGINS.md.
- Python 3.8 or later
gitpipandvenv
Clone the repository and install osh in editable mode inside a virtual
environment:
git clone https://github.com/dreis/osh.git
cd osh
python3 -m venv .venv
source .venv/bin/activate
pip install -e .After the install the osh console script is available. To guarantee you are
using the source code in this directory, run osh via the module:
python -m osh --help
python -m osh versionosh is a regular Click application. The entry point is osh/cli.py and the
root group is osh.cli:main. Use python -m osh from the repo root to run the
latest code without reinstalling the package.
Common commands that do not require an Odoo project:
python -m osh --help
python -m osh version
python -m osh plug listCommands such as init, odoo, doctor, config, and test need an
initialized Osh project. To exercise those, create a temporary project as
described in README.md.
Install the test dependencies and run the osh test suite with pytest:
pip install pytest
python -m pytestRun a specific test file or test:
python -m pytest tests/test_init.py
python -m pytest tests/test_init.py -k test_sh_includes_themesThe project uses pre-commit to keep code formatted and linted. Install and
run the hooks locally before committing:
pip install pre-commit
pre-commit run --all-files