Skip to main content

Wrapper for uv with artifact storage in airgapped environments

Project description

uvartage

A wrapper around uv for usage with artifact storage in airgapped environments

The uvartage command starts a REPL (read-eval-print-loop) using the Python Python cmd module where environment variables have been set for uv and uvx to use an artifact storage that requires authentication.

For convenience, the git command is also supported.

Own command implementations include:

  • cd changes directirues
  • env prints the available environment variables
  • list partially implements the functionality of the Unix ls command (ie. list files and/or directories)
  • pwd prints the working directoriy
  • sh can be used to run arbitrary commands through the shell

The credentials for the user are asked at start time, and stored in environment variables for each repository.

The REPL features a simple history, and tab completion for a subset of the commands (currently, only list and sh, based on paths in the file system).

The loop can be left in different ways, depending on the operating system:

  • Unix: Ctrl-D
  • Windows: Ctrl-Z followed by the enter key
  • in all cases, you could als enter EOF literally and press the enter key to exit.

So far, only artifactory is supported as an artifact storage backend.

Prerequisites

uv has to be installed, but otherwise, only standard library modules are used.

Usage

Built.in usage information

[osuser@workstation workdir]$ uvartage --help
usage: uvartage [-h] [--version] [-v ] [--backend {artifactory}] [--ca-file CA_FILE] [--user USER]
                [USER@]HOSTNAME ...

Wrapper for uv with artifact storage in airgapped environments

positional arguments:
  [USER@]HOSTNAME       the artifact storage hostname, or user and hostname combined by '@'.
  repositories          the package repositories (default first). If not at least one repository name
                        is provided, the value of the environment variable UVARTAGE_DEFAULT_REPOSITORY
                        will be used.

options:
  -h, --help            show this help message and exit
  --version             print version and exit
  -v , --verbose        show more messages
  --backend {artifactory}
                        the artifact storage backend type (default and currently the only supported
                        backend: artifactory)
  --ca-file CA_FILE     a CA cert bundle file to be provided via SSL_CERT_FILE.
  --user USER           username for the artifact storage backend if the hostname is not explicitly
                        specified as USER@HOSTNAME; default is 'osuser'.

[osuser@workstation workdir]$

Example REPL start

... with examiniation of the environment variables set for uv

[osuser@workstation workdir]$ uvartage artuser@artifacts.example.com defaultrepo extrarepo1 extrarepo2
| Neither the environment variable SSL_CERT_FILE has been set, nor a CA file through --ca-file.
| You might encounter problems if using a non-standard (i.e. organization internal) certificate authority.
Please enter the password for artuser on artifacts.example.com (input is hidden):
Welcome to the uv wrapper shell. Type help or ? to list commands.

«uvartage» [osuser@workstation workdir] env UV*
UV_DEFAULT_INDEX=primary=https://artifacts.example.com/artifactory/api/pypi/defaultrepo/simple
UV_INDEX=extra1=https://artifacts.example.com/artifactory/api/pypi/extrarepo1/simple extra2=https://artifacts.example.com/artifactory/api/pypi/extrarepo2/simple
UV_INDEX_EXTRA1_PASSWORD=[masked: entered password]
UV_INDEX_EXTRA1_USERNAME=artuser
UV_INDEX_EXTRA2_PASSWORD=[masked: entered password]
UV_INDEX_EXTRA2_USERNAME=artuser
UV_INDEX_PRIMARY_PASSWORD=[masked: entered password]
UV_INDEX_PRIMARY_USERNAME=artuser
«uvartage» [osuser@workstation workdir]

Supported commands in the REPL

«uvartage» [osuser@workstation workdir] help

Documented commands (type help <topic>):
========================================
EOF  cd  env  git  help  list  ls  pwd  sh  uv  uvx

«uvartage» [osuser@workstation workdir] help EOF
Exit the REPL by EOF (eg. Ctrl-D on Unix)
«uvartage» [osuser@workstation workdir] help cd
Change directory
«uvartage» [osuser@workstation workdir] help env
Print the environment variables
«uvartage» [osuser@workstation workdir] help git
Run git with the provided arguments
«uvartage» [osuser@workstation workdir] help help
List available commands with "help" or detailed help with "help cmd".
«uvartage» [osuser@workstation workdir] help list
Print directory contents (emulation)
«uvartage» [osuser@workstation workdir] help ls
Deprecated POSIX platform only external ls command
«uvartage» [osuser@workstation workdir] help pwd
Print working directory
«uvartage» [osuser@workstation workdir] help sh
Run an arbitrary command through the shell
«uvartage» [osuser@workstation workdir] help uv
Run uv with the provided arguments
«uvartage» [osuser@workstation workdir] help uvx
Run uvx with the provided arguments
«uvartage» [osuser@workstation workdir]

Project details


Download files

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

Source Distribution

uvartage-0.3.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

uvartage-0.3.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file uvartage-0.3.0.tar.gz.

File metadata

  • Download URL: uvartage-0.3.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.5

File hashes

Hashes for uvartage-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8b5db3484ace51c4abaf4800f10d177b72aded66c77e2b36b95c055821d7b862
MD5 dec899fc740787c8d831a80d070b5be2
BLAKE2b-256 27f6458a7974120e2feebbb0c64b9ade3bb403c089545f433079014985ad3672

See more details on using hashes here.

File details

Details for the file uvartage-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: uvartage-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.5

File hashes

Hashes for uvartage-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca53a8c8ee435e9a6fda92d74a6f5cee1e3921ab832056d13fe2d2021e653d4f
MD5 c82d69f9bd800dde9d82a93b6682a904
BLAKE2b-256 0c4aa49a219b6f273d78507bce33b3bb7a2f52d1698ba0ca89add5674ee02a74

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 Pingdom Monitoring Sentry Error logging StatusPage Status page