Skip to main content

Artifact Registry tools for PyPI

This repository contains an alternate keyring backend implementation to help with interacting with PyPI Repositories hosted on Artifact Registry.

Authentication

artifactregistry-gauth is a python package which allows you to configure keyring to interact with PyPI repositories stored in Artifact Registry.

The backend automatically searches for credentials from the environment and authenticates to Artifact Registry. It looks for credentials in the following order:

  1. Google Application Default Credentials.
  2. From the gcloud SDK. (i.e., the access token printed via gcloud config config-helper --format='value(credential.access_token)')
    • Hint: You can see which account is active with the command gcloud config config-helper --format='value(configuration.properties.core.account)'
  3. If neither of them exist, an error occurs.

To use the keyring backend:

  1. Log in

    Option 1: log in as a service account:

    (1). Using a JSON file that contains a service account key:

     `$ export GOOGLE_APPLICATION_CREDENTIALS=[path/to/key.json]`
    

    (2). Or using gcloud:

     `$ gcloud auth application-default login`
    

    Option 2: log in as an end user via gcloud:

     `$ gcloud auth login`
    
  2. Configure twine (.pypirc) and pip (pip.conf) tools to connect to the repository. Use the output from the following command:

    gcloud alpha artifacts print-settings pypi

    In your .pypirc file add:

    [disutils]
    index-servers =
    	REPOSITORY_ID
    
    [REPOSITORY_ID]
    repository: https://LOCATION-pypi.pkg.dev/PROJECT_ID/REPOSITORY_ID/
    

    In your pip.conf file add:

    [global]
    index-url = https://LOCATION-pypi.pkg.dev/PROJECT_ID/REPOSITORY_ID/simple/
    
  3. Install the artifactregistry-gauth package

    pip install artifactregistry-gauth

List backends to confirm the installation.

`keyring --list-backends`

The list should include

-`ChainerBackend(priority:10)`
-`GooglePyPIAuth(priority:9)`

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file keyrings.google-artifactregistry-auth-0.0.1.tar.gz.

File metadata

  • Download URL: keyrings.google-artifactregistry-auth-0.0.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.7

File hashes

Hashes for keyrings.google-artifactregistry-auth-0.0.1.tar.gz
Algorithm Hash digest
SHA256 37012079bfd0a6b0c2c471428eb83c8b31acf800c789e7ba756b4077291c5e58
MD5 89bea7786613bc1a63a5e78d9f0676a4
BLAKE2b-256 64506d776ae2bdcd71fdaecf4cb49c68918716af8779c8e23588026b988e34b9

See more details on using hashes here.

File details

Details for the file keyrings.google_artifactregistry_auth-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for keyrings.google_artifactregistry_auth-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7278ba9a99f58aa3799540bd56c3172e0e606764d0adc564af9399607cb44bb1
MD5 5d65bdd0ea3073cbf2b99831d5984c72
BLAKE2b-256 3206eeb0b4a66fcf7712c4d9419d0a9e713d9b09c32d8f8e381aff6c96866b97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page