Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): add python and poetry plugin docs #1940

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lengau
Copy link
Collaborator

@lengau lengau commented Oct 7, 2024

This adds documentation for the Python and Poetry plugins.

It builds upon #1939 and requires canonical/craft-parts#872

NOTE: This still needs a craft-parts update for all docs rendering to work properly, but please review what you can ITMT

@lengau lengau force-pushed the work/1913/CRAFT-3425/python-poetry branch from b0ebaa0 to df6780b Compare October 8, 2024 12:51
@lengau lengau marked this pull request as ready for review October 11, 2024 16:49
2. It uses :command:`poetry export` to create a ``requirements.txt`` in the project's
build directory.
3. It uses :command:`pip` to install the packages referenced in ``requirements.txt``
into the virtual environment, without any additional dependencies.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additional dependencies.

I don't fully understand what "additional" suggests here. Can you elaborate?

Comment on lines +35 to +36
4. It copies the ``src`` and ``lib`` directories from your charm project into the
final charm if they exist.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might flow better, and avoid implying src && lib, as:

4. It copies any existing ``src`` and ``lib`` directories from your charm project into the
   final charm.

Comment on lines +1 to +5
name: my-charm
type: charm
title: My operator charm
summary: A charm that uses the operator framework
description: A charm that uses the operator framework

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better if the metadata were germane to the Poetry plugin.

Comment on lines +1 to +5
name: my-charm
type: charm
title: My operator charm
summary: A charm that uses the operator framework
description: A charm that uses the operator framework

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. How about we orient these around Python?

Comment on lines +6 to +7
The Python plugin can be used for charms written in Python, typically for charms
using the `Operator framework`_.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Python plugin can be used for charms written in Python, typically for charms
using the `Operator framework`_.
The Python plugin builds charms written in Python. It's typically
used in conjunction with the `Operator framework`_.

Comment on lines +27 to +29
This plugin creates a Python virtual environment in the ``venv`` directory of your
charm using the version of Python included with your base, using the requirements files
provided in the ``python-requirements`` keyword.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This plugin creates a Python virtual environment in the ``venv`` directory of your
charm using the version of Python included with your base, using the requirements files
provided in the ``python-requirements`` keyword.
This plugin creates a Python virtual environment in the ``venv`` directory of your
charm using the version of Python included with your base and the requirements files
provided in the ``python-requirements`` key.

directory.
2. It uses :command:`pip` to install the required Python packages as configured
in the ``python-requirements``, ``python-constraints`` and ``python-packages``
keywords.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
keywords.
keys.

Comment on lines +46 to +47
2. It uses :command:`pip` to install the required Python packages as configured
in the ``python-requirements``, ``python-constraints`` and ``python-packages``

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. It uses :command:`pip` to install the required Python packages as configured
in the ``python-requirements``, ``python-constraints`` and ``python-packages``
2. It uses :command:`pip` to install the required Python packages specified
by the ``python-requirements``, ``python-constraints`` and ``python-packages``

Food for thought. I think it's best if we don't overload "configure".

Comment on lines +49 to +50
3. It copies the ``src`` and ``lib`` directories from your charm project into the
final charm if they exist.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See earlier comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants