Skip to main content

partifact

partifact is a tool to help with configuring and authenticating CodeArtifact as a repository for Poetry and pip.

AWS CLI offers functionality to configure CodeArtifact for pip. This tool offers the following improvements over the CLI:

  1. Poetry support.
  2. Assuming an AWS role to get the token. This is handy in automated pipelines, which may have the access key and secret key as environment variables, but want to install packages from CodeArtifact on a different account.
  3. Configuration persisted in a config file, making the tool more convenient to use than the CLI with the options it requires to be passed in from the command line.

How to use it?

Install partifact from pypi using pip the usual way:

pip install partifact

It's best to do this globally, rather than inside the virtualenv.

Before you can use partifact, the Poetry source repository needs to be configured in pyproject.toml.

[[tool.poetry.source]]
name = "my-repo"
url = "https://{code_artifact_domain}-{aws_account}.d.codeartifact.{aws_region}.amazonaws.com/pypi/{code_artifact_repository}/simple/"
default = true  # if this should be the default repository to install from

If you are publishing to the repository, the /simple/ suffix is not required at the end.

Once Poetry is configured, you can use the partifact command to authenticate:

partifact login my-repo

NOTE: Make sure your run the command from the directory where your pyproject.toml is!

Optionally, you can pass in an AWS profile and/or AWS role to use for CodeArtifact token generation.

partifact login myrepo --profile myprofile
partifact login myrepo --role myrole

If you would also like to configure global.index-url in the pip config, you can do so through the --configure-pip flag.

partifact login myrepo --profile myprofile --configure-pip

Known issues

  1. The CodeArtifact token seems to exceed the maximum length allowed in Windows Credential Manager, resulting in a misleading (1783, 'CredWrite', 'The stub received bad data.') error. The library has been tested on macOS.

Metadata

Release files for partifact 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for partifact 0.5.0
File Size Uploaded Provenance
partifact-0.5.0.tar.gz 5.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for partifact 0.5.0
File Interpreter ABI Platform
partifact-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / partifact-0.5.0.tar.gz

Download URL partifact-0.5.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1b724f84857aae358dcfff85da26656020a208fbe382ecbf1ebc101ca77b4c10
BLAKE2b-256 checksum
How to use checksums
e50b329396e4628bd8972c6906dedfc3ea4509707a582cfc046d5d586e45a347
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.11.0 Linux/6.17.0-1013-azure

Release files / partifact-0.5.0-py3-none-any.whl

Download URL partifact-0.5.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7eccc004ed17622c96530e7166edff5e79f99b65ed69f87fa835283b4dfb97e9
BLAKE2b-256 checksum
How to use checksums
376d70f7afd31db525f5325bc77db9ef1de203557d351d035ee96e17ef2f277c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.11.0 Linux/6.17.0-1013-azure

Security for partifact 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page