https://github.com/semgrep/poetry-codeartifact-plugin
A Poetry plugin for interfacing with CodeArtifact repositories
https://github.com/semgrep/poetry-codeartifact-plugin
Last synced: about 2 months ago
JSON representation
A Poetry plugin for interfacing with CodeArtifact repositories
- Host: GitHub
- URL: https://github.com/semgrep/poetry-codeartifact-plugin
- Owner: semgrep
- License: apache-2.0
- Created: 2022-08-23T14:37:37.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-21T20:27:12.000Z (over 1 year ago)
- Last Synced: 2025-03-30T18:51:11.514Z (3 months ago)
- Language: Python
- Homepage:
- Size: 207 KB
- Stars: 17
- Watchers: 4
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# poetry-codeartifact-plugin
This Poetry plugin automatically refreshes your authorization token when working with CodeArtifact repositories.
## Installation
Run this to install the plugin:
`poetry self add poetry-codeartifact-plugin`And to remove:
`poetry self remove poetry-codeartifact-plugin`## Usage
No configuration or workflow changes are needed. If the plugin detects a HTTP 401 or 403 from a CodeArtifact URL, it will refresh your authorization token and retry the request.
This assumes that your local AWS creds are up-to-date -- if not, your command will still fail.
## Adding a CodeArtifact repository
Add this snippet to your project's `pyproject.toml`:
```toml
[[tool.poetry.source]]
name = "codeartifact-pypi" # arbitrary, just don't reuse repository names between CodeArtifact repos
url = "https://DOMAIN-123412341234.d.codeartifact.us-west-2.amazonaws.com/REPO/pypi/simple/" # get this URL from your CodeArtifact dashboard or the GetRepositoryEndpoint API call
```Learn more about Poetry repositories here: https://python-poetry.org/docs/repositories/