说明
安装与使用
- 安装uv:
pip install uv - 安装第三方依赖库:
uv add <package_name> - 更新第三方依赖库:
uv add -U <package_name> - 卸载第三方依赖库:
uv remove <package_name> - 使用uv运行脚本:
uv run app.py
换源
在pyproject.toml中添加以下内容:
[[tool.uv.index]]
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
default = true
初始化项目
几个常用的选项如下:
- uv init --app 创建一个普通的app, 这个也是默认的选项,这种就是最基础的项目,这类型的项目不能直接打包,由于pyproject.toml 中没有配置build system
- uv init --package 创建一个“包”, 这类型的项目可以被打包发布,pyproject.toml 中会自动配置 build system,并且可以发布为工具(tool),使用 uv tool run (或者 uvx )来直接运行(本节重点介绍此种方式创建的包)
- uv init --lib 创建一个"库", 这种和package 的区别在于没有project.scripts, 不能当工具来使用
打包
- 配置pyproject.toml:其中项目的名称name,必须跟项目中的某个文件夹的名称相同,这个文件可以是根目录下的文件夹也可以是src目录下的子文件夹。只有这个文件夹下的文件才会被打包发布,并被其他人安装识别。
- 打包:
uv build - 上传:
uv publish
Metadata
Release files for MyUVStudy 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| myuvstudy-0.1.6.tar.gz | 5.7 kB | Without provenance | Details for myuvstudy-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| myuvstudy-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for myuvstudy-0.1.6-py3-none-any.whl |
Total release size: 8.7 kB
Release files / myuvstudy-0.1.6.tar.gz
| Download URL | myuvstudy-0.1.6.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0adbac3155e6c73eaad2abc1a21647b53029352b56b142c340567dce84126712
|
|
BLAKE2b-256 checksum How to use checksums |
54216f6dc8a34ce9f3478ac9cddf5bcc19ff97d9a25dfb1f5b64ee89b706c51e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Release files / myuvstudy-0.1.6-py3-none-any.whl
| Download URL | myuvstudy-0.1.6-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b31ce315b6d8894fcce90713a5213a4cffb69de0d524f539562e84d6008c551
|
|
BLAKE2b-256 checksum How to use checksums |
7c2a6ec8b09a81cf306b18c14265e6477199deb98a75ba73663058c9552f7ea9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Security for MyUVStudy 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.