Skip to main content

Wrapper tool ito run `uv publish` using default credentials from `~/.pypirc`

Project description

UV-PUBLISH - run uv publish using credentials from your ~/.pypirc

PyPi

uv-publish is a simple command line wrapper to run uv publish using your configured Python PyPi credentials from your ~/.pypirc file. Simply run uv-publish instead of uv publish with any of the options and arguments that uv publish normally accepts. uv-publish will read your ~/.pypirc and pass those credentials to uv publish as arguments --username, --password, or --token, and --publish-url. Those arguments are passed automatically at the start of the uv publish command line so they can be overridden manually by later arguments if required.

Note that similar tools to push your Python packages to PyPi such as twine, hatch, and flit recognise the common ~/.pypirc file so this wrapper is created to enable uv publish to do the same.

By default uv-publish will use the first repository in your ~/.pypirc file (defaulting to pypi if the file does not exist). You can specify the repository to use from your ~./pypirc file with the --repository (or --repo) option. This is the only option that uv-publish accepts itself, all other options and arguments are passed directly to uv publish. Note that --repository is the same switch that twine and flit accept, and --repo is the same switch that hatch accepts, so both are supported by uv-publish.

This utility has been developed and tested on Linux but should also work on macOS and Windows although has not been tried on those platforms. The latest documentation and code is available at https://github.com/bulletmark/uv-publish.

How to run

You are a uv user so you should have uv installed. Just run uv-publish as follows (uv-publish will get automatically installed by uvx if you don't already have it):

$ uvx uv-publish [uv publish options]

E.g. if you use twine to publish your package[s] and you store your PyPi credentials in ~/.pypirc then you can swap to uv-publish by simply changing the command:

$ twine upload dist/*

to:

$ uvx uv-publish

Of course uv-publish is available from PyPi so you can choose to install it using pipx or pipxu or uv tool if you prefer a traditional approach.

Usage

Type uv-publish -h to view the usage summary:

usage: uv-publish [-h] [--repository {pypi,testpypi}]

Command line wrapper to run `uv publish` using default credentials from your
`~/.pypirc`. All extra arguments supplied on the command line are passed to
`uv publish`.

options:
  -h, --help            show this help message and exit
  --repository, --repo {pypi,testpypi}
                        Name of the repository to upload to (must match a
                        repository in your .pypirc file). Default is "pypi".

License

Copyright (C) 2024 Mark Blakeney. This program is distributed under the terms of the GNU General Public License. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at https://en.wikipedia.org/wiki/GNU_General_Public_License for more details.

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

uv_publish-1.4.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

uv_publish-1.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file uv_publish-1.4.tar.gz.

File metadata

  • Download URL: uv_publish-1.4.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for uv_publish-1.4.tar.gz
Algorithm Hash digest
SHA256 d4316958158aa1af75044bbe14befa6ec2b84aad8a18e3ecf05f3616b64b51da
MD5 db6fbf5aa5cdaa394390c7abfc93595d
BLAKE2b-256 f1dba670049a69b553a284ef448b1e92cff5a7c61ec00750bb89e3b0cd260fc8

See more details on using hashes here.

File details

Details for the file uv_publish-1.4-py3-none-any.whl.

File metadata

  • Download URL: uv_publish-1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for uv_publish-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8b7dd829a2660b0e2f5fb371b8ce5f205d505455679b0c367c7df4fda245c413
MD5 9eb384a30847cab67445f7b11018ec7e
BLAKE2b-256 b22d24c10de7c728cb853473d651d148bed06266bd10115332d74b9549b38ee1

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