doc: Update README.md d48cf7d4ec

This commit is contained in:
jaywcjlove
2025-06-06 15:20:33 +00:00
parent 9b47f69546
commit 347425d710
4 changed files with 31 additions and 27 deletions

View File

@ -35,13 +35,14 @@
<path d="M12 11.807A9.002 9.002 0 0 1 10.049 2a9.942 9.942 0 0 0-5.12 2.735c-3.905 3.905-3.905 10.237 0 14.142 3.906 3.906 10.237 3.905 14.143 0a9.946 9.946 0 0 0 2.735-5.119A9.003 9.003 0 0 1 12 11.807z"></path>
</svg>
</button><script src="../js/dark.js?v=1.8.3"></script><a href="https://github.com/jaywcjlove/reference" class="" target="__blank"><svg viewBox="0 0 16 16" fill="currentColor" height="1em" width="1em"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg></a></div></div></nav><div class="wrap h1body-exist max-container"><header class="wrap-header h1wrap"><h1 id="uv-备忘清单"><svg width="41" height="41" viewBox="0 0 41 41" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M-5.28619e-06 0.168629L0.0843098 20.1685L0.151762 36.1683C0.161075 38.3774 1.95947 40.1607 4.16859 40.1514L20.1684 40.084L30.1684 40.0418L31.1852 40.0375C33.3877 40.0282 35.1683 38.2026 35.1683 36V36L37.0003 36L37.0003 39.9992L40.1683 39.9996L39.9996 -9.94653e-07L21.5998 0.0775689L21.6774 16.0185L21.6774 25.9998L20.0774 25.9998L18.3998 25.9998L18.4774 16.032L18.3998 0.0910593L-5.28619e-06 0.168629Z" fill="#DE5FE9"></path>
<path d="M-5.28619e-06 0.168629L0.0843098 20.1685L0.151762 36.1683C0.161075 38.3774 1.95947 40.1607 4.16859 40.1514L20.1684 40.084L30.1684 40.0418L31.1852 40.0375C33.3877 40.0282 35.1683 38.2026 35.1683 36V36L37.0003 36L37.0003 39.9992L40.1683 39.9996L39.9996 -9.94653e-07L21.5998 0.0775689L21.6774 16.0185L21.6774 25.9998L20.0774 25.9998L18.3998 25.9998L18.4774 16.032L18.3998 0.0910593L-5.28619e-06 0.168629Z" fill="currentColor"></path>
</svg><a aria-hidden="true" tabindex="-1" href="#uv-备忘清单"><span class="icon icon-link"></span></a>uv 备忘清单</h1><div class="wrap-body">
<p>一个用 Rust 编写的极快的 Python 包和项目管理工具</p>
</div></header><div class="menu-tocs"><div class="menu-btn"><svg aria-hidden="true" fill="currentColor" height="1em" width="1em" viewBox="0 0 16 16" version="1.1" data-view-component="true">
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#安装">安装</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#使用独立安装程序安装">使用独立安装程序安装</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#macos-or-linux">macOS or Linux</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#windows">Windows</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#通过pypi">通过PyPI</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#创建新项目">创建新项目</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#项目的结构">项目的结构</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#管理项目依赖">管理项目依赖</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#添加依赖">添加依赖</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#指定依赖版本或替代来源">指定依赖版本或替代来源</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#从requirementstxt迁移">从requirements.txt迁移</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#删除一个包">删除一个包</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#升级一个包">升级一个包</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#运行脚本">运行脚本</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#构建项目">构建项目</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="安装"><a aria-hidden="true" tabindex="-1" href="#安装"><span class="icon icon-link"></span></a>安装</h2><div class="wrap-body">
</div></div><div class="h2wrap-body"><div class="wrap h3body-exist"><div class="wrap-header h3wrap"><h3 id="使用独立安装程序安装"><a aria-hidden="true" tabindex="-1" href="#使用独立安装程序安装"><span class="icon icon-link"></span></a>使用独立安装程序安装</h3><div class="wrap-body">
</div></div><div class="h2wrap-body"><div class="wrap h3body-exist col-span-2"><div class="wrap-header h3wrap"><h3 id="使用独立安装程序安装"><a aria-hidden="true" tabindex="-1" href="#使用独立安装程序安装"><span class="icon icon-link"></span></a>使用独立安装程序安装</h3><div class="wrap-body">
<!--rehype:wrap-class=col-span-2-->
<h4 id="macos-or-linux"><a aria-hidden="true" tabindex="-1" href="#macos-or-linux"><span class="icon icon-link"></span></a>macOS or Linux</h4>
<pre class="language-sh"><code class="language-sh code-highlight"><span class="code-line"><span class="token function">curl</span> <span class="token parameter variable">-LsSf</span> https://astral.sh/uv/install.sh <span class="token operator">|</span> <span class="token function">sh</span>
</span></code></pre>
@ -66,15 +67,15 @@
</span></code></pre>
<h4 id="项目的结构"><a aria-hidden="true" tabindex="-1" href="#项目的结构"><span class="icon icon-link"></span></a>项目的结构</h4>
<pre class="language-sh"><code class="language-sh code-highlight"><span class="code-line"><span class="token builtin class-name">.</span>
</span><span class="code-line">├── .venv <span class="token comment"># 项目的虚拟环境</span>
</span><span class="code-line">│ ├── bin
</span><span class="code-line">│ ├── lib
</span><span class="code-line">│ └── pyvenv.cfg
</span><span class="code-line">├── .python-version <span class="token comment"># 项目的 Python 版本</span>
</span><span class="code-line">├── README.md
</span><span class="code-line">├── main.py
</span><span class="code-line">├── pyproject.toml <span class="token comment"># 项目的元数据</span>
</span><span class="code-line">└── uv.lock <span class="token comment"># 项目的锁定文件, 用于锁定依赖版本,不应手动编辑</span>
</span><span class="code-line">├── .venv/ <span class="token comment"># 虚拟环境目录</span>
</span><span class="code-line">│ ├── bin/ <span class="token comment"># 可执行文件</span>
</span><span class="code-line">│ ├── lib/ <span class="token comment"># 安装的库</span>
</span><span class="code-line">│ └── pyvenv.cfg <span class="token comment"># 虚拟环境配置</span>
</span><span class="code-line">├── .python-version <span class="token comment"># 指定 Python 版本</span>
</span><span class="code-line">├── README.md <span class="token comment"># 项目说明文档</span>
</span><span class="code-line">├── main.py <span class="token comment"># 主程序入口</span>
</span><span class="code-line">├── pyproject.toml <span class="token comment"># 项目配置与依赖声明</span>
</span><span class="code-line">└── uv.lock <span class="token comment"># 依赖锁定文件(自动生成)</span>
</span></code></pre>
</div></div></div><div class="wrap h3body-exist row-span-2"><div class="wrap-header h3wrap"><h3 id="管理项目依赖"><a aria-hidden="true" tabindex="-1" href="#管理项目依赖"><span class="icon icon-link"></span></a>管理项目依赖</h3><div class="wrap-body">
<!--rehype:wrap-class=row-span-2-->