python / python/cpython

Document what happens when venv is run using existing directory

オープン
#124,113 コメント 6 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

docs topic-venv
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Documentation

Please consider specifying the behavior of venv module when the ENV_DIR already exists, and/or is not empty and/or contains an existing virtual environment. Currently the docs mentions only: “running this command creates the target directory”, and “creates” implies the command should be executed when ENV_DIR is not present [1].

However, I am able to run python -m venv .venv twice, and there is no error. There is no mention in the docs what happens when the directory is already there. Does venv skips creation of virtual environment? Does it try to create it anyways? What if ENV_DIR content is already a virtual environment? What if it is somewhat broken, does venv try to “fix” it?

[1] On the other hand, there are options --clear, --update, --update-deps, and those imply the ENV_DIR should be present. But it contradicts the previous assumption.

Linked PRs
  • gh-151419

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

venv モジュールのドキュメントとリンク先の PR gh-151419 を確認し、その記述を、既存の空でない有効な ENV_DIR ディレクトリおよび壊れた ENV_DIR ディレクトリに対して python -m venv を実行した場合と比較します。完了条件は、ドキュメントでそれらの動作と、--clear、--update、--update-deps がそれらに与える影響を説明していることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
documentation
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。