Skip to content

Commit

Permalink
πŸš‘ Fix Python package Names in Odoo __manifest__.py
Browse files Browse the repository at this point in the history
Some Packages are for whatever reason not named as they should be in the manifests.
Example would by "ldap".
When trying to `pip install ldap` you'll get:
```
 # `ldap` on PyPI
      This dummy project is not installable.
      You probably want `python-ldap` instead.
```
  • Loading branch information
joshkreud committed Feb 29, 2024
1 parent 3eea9c7 commit 61f7312
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/godoo_cli/helpers/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ def typer_ask_overwrite_path(paths: Union[List[Path], Path]) -> bool:

def pip_install(package_names: List[str]):
"""Ensure Pip Package is installed. But only when not already installed."""

# Some packages have different names on pypi and in odoo Manifests. Key is Odoo manigest, Value is pypi
odoo_wrong_pkg_names = {
"ldap": "python-ldap",
}
package_names = [odoo_wrong_pkg_names.get(p, p) for p in package_names]

LOGGER.debug("Ensuring Pip Packages are installed:\n%s", package_names)
installed_packages = run_cmd(
f"{sys.executable} -m pip list --format json --disable-pip-version-check",
Expand Down

0 comments on commit 61f7312

Please sign in to comment.