Charmcraft Deprecation Notices

This document contains a list of charmcraft deprecation notices and recommendations.

Index

Details

DN01: Configuration keywords are now separated using dashes

Introduced in charmcraft v1.1, will be enforced in v1.3.

The charmcraft.yaml file used to configure Charmcraft now uses dashes to separate multi-token words. Previously, underscores were used.

This means that if you have a configuration like this:

charmhub:
    api_url: https://someserver.com

…you would need to migrate it to:

charmhub:
    api-url: https://someserver.com

DN02: A charmcraft.yaml configuration file is now required

Introduced in charmcraft v1.1, will be enforced in v1.3.

The charmcraft.yaml file will soon be required. The following configuration is assumed:

...
type: charm
bases:
  - build-on:
    - name: "ubuntu"
      channel: "20.04"
    run-on:
    - name: "ubuntu"
      channel: "20.04"

For more information, check out Juju | Charmcraft Configuration.

DN03: Bases configuration is now required

Introduced in charmcraft v1.1, will be enforced in v1.3.

The charmcraft.yaml file will soon require bases configuration. The following bases configuration is assumed:

...
bases:
  - build-on:
    - name: "ubuntu"
      channel: "20.04"
    run-on:
    - name: "ubuntu"
      channel: "20.04"

For more information, check out Juju | Charmcraft Configuration.

DN04: Use 'charm-entrypoint' in charmcraft.yaml parts to define the entry point

Introduced in charmcraft v1.2, will be enforced in v1.4.

Non-default charm entry points should now be defined in the charm part in charmcraft.yaml. Use charm-entrypoint to list the path to the entry point executable, relative to the charm source directory. If not specified, the entry point is assumed to be src/charm.py.

...
parts:
  charm:
    charm-entrypoint: "src/my_entrypoint.py"
...

DN05: Use 'charm-requirements' in charmcraft.yaml parts to define requirements

Introduced in charmcraft v1.2, will be enforced in v1.4.

Non-default requirement files should now be defined in the charm part in charmcraft.yaml. Use charm-requirements to list the requirement files containing python packages to install. If not specified, requirements.txt will be used if the file exists in the charm source directory.

...
parts:
  charm:
    charm-requirements: ["reqs1.txt", "reqs2.txt"]
...

Last updated 5 days ago.