Skip to main content

A command-line tool for managing Odoo dependencies.

Project description

bl

CI codecov

Why BL

Because ak is a bit slow and I was tired of waiting around

Install

You need Python >= 3.12.

pipx install bl-odoo

Usage

For all those command bl will try to look in the current directory. If it does find the spec file it will try to look in the child odoo directory. (i.e. you can launch bl in the root of you project) You can also override the default paths and verbosity with:

  • -c/--config: path to the project spec file (default: spec.yaml)
  • -z/--frozen: path to the frozen spec file (default: frozen.yaml)
  • -o/--config-override: path to an override config to extend the project specification
  • -j/--concurrency: number of concurrent tasks (default: 28)
  • -b/--use-bindfs: use bindfs instead of creating symlinks (requires user_allow_other in /etc/fuse.conf)
  • -w/--workdir: working directory, defaults to the directory of --config
  • -N/--no-check-version: do not check PyPI for a newer BL version before running
  • --log-level: one of DEBUG, INFO, WARNING, ERROR, CRITICAL (default: WARNING)

Per-project config is stored in $XDG_CONFIG_HOME/bl/<project>/config.ini. Git commands run without terminal prompts, so credentials for private repos must already be configured.

Build

bl build [-c PATH_TO_SPEC] [-z PATH_TO_FROZEN] [-o CONFIG_OVERRIDE] [-j CONCURRENCY] [-b/--use-bindfs] [-w WORKDIR] [-N/--no-check-version] [--log-level LEVEL]

What does it do

It does what ak build does. Managed repos get a BL pre-commit hook to avoid accidental commits. Repos marked editable are skipped.

Params

  • PATH_TO_SPEC path to your spec (default: spec.yaml)
  • PATH_TO_FROZEN path to your frozen spec (default: frozen.yaml)
  • CONFIG_OVERRIDE path to an override config to extend the project specification
  • CONCURRENCY number of module clone simultaneously (default: 28)
  • --use-bindfs use bindfs instead of creating symlinks (requires user_allow_other in /etc/fuse.conf)
  • WORKDIR working directory; if omitted, the directory containing spec.yaml
  • --no-check-version skip the PyPI version check
  • LEVEL log level (see --log-level above)

How it looks

bl_build

Freeze

bl freeze [-c PATH_TO_SPEC] [-z PATH_TO_FROZEN] [-o CONFIG_OVERRIDE] [-j CONCURRENCY] [-w WORKDIR] [-N/--no-check-version] [--log-level LEVEL]

What does it do

It does what ak freeze does

Params

  • PATH_TO_SPEC path to your spec (default: spec.yaml)
  • PATH_TO_FROZEN path to your frozen spec (default: frozen.yaml)
  • CONFIG_OVERRIDE path to an override config to extend the project specification
  • CONCURRENCY number of module clone simultaneously (default: 28)
  • WORKDIR working directory; if omitted, the directory containing spec.yaml
  • --no-check-version skip the PyPI version check
  • LEVEL log level (see --log-level above)

Diff

bl diff [-c PATH_TO_SPEC] [-z PATH_TO_FROZEN] [-o CONFIG_OVERRIDE] [-j CONCURRENCY] [-w WORKDIR] [-N/--no-check-version] [--log-level LEVEL]

What does it do

Shows diff for all dirty repos in the project.

Params

  • PATH_TO_SPEC path to your spec (default: spec.yaml)
  • PATH_TO_FROZEN path to your frozen spec (default: frozen.yaml)
  • CONFIG_OVERRIDE path to an override config to extend the project specification
  • CONCURRENCY number of module clone simultaneously (default: 28)
  • WORKDIR working directory; if omitted, the directory containing spec.yaml
  • --no-check-version skip the PyPI version check
  • LEVEL log level (see --log-level above)

Edit

bl edit REPOSITORY_NAME [options]

What does it do

Turns a managed repo into an editable/full checkout: disables sparse checkout, fetches full content/history, removes the BL locking hook, and saves the editable state.

Use bl edit <repo> before committing locally. Editable repos are remembered and skipped by future builds.

Params

  • REPOSITORY_NAME repo to make editable
  • options same shared options as above

Clean

bl clean [-c PATH_TO_SPEC] [-o CONFIG_OVERRIDE] [-w WORKDIR] [-N/--no-check-version] [--log-level LEVEL] [--remove] [--unlink] [--force] [--dry-run]

What does it do

By default it scans all repos in the spec for dirty git state and resets them with git reset --hard.

Params

  • PATH_TO_SPEC path to your spec (default: spec.yaml)
  • CONFIG_OVERRIDE path to an override config to extend the project specification
  • WORKDIR working directory; if omitted, the directory containing spec.yaml
  • --no-check-version skip the PyPI version check
  • LEVEL log level (see --log-level above)
  • --remove delete src and external-src directories
  • --unlink also clean the links directory
  • --force remove confirmation prompts
  • --dry-run just output what it would do

Init

bl init [DESTINATION]

What does it do

Initializes a new project from the docky-odoo-template-shared template using Copier.

Params

  • DESTINATION destination directory (default: current directory)

Odoo is taking a really long time to clone

Yes !

You can add a locales entry to your odoo repo in spec.yaml like so:

odoo:
  modules:
    - account
    ...
  remotes:
    odoo: https://github.com/odoo/odoo
  merges:
    - odoo 14.0
  locales:
    - fr
    - en

It will only download the french and english translation instead of all of them

  • without locales: 849MB and 40 seconds fresh build
  • with locales fr, en: 169MB and 27 seconds fresh build

⚠️ WARNING: you must list all the odoo modules you need if you use the locales property

Repo specs can also set editable: true when you want BL to treat it as editable from the start (default is false):

folder_name:
  editable: true
  modules:
    ...

I have warnings about patch globs

There is a new property to handle git am <patch_glob> (the old one still works but I hope to remove it at some point)

Before:

folder_name:
  modules:
    ...
  remotes:
    ...
  merges:
    ...
  shell_command_after:
    - git am ../../patches/patch_folder/*

After:

folder_name:
  modules:
    ...
  remotes:
    ...
  merges:
    ...
  patch_globs:
    - ../../patches/patch_folder/*

Benchmarks

Ak benchmarks

Fresh install

ak_bench_cold

Already cloned once

ak_bench_hot

Bl benchmarks

Fresh install

bl_bench_cold

Already cloned once

bl_bench_hot

Results

Type AK BL
Cold ~100s 2 - 10x faster
Hot 3-20s 2 - 10x faster

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bl_odoo-0.4.1.tar.gz (42.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bl_odoo-0.4.1-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file bl_odoo-0.4.1.tar.gz.

File metadata

  • Download URL: bl_odoo-0.4.1.tar.gz
  • Upload date:
  • Size: 42.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bl_odoo-0.4.1.tar.gz
Algorithm Hash digest
SHA256 683587f891c47b0a97144e920b3f9f3cb1bdccdeca8dd1ecb1400e345c9ea5f1
MD5 30a4a3911593ccee432e9419d95a6116
BLAKE2b-256 bcaeea5b5a4534c7e5a554502834f61a7436a9a51bbde5a336c181236cc36904

See more details on using hashes here.

File details

Details for the file bl_odoo-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: bl_odoo-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bl_odoo-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f20770997d82919ccdadf0f3cafbd70847c1e875e12ce5da71044c08fea4774
MD5 b0f4981044fa27e8861ca5a88a4d526e
BLAKE2b-256 012ca938b3e377106f82a049c24c485fb8e1c5a44b83e67914af07d3da3a3dfc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page