Skip to content

python: document python keyring provider#2826

Merged
imjasonh merged 7 commits intochainguard-dev:mainfrom
imjasonh:python-keyring
Jan 15, 2026
Merged

python: document python keyring provider#2826
imjasonh merged 7 commits intochainguard-dev:mainfrom
imjasonh:python-keyring

Conversation

@imjasonh
Copy link
Copy Markdown
Contributor

[ ] Check if this is a typo or other quick fix and ignore the rest :)

Type of change

Add documentation for Python keyring provider

What should this PR do?

Allow readers to install and use the keyring provider, in environments where that is possible.

Why are we making this change?

We should recommend the use of short-lived credentials wherever possible, and this new release makes it easier for Python users to use these tokens.

What are the acceptance criteria?

  • The recommendation of short-lived credentials should be clear and motivated
  • Installation and configuration instructions should be clear

How should this PR be tested?

By running the documented commands to pull a private Python package using the keyring provider.

Signed-off-by: Jason Hall <jason@chainguard.dev>
@imjasonh imjasonh requested a review from mosabua December 10, 2025 02:42
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 10, 2025

Deploy Preview for ornate-narwhal-088216 ready!

Name Link
🔨 Latest commit 2c98731
🔍 Latest deploy log https://app.netlify.com/projects/ornate-narwhal-088216/deploys/69692da4b7c66d0008b5f009
😎 Deploy Preview https://deploy-preview-2826--ornate-narwhal-088216.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@imjasonh
Copy link
Copy Markdown
Contributor Author

Just posting this as a WIP while we work out where this should ideally live.

Should the recommendation of short-lived credentials go in access.md, with a note that these are only really easily usable for Python today, and the new Python-specific setup instructions go in https://edu.chainguard.dev/chainguard/libraries/python/build-configuration/#authentication ?

@mosabua
Copy link
Copy Markdown
Member

mosabua commented Dec 10, 2025

I think we should still have them in access.md .. just like .netrc ...

In the section in access we link to our docs for using the applicable python tools (pip and whatever else) ..

And in the tools (like pip) sections we link out to the access section.. that way all the content can be maintained in one place and found from multiple others.

Let me know when this is ready for me to review @imjasonh @angela-zhang

Copy link
Copy Markdown
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

I scheduled to chat tomorrow ..

Comment thread content/chainguard/libraries/access.md Outdated
Comment thread content/chainguard/libraries/access.md Outdated
Comment thread content/chainguard/libraries/access.md Outdated
Comment thread content/chainguard/libraries/access.md Outdated
Signed-off-by: Jason Hall <jason@chainguard.dev>
@imjasonh imjasonh changed the title WIP: document python keyring provider [NOT YET COMPLETE] python: document python keyring provider Jan 7, 2026
Signed-off-by: Jason Hall <jason@chainguard.dev>
Copy link
Copy Markdown
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

I think we have to explain this all in more detail, especially talking about using this within each project and not attempting it for a global install ..

Comment thread content/chainguard/libraries/access.md Outdated
To set up the keyring, install the `keyrings-chainguard-libraries` package:

```shell
pip install keyrings-chainguard-libraries
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we have to explain more here or in the project repo for how to use and install

e.g I can only do pip3 install .. but then brew complains .. so how am I really supposed to use it globally .. or should I only use it locally in a venv per project .. so should I add it as dev dependency in each project somehow?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I also used pip3 install on my local Mac - can we recommend customers install it globally in their existing CI workflow? I imagine each customer will have different environments/setups

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread content/chainguard/libraries/access.md
Comment thread content/chainguard/libraries/access.md Outdated
Then to use the keyring you can run:

```shell
uv pip install --keyring-provider subprocess \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How would it do that so it does it for every uv build run and for any package?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't know that we can, since uv expects per-project configuration. I'm not a uv expert though, and there may be a way I'm not aware of.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well.. how are users to use it then if they just want to run uv build and whatever and not manually install packages..

Copy link
Copy Markdown
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

We should still add info for uv that you can use uv build and such after you manually did the pip install .. but in a configured proejct you have to do

uv pip install keyring keyrings-chainguard-libraries --extra-index-url https://pypi.org/simple/

and then you can use uv build from Chainguard Libraries as configured otherwise in the project

Comment thread content/chainguard/libraries/access.md Outdated
Comment thread content/chainguard/libraries/access.md Outdated
Comment thread content/chainguard/libraries/access.md
Comment thread content/chainguard/libraries/access.md
Comment thread content/chainguard/libraries/access.md Outdated
Then to use the keyring you can run:

```shell
uv pip install --keyring-provider subprocess \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well.. how are users to use it then if they just want to run uv build and whatever and not manually install packages..

imjasonh and others added 2 commits January 15, 2026 13:03
Co-authored-by: Manfred Moser <manfred@simpligility.ca>
Signed-off-by: Jason Hall <jason@chainguard.dev>
Correct pip command and update usage instructions for keyring.
@imjasonh imjasonh marked this pull request as ready for review January 15, 2026 18:10
@imjasonh imjasonh requested a review from a team as a code owner January 15, 2026 18:10
Copy link
Copy Markdown
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

Looks good now. As discussed, if others run into trouble we can amend more in a follow up PR.

@imjasonh imjasonh merged commit c3a9b30 into chainguard-dev:main Jan 15, 2026
8 checks passed
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.

3 participants