= Dependencies

There 3 ways to declare dependencies:

. `[project.dependencies]` in `pyproject.toml`
. `[tool.addon-odoo-wheel.dependencies]` in `pyproject.toml`
. `[tool.addon-odoo-wheel.dependencies-file]` in `pyproject.toml`

{page-component-name} will tool in that order and stop at the first one found.

IMPORTANT: You can't use more than one option, an error will occur in that case.

NOTE: By default if a `requirements.txt` file is found in the addon directory then it will be used. See <<default_behavior>>

== With `[project.dependencies]`

.pyproject.toml
[source,toml]
----
# ... build system

[project]
name = "my-awesome-odoo-module"
dynamic = ["version"]
dependencies = [
    "httpx>=0.28",
]
----

== With `[tool.addon-odoo-wheel.dependencies]`

.pyproject.toml
[source,toml]
----
# ... build system

[tool.addon-odoo-wheel]
dependencies = [
    "httpx>=0.28",
]
----

== With `[tool.addon-odoo-wheel.dependencies]`

.pyproject.toml
[source,toml]
----
# ... build system

[tool.addon-odoo-wheel]
dependencies-file = "requirements.txt" # <1>
----
<1> Path to your requirements.txt file. Can be relative to the `pyproject.toml`

[[default_behavior]]
== Default behavior

By default, if none of

- `[project.dependencies]`
- `[tool.addon-odoo-wheel.dependencies]`
- `[tool.addon-odoo-wheel.dependencies-file]` is

set in the `pyproject.toml` *and* a `requirements.txt` file is found in the addon's directory then this file will be used.

.Content of the module
[,txt]
----
.
├── __init__.py
├── __manifest__.py
├── pyproject.toml
├── README.rst
└── requirements.txt <1>
----
<1> The content of this file will be used as dependencies

.pyproject.toml
[,toml]
----
[build-system]
requires = ["addon-odoo-wheel"]
build-backend = "addon_odoo_wheel.builder"
----
