File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,16 +23,19 @@ jobs:
2323 - name : Checkout
2424 uses : actions/checkout@v4
2525
26+ - name : Set up uv
27+ uses : astral-sh/setup-uv@v8
28+
2629 - name : Set up Python
2730 uses : actions/setup-python@v5
2831 with :
29- python-version : " 3.8 "
32+ python-version : " 3.12 "
3033
3134 - name : Configure Pages
3235 uses : actions/configure-pages@v5
3336
3437 - name : Install dependencies
35- run : make install
38+ run : uv sync --python 3.12 --frozen --no- install-project
3639
3740 - name : Build documentation
3841 run : make html
Original file line number Diff line number Diff line change 11.DEFAULT_GOAL := help
22
3- PYENV_PYTHON := $( shell if command -v pyenv >/dev/null 2>&1 && pyenv versions --bare | grep -qx '3.8.13'; then printf 'PYENV_VERSION=3.8.13 pyenv exec python'; fi)
4- PYTHON ?= $( if $( PYENV_PYTHON ) , $( PYENV_PYTHON ) ,python3)
3+ UV ?= uv
4+ PYTHON_VERSION ?= 3.12
55VENV ?= .venv
66PORT ?= 8005
77
@@ -16,7 +16,7 @@ DOC_TARGETS := dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex
1616
1717help :
1818 @echo " Please use \` make <target>' where <target> is one of"
19- @echo " install create $( VENV) and install dependencies"
19+ @echo " install create $( VENV) with uv and install dependencies"
2020 @echo " html build standalone HTML files"
2121 @echo " serve build and serve docs at http://localhost:$( PORT) /"
2222 @echo " clean remove generated documentation files"
2525
2626install : $(INSTALL_STAMP )
2727
28- $(INSTALL_STAMP ) : requirements.txt
29- @test -n " $( PYTHON) " || (echo " python3 is required" && exit 1)
30- $(PYTHON ) -m venv $(VENV )
31- $(VENV_PYTHON ) -m pip install --upgrade pip
32- $(VENV_PYTHON ) -m pip install -r requirements.txt
28+ $(INSTALL_STAMP ) : pyproject.toml uv.lock Makefile
29+ @command -v $(UV ) > /dev/null 2>&1 || (echo " uv is required. Install it from https://docs.astral.sh/uv/" && exit 1)
30+ $(UV ) sync --python $(PYTHON_VERSION ) --frozen --no-install-project
3331 @touch $(INSTALL_STAMP )
3432
3533build : html
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Python最佳实践指南中文版
1414
1515项目翻译来自 `Hitchhiker's Guide to Python <https://github.com/kennethreitz/python-guide >`_。
1616
17- GitHub Pages 文档地址 `Python最佳实践指南中文版 <https://prodesire.github.io/Python-Guide-CN/ >`_。
17+ 文档地址 `Python最佳实践指南中文版 <https://prodesire.github.io/Python-Guide-CN/ >`_。
1818
1919-----------
2020
@@ -37,22 +37,14 @@ GitHub Pages 文档地址 `Python最佳实践指南中文版 <https://prodesire.
3737- 测试: Jenkins & tox 指南
3838- 如何更方便地通过 ``git `` 连接 ``hg ``
3939
40- 如果您不习惯阅读reStructuredText形式的文档, 这里有一份同步更新的 `HTML版文档,请戳它 <https://prodesire.github.io/Python-Guide-CN/ >`_。
41-
42-
4340使用指南
4441============================
45421. 下载zip文件或clone到本地,并进入到项目根目录
46432. 打开命令行,运行 ``make help `` 查看可用命令
47- 3. 打开命令行,运行 ``make install `` 创建虚拟环境并安装依赖
44+ 3. 打开命令行,运行 ``make install `` 使用 uv 根据 `` pyproject.toml `` 创建虚拟环境并安装依赖
48454. 打开命令行,运行 ``make html `` 构建文档;或运行 ``make serve `` 构建并启动本地文档网站
49465. ``make html `` 会在 ``docs/_build/html `` 中生成 HTML 文件,``make serve `` 默认会在 ``http://localhost:8005/ `` 运行文档网站
5047
51- 或者
52- ---------------------------
53- - 直接访问 `Python最佳实践指南中文版 <https://prodesire.github.io/Python-Guide-CN/ >`_。
54-
55-
5648翻译指南
5749============================
58501. 将 `python-guide <https://github.com/kennethreitz/python-guide >`_ 项目和本项目的master分支更新
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -23,10 +23,7 @@ Python-guide目前还在开发中,欢迎大家贡献代码。
2323要做的事
2424*********
2525
26- 如果您想为我们做些贡献,这里有我们的计划。一个简短的 todo _ 列表。
27-
28- .. include :: ../../TODO.rst
26+ 如果您想为我们做些贡献,请查看 GitHub _ 上的 issue 列表。
2927
3028
3129.. _GitHub : https://github.com/kennethreitz/python-guide/
32- .. _todo : https://github.com/kennethreitz/python-guide/blob/master/TODO.rst
Original file line number Diff line number Diff line change 1+ [project ]
2+ name = " python-guide-cn"
3+ version = " 0.0.0"
4+ description = " Chinese translation of The Hitchhiker's Guide to Python"
5+ requires-python = " >=3.12"
6+ dependencies = [
7+ " sphinx>=7.4,<8" ,
8+ " sphinx-sitemap>=2.9,<3" ,
9+ " sphinxcontrib-websupport>=2,<3" ,
10+ ]
11+
12+ [tool .uv ]
13+ package = false
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments