about summary refs log tree commit diff
path: root/pkgs/development/python-modules/conda/0001-conda_exe.patch
blob: 12ea4bc5ab0dcd6d478c912b18df1446345ffeb3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -754,7 +754,7 @@

     @property
     def conda_prefix(self):
-        return abspath(sys.prefix)
+        return expand("~/.conda")

     @property
     @deprecated(
@@ -787,28 +787,17 @@
         The vars can refer to each other if necessary since the dict is ordered.
         None means unset it.
         """
-        if context.dev:
-            return {
-                "CONDA_EXE": sys.executable,
-                # do not confuse with os.path.join, we are joining paths with ; or : delimiters
-                "PYTHONPATH": os.pathsep.join(
-                    (CONDA_SOURCE_ROOT, os.environ.get("PYTHONPATH", ""))
-                ),
-                "_CE_M": "-m",
-                "_CE_CONDA": "conda",
-                "CONDA_PYTHON_EXE": sys.executable,
-            }
-        else:
-            bin_dir = "Scripts" if on_win else "bin"
-            exe = "conda.exe" if on_win else "conda"
-            # I was going to use None to indicate a variable to unset, but that gets tricky with
-            # error-on-undefined.
-            return {
-                "CONDA_EXE": os.path.join(sys.prefix, bin_dir, exe),
-                "_CE_M": "",
-                "_CE_CONDA": "",
-                "CONDA_PYTHON_EXE": sys.executable,
-            }
+        import sys
+        return {
+            "CONDA_EXE": sys.executable,
+            # do not confuse with os.path.join, we are joining paths with ; or : delimiters
+            "PYTHONPATH": os.pathsep.join(
+                [CONDA_SOURCE_ROOT, os.environ.get("PYTHONPATH", "")] + [path for path in sys.path if "site-packages" in path]
+            ),
+            "_CE_M": "-m",
+            "_CE_CONDA": "conda",
+            "CONDA_PYTHON_EXE": sys.executable,
+        }

     @memoizedproperty
     def channel_alias(self):