fix(python): Read venv prompt from pyvenv.cfg (#1747)

*  Add  --prompt rendering to python virtualenv

* Use pyvenv.cfg to find prompt

* Remove usage of VIRTUAL_ENV_PROMPT variable

Seeing how both venv and virtualenv set a pyvenv.cfg, this isn't needed.
Additionally pyvenv.cfg is set in earlier versions than VIRTUAL_ENV_PROMPT,
which at this moment is in the unrelased python 3.10

* Smarter result unwrapping thanks to clippy
This commit is contained in:
Tomer
2020-10-08 10:58:00 +03:00
committed by GitHub
parent 7c941af11a
commit a9f6d0f81e
3 changed files with 89 additions and 5 deletions
Generated
+46 -1
View File
@@ -1,5 +1,11 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "ahash"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0adac150c2dd5a9c864d054e07bda5e6bc010cd10036ea5f17e82a2f5867f735"
[[package]]
name = "aho-corasick"
version = "0.7.13"
@@ -333,6 +339,15 @@ dependencies = [
"winapi",
]
[[package]]
name = "dlv-list"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b391911b9a786312a10cb9d2b3d0735adfd5a8113eb3648de26a75e91b0826c"
dependencies = [
"rand",
]
[[package]]
name = "doc-comment"
version = "0.3.3"
@@ -430,6 +445,15 @@ dependencies = [
"autocfg",
]
[[package]]
name = "hashbrown"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
dependencies = [
"ahash",
]
[[package]]
name = "hermit-abi"
version = "0.1.15"
@@ -468,7 +492,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b45e59b16c76b11bf9738fd5d38879d3bd28ad292d7b313608becb17ae2df9"
dependencies = [
"autocfg",
"hashbrown",
"hashbrown 0.8.2",
]
[[package]]
@@ -787,6 +811,16 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "ordered-multimap"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87a6df8506c2d359d5105344891f283e8e7ef81a7c6a542d516f8707e4a09b6b"
dependencies = [
"dlv-list",
"hashbrown 0.9.1",
]
[[package]]
name = "os_info"
version = "3.0.0"
@@ -1020,6 +1054,16 @@ dependencies = [
"crossbeam-utils",
]
[[package]]
name = "rust-ini"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcdbf249a931ceb503aa80e08ca016675dbc7884eda8e2d88e85533d4dbade62"
dependencies = [
"cfg-if",
"ordered-multimap",
]
[[package]]
name = "ryu"
version = "1.0.5"
@@ -1153,6 +1197,7 @@ dependencies = [
"rand",
"rayon",
"regex",
"rust-ini",
"serde_json",
"shell-words",
"starship_module_config_derive",