`Makefile` should ask for confirmation before changing `../cpython`
@mattwang44 がすでに取り組んでいます。
2025年7月5日 から。
評価
この issue はまだ評価されていません。
説明
I ran make all while already having an existing clone of cpython, and even though make detected that, it proceeded to alter it without asking for confirmation:
$ make all
...
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git ../cpython/ || echo "cpython exists"
fatal: destination path '../cpython' already exists and is not an empty directory.
cpython exists
cd ../cpython/ && git checkout 3.10
Switched to branch '3.10'
Your branch is behind 'upstream/3.10' by 339 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
mkdir -p ../cpython//Doc/locales/zh_TW/LC_MESSAGES
for dirname in $(find . -name '*.po' | xargs -n1 dirname | sort -u | grep -v '^\.$'); do mkdir -p ../cpython//Doc/locales/zh_TW/LC_MESSAGES/$dirname; done
for file in *.po */*.po; do ln -f $file ../cpython//Doc/locales/zh_TW/LC_MESSAGES/$file; done
. ~/.venvs/python-docs-i18n//bin/activate; make -C ../cpython//Doc/ SPHINXOPTS='-j4 -D locale_dirs=locales -D language=zh_TW -D gettext_compact=0' autobuild-dev-html
...
Since the cpython clone already had a 3.10 branch, it switched to it and proceeded to copy files even if the branch was outdated.
It eventually failed while trying to build the docs because of a buggy.rst test file I had in the cpython repo:
checking consistency... failed
Warning, treated as error:
../cpython/Doc/buggy.rst:document isn't included in any toctree
make[2]: *** [Makefile:51: build] Error 2
make[2]: Leaving directory '../cpython/Doc'
make[1]: *** [Makefile:231: autobuild-dev-html] Error 2
make[1]: Leaving directory '../cpython/Doc'
make: *** [Makefile:54: all] Error 2
It would be better if the Makefile asked for confirmation before altering an existing clone of cpython, however it would also be useful to distinguish between an existing clone that was there before the first execution, and an existing clone that was there because make all previously created it.
The Makefile should do the following:
- If the
cpythonclone doesn't exist, it could create it without asking for confirmation. - If it exists, it could check if
Doc/locales/zh_TW/LC_MESSAGES/already exists and if the current branch is$(BRANCH)(currently3.10):- if they are, it can assume the clone was previously created by
make alland continue without asking for confirmation; - if they aren't, it either means that the clone already existed, or that it was altered after the creation, and should ask for confirmation before switching branch and creating files;
- if they are, it can assume the clone was previously created by
In addition the Makefile created the venv in ~/.venvs, altering yet another "external" directory. It would be better if it created a .venv dir in the cwd instead. (I can create a separate issue for this.)
- 主要言語
- Python
- スター
- 282
- フォーク
- 226
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/python-docs-zh-tw のほかの issue
-
難易度 2/5 半日 初心者へのやさしさ 68/100
python/python-docs-zh-tw#1241 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
python/python-docs-zh-tw#829 ·
-
Support GEMINI.md オープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
python/python-docs-zh-tw#1218 · リアクション 1 件 ·
-
python/python-docs-zh-tw#1216 · 担当者 1 名 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
python/python-docs-zh-tw#1082 · コメント 3 件 · リアクション 3 件 ·
python/python-docs-zh-tw の issue をすべて見る
似ている issue
-
link-check link-check:sphinx-theme
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
OpenHands/extensions#626 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
CSCfi/sd-search-api#39 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100