This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: On Windows, build scripts should prefer using python.exe from an active virtual env
Type: enhancement Stage: resolved
Components: Build, Windows Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: miss-islington, paul.moore, steve.dower, taleinat, tim.golden, zach.ware
Priority: normal Keywords: patch

Created on 2019-11-15 07:23 by taleinat, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17164 merged taleinat, 2019-11-15 07:29
PR 17237 merged miss-islington, 2019-11-18 17:32
PR 17238 merged miss-islington, 2019-11-18 17:32
Messages (4)
msg356649 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2019-11-15 07:23
On windows several .bat scripts call find_python.bat to find an appropriate python.exe. find_python.bat has no specific support for virtual envs, and usually ends up calling py.exe to find python.exe. Due to virtual envs not including a py.exe, this effectively ignores having an activated virtual env.

It is currently possible to build with the specific python that one wants by setting the PYTHON env var. However, this is a simplistic and non-standard solution compared to virtual envs.

IMO when there is an active virtual env, these scripts should certainly use python.exe from it!
msg356889 - (view) Author: miss-islington (miss-islington) Date: 2019-11-18 17:32
New changeset ee703cbb418b7458bebb1d26a5e19d6b55280b28 by Miss Islington (bot) (Tal Einat) in branch 'master':
bpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)
https://github.com/python/cpython/commit/ee703cbb418b7458bebb1d26a5e19d6b55280b28
msg356890 - (view) Author: miss-islington (miss-islington) Date: 2019-11-18 17:53
New changeset 2b928d9bf75d82b86dc3b4fcbc243d36a7958f4c by Miss Islington (bot) in branch '3.7':
bpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)
https://github.com/python/cpython/commit/2b928d9bf75d82b86dc3b4fcbc243d36a7958f4c
msg356891 - (view) Author: miss-islington (miss-islington) Date: 2019-11-18 17:53
New changeset cbbf1098f383e575d93841e555329eb66283c2f1 by Miss Islington (bot) in branch '3.8':
bpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)
https://github.com/python/cpython/commit/cbbf1098f383e575d93841e555329eb66283c2f1
History
Date User Action Args
2022-04-11 14:59:23adminsetgithub: 82990
2019-11-18 17:54:12taleinatsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-11-18 17:53:24miss-islingtonsetmessages: + msg356891
2019-11-18 17:53:17miss-islingtonsetmessages: + msg356890
2019-11-18 17:32:50miss-islingtonsetpull_requests: + pull_request16738
2019-11-18 17:32:41miss-islingtonsetpull_requests: + pull_request16737
2019-11-18 17:32:35miss-islingtonsetnosy: + miss-islington
messages: + msg356889
2019-11-15 08:27:26taleinatsetnosy: + paul.moore, tim.golden, steve.dower, zach.ware
components: + Windows
2019-11-15 08:27:18taleinatsetassignee: docs@python ->

nosy: - docs@python
2019-11-15 07:29:15taleinatsetkeywords: + patch
stage: patch review
pull_requests: + pull_request16674
2019-11-15 07:23:55taleinatsetcomponents: + Build, - Documentation
2019-11-15 07:23:46taleinatcreate