hatch-odoo
A hatch(ling) plugin to work with projects containing Odoo addons. This tool will help you package a project containing Odoo addons so it can be installed with pip:
- automatically generates dependencies based on Odoo addons manifests,
- package addons into the odoo/addons namespace independently of the source project layout,
- install the addons in editable mode without fiddling with
--addons-path,
💡 This project is best used when working with end-customer projects. To package individual reusable addons, consider the whool project.
Table of Contents
Quick start
Assuming you have a project containing your awesome Odoo addons at the root of your
project repository, you can set it up by creating a pyproject.toml file like so.
# Use the hatchling build backend, with the hatch-odoo plugin.
[build-system]
requires = ["hatchling", "hatch-odoo"]
build-backend = "hatchling.build"
[project]
name = "MyAwesomeProject"
version = "1.0"
readme = "README.md"
requires-python = ">=3.8"
# Dependencies are dynamic because they will be generated from Odoo addons manifests.
dynamic = ["dependencies"]
# Enable the hatch-odoo metadata hook to generate dependencies from addons manifests.
[tool.hatch.metadata.hooks.odoo-addons-dependencies]
# Enable the hatch-odoo build hook to package the Odoo addons into odoo/addons.
[tool.hatch.build.hooks.odoo-addons-dirs]
[tool.hatch-odoo]
# If our addons have non standard version numbers, let's help hatch-odoo discover the Odoo version.
odoo_version_override = "15.0"
# Let's add additional dependencies that are not declared in addons manifests.
dependencies = ["click-odoo-contrib"]
# Our addons are in the project root directory.
addons_dirs = ["."]
You can then install it in editable mode, together with its dependencies in a virtual environment with a procedure like this:
# python3 -m venv .venv
# source .venv/bin/activate
# pip install --upgrade pip setuptools wheel
# pip install -r https://raw.githubusercontent.com/odoo/odoo/15.0/requirements.txt
# pip install -e git+https://github.com/odoo/odoo@15.0
# pip install -e .
# odoo
All dependencies (such as OCA addons and external dependencies) declared in your project addons manifests will be downloaded and installed from PyPI automatically.
There is no need to configure the Odoo addons path: since addons are installed in
odoo/addons, the regular Python import machinery works out of the box
You can then pin dependencies for reproducibility with pip freeze or other tools.
pip-deepfreeze is known to work well with
git URLs, but other tools such as pip-tools, may work as well.
Alternative project layouts
Depending on your taste and requirements, there are several alternative ways to
organize your source code. The test projects in
tests/data each have a
README that describe the layout and corresponding tradeoffs, with the corresponding
pyproject.toml.
License
hatch-odoo is distributed under the terms of the MIT license.
Metadata
Release files for hatch-odoo 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hatch_odoo-1.0.2.tar.gz | 10.4 kB | Without provenance | Details for hatch_odoo-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hatch_odoo-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for hatch_odoo-1.0.2-py3-none-any.whl |
Total release size: 18.1 kB
Release files / hatch_odoo-1.0.2.tar.gz
| Download URL | hatch_odoo-1.0.2.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32ee77ebb85c5ec8ab965d51db651885565f141e495d4bc377df7ac1807cc2a3
|
|
BLAKE2b-256 checksum How to use checksums |
f5561e67994e8212b0881a27741a087835780ef8ae023f26b23780161127639d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.4
|
Release files / hatch_odoo-1.0.2-py3-none-any.whl
| Download URL | hatch_odoo-1.0.2-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49f719578aaf95ba0d8c33e35e9974ef25b5f162ac06fb00b6e109bc0b87dcb6
|
|
BLAKE2b-256 checksum How to use checksums |
df89d7c6336a06045900e91f74f6ab7d033600dd893057559e8f1700fd97a69f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.4
|
Security for hatch-odoo 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.