charmcraft


Namecharmcraft JSON
Version 3.4.3 PyPI version JSON
download
home_pageNone
SummaryThe main tool to build, upload, and develop in general the Juju charms.
upload_time2025-02-21 15:24:21
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![charmcraft](https://snapcraft.io/charmcraft/badge.svg)](https://snapcraft.io/charmcraft)
[![Tests](https://github.com/canonical/charmcraft/actions/workflows/tests.yaml/badge.svg?event=push)](https://github.com/canonical/charmcraft/actions/workflows/tests.yaml)
[![Spread](https://github.com/canonical/charmcraft/actions/workflows/spread.yaml/badge.svg?event=push)](https://github.com/canonical/charmcraft/actions/workflows/spread.yaml)
[![Weekly Spread](https://github.com/canonical/charmcraft/actions/workflows/spread-large.yaml/badge.svg)](https://github.com/canonical/charmcraft/actions/workflows/spread-large.yaml)

# Charmcraft -- easily initialise, pack, and publish your charms

Charmcraft is a CLI tool that makes it easy and quick to initialise, package, and publish Kubernetes and machine charms. It is an official component of the Charm SDK, itself a part of [the Juju universe](https://juju.is/).

||||
|-|-|- |
|| [Juju](https://juju.is/docs/juju) | Learn how to quickly deploy, integrate, and manage charms on any cloud with Juju. <br>  _It's as simple as `juju deploy foo`, `juju integrate foo bar`, ..., on any cloud._ |
||||
|| [Charmhub](https://charmhub.io/) | Sample our existing charms on Charmhub. <br> _A charm can be a cluster ([OpenStack](https://charmhub.io/openstack-base), [Kubernetes](https://charmhub.io/charmed-kubernetes)), a data platform ([PostgreSQL](https://charmhub.io/postgresql-k8s), [MongoDB](https://charmhub.io/mongodb), etc.), an observability stack ([Canonical Observability Stack](https://charmhub.io/cos-lite)), an MLOps solution ([Kubeflow](https://charmhub.io/kubeflow)), and so much more._ |
||||
|:point_right:| [Charm SDK](https://juju.is/docs/sdk) | Write your own charm! <br> _Juju is written in Go, but our SDK supports easy charm development in Python._  |


## Give it a try

Let's use Charmcraft to initialise and pack a Kubernetes charm:

### Set up

> See [Charm SDK | Set up your development environment automatically > Set up an Ubuntu `charm-dev` VM with Multipass](https://juju.is/docs/sdk/dev-setup#heading--automatic-set-up-an-ubuntu-charm-dev-vm-with-multipass). <br> Choose the MicroK8s track. 

### Initialise and pack your charm

In your Multipass VM shell, create a charm directory and use Charmcraft to initialise your charm file structure:

```
mkdir my-new-charm
cd my-new-charm
charmcraft init
```

This has created a standard charm directory structure:

```
$ ls -R
.:
CONTRIBUTING.md  README.md        pyproject.toml    src    tox.ini
LICENSE          charmcraft.yaml  requirements.txt  tests

./src:
charm.py

./tests:
integration  unit

./tests/integration:
test_charm.py

./tests/unit:
test_charm.py
```

Poke around: 

Note that the `charmcraft.yaml` file shows that what we have is an example charm called `my-new-charm`, which builds on Ubuntu 22.04 and which uses an OCI image resource `httpbin` from `kennethreitz/httpbin`.

Note that the `src/charm.py` file contains code scaffolding featuring the Charm SDK's Ops library for writing charms.

Explore further, start editing the files, or skip ahead and pack the charm: 

```
charmcraft pack
```

If you didn't take any wrong turn or simply left the charm exactly as it was, this should work and yield a file called `my-new-charm_ubuntu-22.04-amd64.charm` (the architecture bit may be different depending on your system's architecture). Use this name and the resource from the `metadata.yaml` to deploy your example charm to your local MicroK8s cloud with Juju:

```
juju deploy ./my-new-charm_ubuntu-22.04-amd64.charm --resource httpbin-image=kennethreitz/httpbin
```

Congratulations, you’ve just initialised and packed your first Kubernetes charm using Charmcraft!

But Charmcraft goes far beyond `init` and `pack`. For example, when you're ready to share your charm with the world, you can use Charmcraft to publish your charm on Charmhub. Run `charmcraft help` to preview more.

### Clean up

> See [Charm SDK | Set up your development environment automatically > Clean up](https://juju.is/docs/sdk/dev-setup#heading--automatic-set-up-an-ubuntu-charm-dev-vm-with-multipass).

## Next steps

### Learn more

Read our [user documentation](https://juju.is/docs/sdk/charmcraft), which also includes other guides showing Charmcraft in action

### Chat with us

Read our [Code of conduct](https://ubuntu.com/community/code-of-conduct) and:
- Join our chat: [Matrix](https://matrix.to/#/#charmhub-charmcraft:ubuntu.com)
- Join our forum: [Discourse](https://discourse.charmhub.io/)

### File an issue

- Report a Charmcraft bug on [GitHub](https://github.com/canonical/charmcraft/issues)
- Raise a general https://juju.is/docs documentation issue on [GitHub | juju/docs](https://github.com/juju/docs)

### Make your mark

- Read our [documentation contributor guidelines](https://discourse.charmhub.io/t/documentation-guidelines-for-contributors/1245) and help improve a doc 
- Read our [codebase contributor guidelines](https://github.com/canonical/charmcraft/blob/main/CONTRIBUTING.md) and help improve the codebase

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "charmcraft",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/96/c1/54c4193113f9a340c60acff29bb22ac310668219bf0aac59004bafde5d95/charmcraft-3.4.3.tar.gz",
    "platform": null,
    "description": "[![charmcraft](https://snapcraft.io/charmcraft/badge.svg)](https://snapcraft.io/charmcraft)\n[![Tests](https://github.com/canonical/charmcraft/actions/workflows/tests.yaml/badge.svg?event=push)](https://github.com/canonical/charmcraft/actions/workflows/tests.yaml)\n[![Spread](https://github.com/canonical/charmcraft/actions/workflows/spread.yaml/badge.svg?event=push)](https://github.com/canonical/charmcraft/actions/workflows/spread.yaml)\n[![Weekly Spread](https://github.com/canonical/charmcraft/actions/workflows/spread-large.yaml/badge.svg)](https://github.com/canonical/charmcraft/actions/workflows/spread-large.yaml)\n\n# Charmcraft -- easily initialise, pack, and publish your charms\n\nCharmcraft is a CLI tool that makes it easy and quick to initialise, package, and publish Kubernetes and machine charms. It is an official component of the Charm SDK, itself a part of [the Juju universe](https://juju.is/).\n\n||||\n|-|-|- |\n|| [Juju](https://juju.is/docs/juju) | Learn how to quickly deploy, integrate, and manage charms on any cloud with Juju. <br>  _It's as simple as `juju deploy foo`, `juju integrate foo bar`, ..., on any cloud._ |\n||||\n|| [Charmhub](https://charmhub.io/) | Sample our existing charms on Charmhub. <br> _A charm can be a cluster ([OpenStack](https://charmhub.io/openstack-base), [Kubernetes](https://charmhub.io/charmed-kubernetes)), a data platform ([PostgreSQL](https://charmhub.io/postgresql-k8s), [MongoDB](https://charmhub.io/mongodb), etc.), an observability stack ([Canonical Observability Stack](https://charmhub.io/cos-lite)), an MLOps solution ([Kubeflow](https://charmhub.io/kubeflow)), and so much more._ |\n||||\n|:point_right:| [Charm SDK](https://juju.is/docs/sdk) | Write your own charm! <br> _Juju is written in Go, but our SDK supports easy charm development in Python._  |\n\n\n## Give it a try\n\nLet's use Charmcraft to initialise and pack a Kubernetes charm:\n\n### Set up\n\n> See [Charm SDK | Set up your development environment automatically > Set up an Ubuntu `charm-dev` VM with Multipass](https://juju.is/docs/sdk/dev-setup#heading--automatic-set-up-an-ubuntu-charm-dev-vm-with-multipass). <br> Choose the MicroK8s track. \n\n### Initialise and pack your charm\n\nIn your Multipass VM shell, create a charm directory and use Charmcraft to initialise your charm file structure:\n\n```\nmkdir my-new-charm\ncd my-new-charm\ncharmcraft init\n```\n\nThis has created a standard charm directory structure:\n\n```\n$ ls -R\n.:\nCONTRIBUTING.md  README.md        pyproject.toml    src    tox.ini\nLICENSE          charmcraft.yaml  requirements.txt  tests\n\n./src:\ncharm.py\n\n./tests:\nintegration  unit\n\n./tests/integration:\ntest_charm.py\n\n./tests/unit:\ntest_charm.py\n```\n\nPoke around: \n\nNote that the `charmcraft.yaml` file shows that what we have is an example charm called `my-new-charm`, which builds on Ubuntu 22.04 and which uses an OCI image resource `httpbin` from `kennethreitz/httpbin`.\n\nNote that the `src/charm.py` file contains code scaffolding featuring the Charm SDK's Ops library for writing charms.\n\nExplore further, start editing the files, or skip ahead and pack the charm: \n\n```\ncharmcraft pack\n```\n\nIf you didn't take any wrong turn or simply left the charm exactly as it was, this should work and yield a file called `my-new-charm_ubuntu-22.04-amd64.charm` (the architecture bit may be different depending on your system's architecture). Use this name and the resource from the `metadata.yaml` to deploy your example charm to your local MicroK8s cloud with Juju:\n\n```\njuju deploy ./my-new-charm_ubuntu-22.04-amd64.charm --resource httpbin-image=kennethreitz/httpbin\n```\n\nCongratulations, you\u2019ve just initialised and packed your first Kubernetes charm using Charmcraft!\n\nBut Charmcraft goes far beyond `init` and `pack`. For example, when you're ready to share your charm with the world, you can use Charmcraft to publish your charm on Charmhub. Run `charmcraft help` to preview more.\n\n### Clean up\n\n> See [Charm SDK | Set up your development environment automatically > Clean up](https://juju.is/docs/sdk/dev-setup#heading--automatic-set-up-an-ubuntu-charm-dev-vm-with-multipass).\n\n## Next steps\n\n### Learn more\n\nRead our [user documentation](https://juju.is/docs/sdk/charmcraft), which also includes other guides showing Charmcraft in action\n\n### Chat with us\n\nRead our [Code of conduct](https://ubuntu.com/community/code-of-conduct) and:\n- Join our chat: [Matrix](https://matrix.to/#/#charmhub-charmcraft:ubuntu.com)\n- Join our forum: [Discourse](https://discourse.charmhub.io/)\n\n### File an issue\n\n- Report a Charmcraft bug on [GitHub](https://github.com/canonical/charmcraft/issues)\n- Raise a general https://juju.is/docs documentation issue on [GitHub | juju/docs](https://github.com/juju/docs)\n\n### Make your mark\n\n- Read our [documentation contributor guidelines](https://discourse.charmhub.io/t/documentation-guidelines-for-contributors/1245) and help improve a doc \n- Read our [codebase contributor guidelines](https://github.com/canonical/charmcraft/blob/main/CONTRIBUTING.md) and help improve the codebase\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "The main tool to build, upload, and develop in general the Juju charms.",
    "version": "3.4.3",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5262cbb344b5338b5822d93af35903e6b1a4f3bebe32274613b7555f52392a72",
                "md5": "2b2d7ccbd182340af326840b59896408",
                "sha256": "05e45305d45b2ff5bed9bcfb43019589b9b1b4ac7481d592653deac8aba8fd87"
            },
            "downloads": -1,
            "filename": "charmcraft-3.4.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2b2d7ccbd182340af326840b59896408",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 226721,
            "upload_time": "2025-02-21T15:24:19",
            "upload_time_iso_8601": "2025-02-21T15:24:19.205293Z",
            "url": "https://files.pythonhosted.org/packages/52/62/cbb344b5338b5822d93af35903e6b1a4f3bebe32274613b7555f52392a72/charmcraft-3.4.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "96c154c4193113f9a340c60acff29bb22ac310668219bf0aac59004bafde5d95",
                "md5": "4084310c9f4b74e0ef005d43727c668c",
                "sha256": "ef398a210cad0cb78cc176beed4459de52c966c5d28ca16544a4639d3c1d2fce"
            },
            "downloads": -1,
            "filename": "charmcraft-3.4.3.tar.gz",
            "has_sig": false,
            "md5_digest": "4084310c9f4b74e0ef005d43727c668c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 632151,
            "upload_time": "2025-02-21T15:24:21",
            "upload_time_iso_8601": "2025-02-21T15:24:21.750092Z",
            "url": "https://files.pythonhosted.org/packages/96/c1/54c4193113f9a340c60acff29bb22ac310668219bf0aac59004bafde5d95/charmcraft-3.4.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-21 15:24:21",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "charmcraft"
}
        
Elapsed time: 1.01804s