summaryrefslogtreecommitdiffstats
path: root/Lib/venv
Commit message (Collapse)AuthorAgeFilesLines
* GH-127724: don't use sysconfig to calculate the venv local include path ↵Filipe Laíns 🇵🇸2024-12-121-3/+12
| | | | (#127731)
* gh-124651: Quote template strings in `venv` activation scripts (GH-124712)Y52024-10-215-21/+53
| | | | This patch properly quotes template strings in `venv` activation scripts. This mitigates potential command injection.
* gh-125398: Convert paths in venv activate script when using Git Bash under ↵Julien2024-10-191-2/+2
| | | | | | | | | | | | | | Windows (GH-125399) * Convert paths in venv activate script when using Git Bash under Windows With https://github.com/python/cpython/pull/112508 the check to converts paths when running on Windows was changed from using the non-posix environment variable `$OSTYPE` to using `uname` instead. However this missed the fact that when running under Git Bash on Windows, uname reports `MINGW*` (`$OSTYPE` is still `msys`). This results in `$PATH` being set to something like `D:\a\github-actions-shells\github-actions-shells\venv/Scripts:…`, instead of `/d/a/github-actions-shells/github-actions-shells/venv/Scripts`. Notably, the Git Bash is the bash shell that’s used for GitHub Actions Windows runners, and ships with VSCode.
* gh-119535: Support 𝜋thon in Python 3.14 venvs (#125035)foreignmeloman2024-10-151-1/+1
|
* Trivial change: Update comments in activate about what running hash -r does ↵Andrew Athan2024-10-131-2/+3
| | | | | | | (GH-125385) Update comments about what running hash -r does The old comment said "hash -r" forgets "past commands." However, the documentation for "hash" states that it forgets past locations. The old comment was, in my opinion, confusing. This is because it could be interpreted to mean it does something to the command history (HISTORY/HISTFILE etc) vs the cache of locations.
* gh-91818: Use default program name in the CLI of many modules (GH-124867)Serhiy Storchaka2024-10-091-2/+1
| | | | | | As argparse now detects by default when the code was run as a module. This leads to using the actual executable name instead of simply "python" to display in the usage message ("usage: python -m ...").
* gh-119535: python𝜋 (#119536)Shantanu2024-10-061-2/+5
| | | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-124212: Fix undefined variable in error message in venv (GH-124211)Jacek2024-09-181-1/+1
|
* gh-122765: make prompt in activate.csh robust against unbalanced quotes and ↵Jacek2024-09-171-1/+1
| | | | newlines (GH-123751)
* gh-90329: Add _winapi.GetLongPathName and GetShortPathName and use in venv ↵Steve Dower2024-04-151-1/+28
| | | | to reduce warnings (GH-117817)
* gh-112571: Move fish venv activation script into the common folder (GH-117169)Totally a booplicate2024-03-241-0/+0
| | | | | | | pythongh-112571: allow using fish venv activation script on windows The fish shell can be used on windows under cygwin or msys2. This change moves the script to the common folder so the venv module will install it on both posix and nt systems (like the bash script).
* Update venv activate.bat to escape custom PROMPT variables on Windows ↵GILGAMESH2024-02-021-2/+2
| | | | (GH-114885)
* gh-89427: Provide the original prompt value for VIRTUAL_ENV_PROMPT (GH-106726)Jim Porter2024-01-235-6/+5
| | | | | | | | | | This improves the implementation in gh-106643. Previously, venv passed "(<prompt>) " to the activation scripts, but we want to provide the original value so that users can inspect it in the $VIRTUAL_ENV_PROMPT env var. Note: Lib/venv/scripts/common/Activate.ps1 surrounded the prompt value with parens a second time, so no change was necessary in that file.
* gh-112984 Update Windows build and installer for free-threaded builds ↵Steve Dower2024-01-171-103/+155
| | | | (GH-113129)
* gh-112507: Detect Cygwin and MSYS with `uname` instead of `$OSTYPE` (GH-112508)James Morris2023-12-111-8/+12
| | | | | | Detect Cygwin and MSYS with `uname` instead of `$OSTYPE` `$OSTYPE` is not defined by POSIX and may not be present in other shells. `uname` is always available in any shell.
* gh-112431: Unconditionally call `hash -r` (GH-112432)James Morris2023-11-281-10/+4
| | | | | | | | | The `activate` script calls `hash -r` in two places to make sure the shell picks up the environment changes the script makes. Before that, it checks to see if the shell running the script is bash or zsh. `hash -r` is specified by POSIX and is not exclusive to bash and zsh. This guard prevents the script from calling `hash -r` in other `#!/bin/sh`-compatible shells like dash.
* gh-112252: Fix error on unset $OSNAME in venv/activate (GH-112253)James Turk2023-11-211-1/+1
|
* GH-83417: Allow `venv` to add a `.gitignore` file to environments via a new ↵Brett Cannon2023-09-152-5/+33
| | | | | | | | `scm_ignore_file` parameter (GH-108125) This feature is off by default via code but on by default via the CLI. The `.gitignore` file contains `*` which causes the entire directory to be ignored. Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-89427: Set VIRTUAL_ENV_PROMPT even when VIRTUAL_ENV_DISABLE_PROMPT… ↵Jim Porter2023-07-134-5/+7
| | | | (GH-106643)
* gh-95299: Stop installing setuptools as a part of ensurepip and venv (#101039)Pradyun Gedam2023-04-181-2/+2
| | | | | | | Remove the bundled setuptools wheel from ensurepip, and stop installing setuptools in environments created by venv. Co-Authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
* gh-103088: Ensure POSIX venv scripts always use LF line endings (GH-103591)Steve Dower2023-04-173-2/+3
| | | Also touches the affected files in meaningless ways to ensure they get updated when pulling
* gh-103088: Sanitize venv paths when using MSYS or Cygwin Bash (GH-103325)Stanislav Syekirin2023-04-111-2/+9
|
* gh-100676: Improve description for venv --upgrade-deps (GH-100678)Rupa Lahiri2023-01-021-1/+1
|
* gh-100176: venv: Remove redundant compat code for Python <= 3.2 (#100177)Hugo van Kemenade2022-12-141-78/+71
| | | | | | | | | | gh-100176: Remove redundant compat code for Python 3.2 and older Python 3.2 has been EOL since 2016-02-20 and 2.7 since 2020-01-01, so we can remove this old compatibility check and unindent the old else-block. Also, in the unindented block, replace a .format() call with an f-string. Plus similar changes in the documentation.
* gh-98741: Remove useless check_home usage from is_python_build usage (GH-98743)Henry Schreiner2022-10-261-3/+3
|
* gh-98251: Allow venv to pass along PYTHON* variables to pip and ensurepip ↵Steve Dower2022-10-141-9/+19
| | | | when they do not impact path resolution (GH-98259)
* gh-96861: Check for unset sys.executable during venv creation. (GH-96887)Vinay Sajip2022-09-171-0/+5
|
* gh-93858: Prevent error when activating venv in nested fish instances (GH-93931)Thomas B. Brunner2022-06-271-3/+6
|
* gh-94214: Add venv context.lib_path and document the context (GH-94221)Paul Moore2022-06-261-0/+1
|
* gh-92675: venv: Fix ensure_directories() to again accept a Path for env_dir ↵David Foster2022-05-191-1/+1
| | | | | | | (#92676) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* bpo-43218: Prevent venv creation when the target directory contains a PATH ↵Dustin Rodrigues2022-04-131-0/+3
| | | | separator. (GH-24530)
* bpo-45413: Define "posix_venv", "nt_venv" and "venv" sysconfig installation ↵Miro Hrončok2022-03-181-14/+17
| | | | | | | | | | | | | | | | | | | schemes (GH-31034) Define *posix_venv* and *nt_venv* sysconfig installation schemes to be used for bootstrapping new virtual environments. Add *venv* sysconfig installation scheme to get the appropriate one of the above. The schemes are identical to the pre-existing *posix_prefix* and *nt* install schemes. The venv module now uses the *venv* scheme to create new virtual environments instead of hardcoding the paths depending only on the platform. Downstream Python distributors customizing the *posix_prefix* or *nt* install scheme in a way that is not compatible with the install scheme used in virtual environments are encouraged not to customize the *venv* schemes. When Python itself runs in a virtual environment, sysconfig.get_default_scheme and sysconfig.get_preferred_scheme with `key="prefix"` returns *venv*.
* bpo-41011: venv -- add more variables to pyvenv.cfg (GH-30382)andrei kulakov2022-01-071-0/+24
|
* bpo-45337: Use the realpath of the new executable when creating a venv on ↵Steve Dower2021-10-071-7/+17
| | | | Windows (GH-28663)
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-061-1/+1
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216)Ian Norton2021-05-191-2/+3
| | | Automerge-Triggered-By: GH:vsajip
* bpo-35328: Set VIRTUAL_ENV_PROMPT at venv activation (GH-21587)Zackery Spytz2020-07-286-1/+15
| | | Co-Authored-By: Baptiste Darthenay <baptiste.darthenay@gmail.com>
* bpo-38972: Fix typos in PowerShell Execution Policies links (GH-20383)Miro Hrončok2020-05-251-1/+1
|
* Fix the URL to fishshell.com (GH-20251)Jonathan Goble2020-05-201-1/+1
|
* bpo-38972: Link to instructions to change PowerShell execution policy (GH-19131)Derek Keeler2020-04-021-4/+15
|
* bpo-39656: Ensure `bin/python3.#` is always present in virtual environments ↵Anthony Sottile2020-03-171-1/+1
| | | | on POSIX (GH-19030)
* bpo-39505: delete the redundant '/' in $env:VIRTUAL_ENV (GH-18290)schwarzichet2020-02-051-1/+0
|
* bpo-38901: Allow setting a venv's prompt to the basename of the current ↵Vinay Sajip2020-01-141-0/+2
| | | | | | directory. (GH-17946) When a prompt value of '.' is specified, os.path.basename(os.getcwd()) is used to configure the prompt for the created venv.
* venv: Suppress warning message when bash hashing is disabled. (GH-17966)Dima2020-01-141-2/+2
| | | | | | | | | | | | | When using python's built-in venv activaton script warnings are printed when hashing is disabled in bash or zsh, like; `bash: hash: hashing disabled` This output is not really useful to the end-user and has been disabled in `virtualenv` for long. This commit is based on: https://github.com/pypa/virtualenv/commit/28e85bcd80d04b2a7ebce0e1d0b02d432b7e5593
* Fix old mention of virtualenv (GH-17417)Brett Cannon2019-11-291-1/+1
| | | Automerge-Triggered-By: @brettcannon
* bpo-38927: Use python -m pip to upgrade venv deps (GH-17403)Tzu-ping Chung2019-11-271-3/+3
| | | I suggest you add `bpo-NNNNN: ` as a prefix for the first commit for future PRs. Thanks!
* bpo-38899: virtual environment activation for fish should use `source` ↵Brett Cannon2019-11-231-2/+2
| | | | | | | | | | | | (GH-17359) The previously documented use of `.` is considered deprecated (https://fishshell.com/docs/current/commands.html#source). https://bugs.python.org/issue38899 Automerge-Triggered-By: @brettcannon
* bpo-38344: Fix syntax in activate.bat (GH-16533)James Abel2019-10-071-1/+1
|
* bpo-37885: venv: Don't produce unbound variable warning on deactivate (GH-15330)Daniel Abrahamsson2019-09-111-1/+1
| | | | | | | | | | Before, running deactivate from a bash shell configured to treat undefined variables as errors (`set -u`) would produce a warning: ``` $ python3 -m venv test $ source test/bin/activate (test) $ deactivate -bash: $1: unbound variable ```
* bpo-36634: Fixes activate.bat when existing values contain double quotes ↵Steve Dower2019-09-111-25/+13
| | | | (GH-15924)