Skip to main content

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 cmd module where environment variables have been set for uv and uvx to use an artifact storage that requires authentication.

Please note: so far, only Artifactory is supported as such an artifact storage backend.

For convenience, the git command is also supported.

Own command implementations include:

  • cd changes directories
  • 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 directory path
  • sh can be used to run arbitrary commands using the shell interpreter

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
  • as an anternative, you could enter EOF literally and press the enter key to exit. This method should always work.

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 explicitly 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 --include uv -- 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]'
UV_INDEX_EXTRA1_USERNAME='artuser'
UV_INDEX_EXTRA2_PASSWORD='[MASKED]'
UV_INDEX_EXTRA2_USERNAME='artuser'
UV_INDEX_PRIMARY_PASSWORD='[MASKED]'
UV_INDEX_PRIMARY_USERNAME='artuser'
«uvartage» [osuser@workstation workdir]

Supported commands in the REPL

«uvartage» [osuser@workstation workdir] ?

Documented commands (type help <topic>):
========================================
EOF  env  help  pip  python   set  spp    uv
cd   git  list  pwd  recover  sh   unset  uvx

«uvartage» [osuser@workstation workdir] ? EOF
Exit the REPL by EOF (eg. Ctrl-D on Unix)
«uvartage» [osuser@workstation workdir] ? cd
Change directory
«uvartage» [osuser@workstation workdir] ? env
Print the environment variables
«uvartage» [osuser@workstation workdir] ? git
Run git with the provided arguments
«uvartage» [osuser@workstation workdir] ? help
List available commands with "help" or detailed help with "help cmd".
«uvartage» [osuser@workstation workdir] ? list
Print directory contents (emulation)
«uvartage» [osuser@workstation workdir] ? pip
Run pip with the provided arguments
«uvartage» [osuser@workstation workdir] ? pwd
Print working directory
«uvartage» [osuser@workstation workdir] ? python
Run python (see output of python -V for the exact version)
«uvartage» [osuser@workstation workdir] ? recover
Recover one or more previously unset environment variables
«uvartage» [osuser@workstation workdir] ? set
Set an environment variable
«uvartage» [osuser@workstation workdir] ? sh
Run an arbitrary command through the shell
«uvartage» [osuser@workstation workdir] ? spp
Shortcut for set PYTHONPATH=<arg>, eg. spp src → set PYTHONPATH=src
«uvartage» [osuser@workstation workdir] ? unset
Unset (ie. reversibly delete) one or more environment variables
«uvartage» [osuser@workstation workdir] ? uv
Run uv with the provided arguments
«uvartage» [osuser@workstation workdir] ? uvx
Run uvx with the provided arguments
«uvartage» [osuser@workstation workdir]

Metadata

Release files for uvartage 0.4.1

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

Source distribution (sdist)

Source distribution for uvartage 0.4.1
File Size Uploaded
uvartage-0.4.1.tar.gz 12.5 kB Details

Built distribution (wheel)

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

Total release size: 28.1 kB

Release files / uvartage-0.4.1.tar.gz

Download URL uvartage-0.4.1.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cca90af21131990f78c38a3d42c49190ca7bf5bad2032ebac54e42316cf10c70
BLAKE2b-256 checksum
How to use checksums
a4b0648a822c53e44c222d1957e398ea634b50cfcdc22e068d04e78f7e5d1657
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.15

Release files / uvartage-0.4.1-py3-none-any.whl

Download URL uvartage-0.4.1-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4878b4abe3e5e8d8ff9c79193831af8c418e2e56bd1e18d6efe444cea9c845ee
BLAKE2b-256 checksum
How to use checksums
bc12afdddadcdcd7ca168db5269d8481a217872d9d5f783cadcc582afd3c7470
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.15

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

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