Skip to content

Conversation

@dwilding
Copy link
Contributor

This PR resolves canonical/charmcraft#1116 by changing the return type of the _make_pebble_layer function in the httpbin demo charm. Our preference is to pass around Layer objects rather than LayerDict objects. See the issue for detailed discussion.

Drive-by: extract the environment variables from the layer definition, into a separate variable.

Comment on lines 143 to 142
},
}
Copy link
Contributor Author

@dwilding dwilding Aug 22, 2025

Choose a reason for hiding this comment

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

Ruff doesn't seem to care whether there's a comma here. Do we have a preference?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is because of the magic trailing comma behaviour. Basically, if you put a comma there it tells Ruff to format it to a separate line, and if there's no comma that it doesn't have to do that.

I'd add the trailing comma here, personally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, thanks. I suppose there should be trailing commas in two places in that case. After 'services': {}, and after SERVICE_NAME: {},

@dwilding dwilding mentioned this pull request Aug 22, 2025
7 tasks
Copy link
Collaborator

@tonyandrewmeyer tonyandrewmeyer left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks :)

@dwilding dwilding merged commit 77fb009 into canonical:main Aug 25, 2025
42 checks passed
@dwilding dwilding deleted the httpbin-layer branch August 25, 2025 02:10
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.

Discrepancy between template and tutorial snippet

4 participants