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

add docs for AWS CodeArtifact #6816

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 55 additions & 2 deletions docs/guides/integration/alternative-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,60 @@ $ # Configure the index URL with the username
$ export UV_EXTRA_INDEX_URL=https://VssSessionToken@pkgs.dev.azure.com/{organisation}/{project}/_packaging/{feedName}/pypi/simple/
```

## AWS CodeArtifact

uv can install packages from
[AWS CodeArtifact](https://docs.aws.amazon.com/codeartifact/latest/ug/using-python.html).

The authorization token can be retrieved using the `awscli` tool.

!!! note

This guide assumes the AWS CLI has previously been authenticated.

First, declare some constants for your CodeArtifact repository:

```bash
export AWS_DOMAIN="<your-domain>"
export AWS_ACCOUNT_ID="<your-account-id>"
export AWS_REGION="<your-region>"
export AWS_CODEARTIFACT_REPOSITORY="<your-repository>"
```

Then, retrieve a token from the `awscli`:

```bash
export AWS_CODEARTIFACT_TOKEN="$(
aws codeartifact get-authorization-token \
--domain $AWS_DOMAIN \
--domain-owner $AWS_ACCOUNT_ID \
--query authorizationToken \
--output text
)"
```

And configure the index URL:

```bash
export UV_EXTRA_INDEX_URL="https://aws:${AWS_CODEARTIFACT_TOKEN}@${AWS_DOMAIN}-${AWS_ACCOUNT_ID}.d.codeartifact.${AWS_REGION}.amazonaws.com/pypi/${AWS_CODEARTIFACT_REPOSITORY}/simple/"
```

### Publishing packages

If you also want to publish your own packages to AWS CodeArtifact, you can use `twine` as described
in the [publishing guide](../publish.md). You will need to set `TWINE_REPOSITORY_URL` separately
from the credentials:

```bash
# Configure twine to use AWS CodeArtifact
export TWINE_REPOSITORY_URL="https://${AWS_CODEARTIFACT_TOKEN}@${AWS_DOMAIN}-${AWS_ACCOUNT_ID}.d.codeartifact.${AWS_REGION}.amazonaws.com/pypi/${AWS_CODEARTIFACT_REPOSITORY}/"
export TWINE_USERNAME=aws
export TWINE_PASSWORD="$AWS_CODEARTIFACT_TOKEN"

# Publish the package
uv run twine upload dist/*
```

## Other indexes

uv is also known to work with JFrog's Artifactory, the Google Cloud Artifact Registry, and AWS Code
Artifact.
uv is also known to work with JFrog's Artifactory and the Google Cloud Artifact Registry.
Loading