Uv / Publish Specific Distribution Files
Publish Specific Distribution Files
Publish specific distribution files to the repository.
uv publish <path/to/dist/*.whl> <path/to/dist/*.tar.gz> uv publish <path/to/dist/*.whl> <path/to/dist/*.tar.gz> #!/bin/bash
# Publish Specific Distribution Files
uv publish {{path/to/dist/*.whl}} {{path/to/dist/*.tar.gz}} import subprocess
# Publish Specific Distribution Files
# Make sure to replace <placeholders> with actual values
def run_command():
cmd = [
"uv",
"publish",
"<path/to/dist/*.whl>",
"<path/to/dist/*.tar.gz>"
]
try:
print(f"Executing: {' '.join(cmd)}")
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e}")
except FileNotFoundError:
print("Error: uv not found. Please install it first.")
if __name__ == "__main__":
run_command() When To Use
When targeting specific artifacts for publishing while ignoring others.
Pro Tip
Ensure you're using the correct file formats; incorrect formats will cause publish failures.
Command Builder
Tune the command before you copy it
uv publish <path/to/dist/*.whl> <path/to/dist/*.tar.gz> Anatomy of Output
Understanding the result
Publishing files... Status Indicates the publishing process for specified files has started.
Files published: {{num_files}} Published Files Count Indicates how many files were published successfully.
No errors reported during the publish process. Publishing Outcome All specified files were published without issues.
Troubleshooting
Common pitfalls
ERROR: Specified distribution files not found.
Solution: Check paths and ensure files exist.
ERROR: Unsupported file format for publishing.
Solution: Publish only `.whl` or `.tar.gz` files.
ERROR: Publish failed due to network issue.
Solution: Verify network connectivity and retry the publishing command.
Command Breakdown
What each part is doing
-
uv - Base Command
- The executable that performs this operation. Here it runs Uv before the shell applies any redirect operators.
-
<path/to/dist/*.whl> - path to dist *.whl
- The value supplied for path to dist *.whl.
-
<path/to/dist/*.tar.gz> - path to dist *.tar.gz
- The value supplied for path to dist *.tar.gz.
Alternative Approaches
Comparable commands in other tools
Alternative package management tools for the same job.
bun feedback <path/to/file1 path/to/file2 ...> Bun / Send Feedback With Email bun feedback <path/to/file|text> -e <email@address> Bun / Send Text Feedback bun feedback "<Feedback text!>" Zapier / Push Integration Disable Smart File Inclusion zapier push --disable-dependency-detection Npm / Create Publish Access Token npm token create --publish