Skip to content

Commit 913c8f4

Browse files
authored
Update conda to 25.7.0 (#185)
* Update to 25.7.0 * Add news file * Update hash * Rebase patch * Add patch to use default=NULL for --override-frozen * Update build scripts
1 parent e7760fd commit 913c8f4

File tree

6 files changed

+103
-38
lines changed

6 files changed

+103
-38
lines changed

news/185-update-conda-25.7.0

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### Enhancements
2+
3+
* Bump `conda` to `25.7.0`. (#185)
4+
5+
### Bug fixes
6+
7+
* <news item>
8+
9+
### Deprecations
10+
11+
* <news item>
12+
13+
### Docs
14+
15+
* <news item>
16+
17+
### Other
18+
19+
* <news item>

recipe/bld.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ RENAME "%SP_DIR%\conda\cli\main_run.py" main_run.py.bak || goto :error
1616
COPY conda_src\conda\cli\main_run.py "%SP_DIR%\conda\cli\main_run.py" || goto :error
1717
RENAME "%SP_DIR%\conda\activate.py" activate.py.bak || goto :error
1818
COPY conda_src\conda\activate.py "%SP_DIR%\conda\activate.py" || goto :error
19+
RENAME "%SP_DIR%\conda\cli\helpers.py" helpers.py.bak || goto :error
20+
COPY conda_src\conda\cli\helpers.py "%SP_DIR%\conda\cli\helpers.py" || goto :error
1921

2022
:: we need these for noarch packages with entry points to work on windows
2123
COPY "conda_src\conda\shell\cli-%ARCH%.exe" entry_point_base.exe || goto :error

recipe/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ for fname in \
1111
"core/path_actions.py" \
1212
"deprecations.py" \
1313
"utils.py" \
14+
"cli/helpers.py" \
1415
; do
1516
mv "$SP_DIR/conda/${fname}" "$SP_DIR/conda/${fname}.bak"
1617
cp "conda_src/conda/${fname}" "$SP_DIR/conda/${fname}"

recipe/meta.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set conda_version = "25.5.1" %}
1+
{% set conda_version = "25.7.0" %}
22
{% set conda_libmamba_solver_version = "25.4.0" %}
33
{% set libmambapy_version = "2.0.5" %}
44
{% set constructor_lower_bound = "3.12.1" %}
@@ -14,7 +14,7 @@ source:
1414
- path: ../
1515

1616
- url: https://github.com/conda/conda/archive/{{ conda_version }}.tar.gz
17-
sha256: 916ef440fd4344214bea523480e9b20dfb41576d5d6cdbe6eb2282708e498e85
17+
sha256: 18ffef053c4f14db42870f36fab8df162dea5cb14a022a24abb1a3822ef3874c
1818
folder: conda_src
1919
# NOTE: All files affected by a patch need to be manually copied
2020
# from src to PREFIX in build.sh and bld.bat
@@ -23,6 +23,7 @@ source:
2323
- ../src/conda_patches/0002-Manipulate-PATH-directly-instead-of-_call_ing-conda.patch
2424
- ../src/conda_patches/0003-Restrict-search-paths.patch
2525
- ../src/conda_patches/0004-Fix-conda-run.patch
26+
- ../src/conda_patches/0005-Use-default-NULL-for-override-frozen.patch
2627

2728
build:
2829
number: 0
@@ -35,8 +36,8 @@ build:
3536
- '*'
3637
missing_dso_whitelist: # [osx and variant == 'onedir']
3738
- "$RPATH/libswift*.dylib" # [osx and variant == 'onedir']
38-
rpaths: # [variant == 'onedir' and linux]
39-
- standalone_conda/_internal # [variant == 'onedir' and linux]
39+
rpaths: # [linux and variant == 'onedir']
40+
- standalone_conda/_internal # [linux and variant == 'onedir']
4041
overlinking_ignore_patterns: # [win and variant == 'onedir']
4142
- '*' # [win and variant == 'onedir']
4243
script_env:

src/conda_patches/0004-Fix-conda-run.patch

Lines changed: 49 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
diff --git i/conda/__init__.py w/conda/__init__.py
2-
index a9970a7a3..a4cf9f0ac 100644
3-
--- i/conda/__init__.py
4-
+++ w/conda/__init__.py
5-
@@ -61,8 +61,11 @@ if os.getenv("CONDA_ROOT") is None:
1+
From 16646a6e08867b48d9f98a7aa0082333fbc0f118 Mon Sep 17 00:00:00 2001
2+
From: jaimergp <jaimergp@users.noreply.github.com>
3+
Date: Wed, 27 Aug 2025 15:45:55 +0200
4+
Subject: [PATCH] Fix conda run
5+
6+
Co-authored-by: Jaida Rice <jaidarice@gmail.com>
7+
8+
---
9+
10+
diff --git a/conda/__init__.py b/conda/__init__.py
11+
index 3abf5c0da7241d6267b6dd2609fa7f28d4813be5..3805975b1afa0afc528b3d628895836f9905534a 100644
12+
--- a/conda/__init__.py
13+
+++ b/conda/__init__.py
14+
@@ -59,8 +59,11 @@ if os.getenv("CONDA_ROOT") is None:
615
os.environ["CONDA_ROOT"] = sys.prefix
7-
16+
817
#: The conda package directory.
918
-CONDA_PACKAGE_ROOT = abspath(dirname(__file__))
1019
-#: The path within which to find the conda package.
@@ -16,56 +25,62 @@ index a9970a7a3..a4cf9f0ac 100644
1625
#:
1726
#: If `conda` is statically installed this is the site-packages. If `conda` is an editable install
1827
#: or otherwise uninstalled this is the git repo.
19-
diff --git i/conda/activate.py w/conda/activate.py
20-
index f3b658470..c406eed9c 100644
21-
--- i/conda/activate.py
22-
+++ w/conda/activate.py
23-
@@ -755,6 +755,8 @@ class _Activator(metaclass=abc.ABCMeta):
28+
diff --git a/conda/activate.py b/conda/activate.py
29+
index 8b9f17e06d3b2cef8a8804a1c292d3447a4cbcd1..03656c460ec8002097feba19465729a80593cbb9 100644
30+
--- a/conda/activate.py
31+
+++ b/conda/activate.py
32+
@@ -772,6 +772,8 @@ class _Activator(metaclass=abc.ABCMeta):
2433
return ""
25-
34+
2635
def _get_activate_scripts(self, prefix):
2736
+ if prefix is None:
2837
+ return ()
2938
_script_extension = self.script_extension
3039
se_len = -len(_script_extension)
3140
try:
32-
@@ -769,6 +771,8 @@ class _Activator(metaclass=abc.ABCMeta):
41+
@@ -786,6 +788,8 @@ class _Activator(metaclass=abc.ABCMeta):
3342
)
34-
43+
3544
def _get_deactivate_scripts(self, prefix):
3645
+ if prefix is None:
3746
+ return ()
3847
_script_extension = self.script_extension
3948
se_len = -len(_script_extension)
4049
try:
41-
diff --git i/conda/base/context.py w/conda/base/context.py
42-
index 34a5e6495..9ac146b2b 100644
43-
--- i/conda/base/context.py
44-
+++ w/conda/base/context.py
45-
@@ -835,6 +835,8 @@ class Context(Configuration):
50+
diff --git a/conda/base/context.py b/conda/base/context.py
51+
index a8f56f30680d79decfb0e85a9e1ae94257c1c02d..4801003fe35e13209f2a4c27c490efb269c8a592 100644
52+
--- a/conda/base/context.py
53+
+++ b/conda/base/context.py
54+
@@ -846,6 +846,8 @@ class Context(Configuration):
4655
addendum="Please use `conda.base.context.context.conda_exe_vars_dict` instead",
4756
)
4857
def conda_exe(self) -> PathType:
4958
+ if getattr(sys, "_MEIPASS", None):
5059
+ return sys.executable
5160
exe = "conda.exe" if on_win else "conda"
5261
return join(self.conda_prefix, BIN_DIRECTORY, exe)
53-
54-
@@ -870,9 +872,8 @@ class Context(Configuration):
55-
"CONDA_PYTHON_EXE": sys.executable,
62+
63+
@@ -885,14 +887,9 @@ class Context(Configuration):
64+
"_CONDA_ROOT": self.conda_prefix,
5665
}
5766
else:
58-
- exe = "conda.exe" if on_win else "conda"
67+
- exe = os.path.join(
68+
- self.conda_prefix,
69+
- BIN_DIRECTORY,
70+
- "conda.exe" if on_win else "conda",
71+
- )
5972
return {
60-
- "CONDA_EXE": os.path.join(sys.prefix, BIN_DIRECTORY, exe),
73+
- "CONDA_EXE": exe,
74+
- "_CONDA_EXE": exe,
6175
+ "CONDA_EXE": sys.executable,
76+
+ "_CONDA_EXE": sys.executable,
6277
"_CE_M": None,
6378
"_CE_CONDA": None,
6479
"CONDA_PYTHON_EXE": sys.executable,
65-
diff --git i/conda/cli/main_run.py w/conda/cli/main_run.py
66-
index dc7464662..767fed20d 100644
67-
--- i/conda/cli/main_run.py
68-
+++ w/conda/cli/main_run.py
80+
diff --git a/conda/cli/main_run.py b/conda/cli/main_run.py
81+
index dc74646620234e206519c26b1e798f96a11a6bd7..767fed20d7f6ccd1032a60caca7ee332c1d0a454 100644
82+
--- a/conda/cli/main_run.py
83+
+++ b/conda/cli/main_run.py
6984
@@ -88,11 +88,19 @@ def configure_parser(sub_parsers: _SubParsersAction, **kwargs) -> ArgumentParser
7085
def execute(args: Namespace, parser: ArgumentParser) -> int:
7186
from ..base.context import context
@@ -76,7 +91,7 @@ index dc7464662..767fed20d 100644
7691
from ..gateways.disk.delete import rm_rf
7792
from ..gateways.subprocess import subprocess_call
7893
from ..utils import wrap_subprocess_call
79-
94+
8095
+ if paths_equal(context.target_prefix, sys.prefix):
8196
+ raise ArgumentError(
8297
+ "Cannot use 'conda run' on conda-standalone's base environment; "
@@ -86,14 +101,14 @@ index dc7464662..767fed20d 100644
86101
prefix_data = PrefixData.from_context()
87102
prefix_data.assert_environment()
88103
# create run script
89-
diff --git i/conda/utils.py w/conda/utils.py
90-
index b9a3cc5cc..515622286 100644
91-
--- i/conda/utils.py
92-
+++ w/conda/utils.py
104+
diff --git a/conda/utils.py b/conda/utils.py
105+
index b9a3cc5cce027cf38a92efaf6bc81bfaf6d1bd15..515622286f946b4f780da5ecac8812bbb8a87739 100644
106+
--- a/conda/utils.py
107+
+++ b/conda/utils.py
93108
@@ -13,7 +13,7 @@ from os.path import abspath, basename, dirname, isfile, join
94109
from pathlib import Path
95110
from shutil import which
96-
111+
97112
-from . import CondaError
98113
+from . import CONDA_PACKAGE_ROOT, CondaError
99114
from .auxlib.compat import Utf8NamedTemporaryFile, shlex_split_unicode
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 42ed3ab04aca688cb4081aea5db590e40d0852d6 Mon Sep 17 00:00:00 2001
2+
From: Jaida Rice <jaidarice@gmail.com>
3+
Date: Thu, 4 Sep 2025 16:40:26 -0700
4+
Subject: [PATCH] Use default=NULL for --override-frozen
5+
6+
---
7+
conda/cli/helpers.py | 3 +++
8+
1 file changed, 3 insertions(+)
9+
10+
diff --git a/conda/cli/helpers.py b/conda/cli/helpers.py
11+
index cab249d54..4c4512147 100644
12+
--- a/conda/cli/helpers.py
13+
+++ b/conda/cli/helpers.py
14+
@@ -239,9 +239,12 @@ def add_output_and_prompt_options(p: ArgumentParser) -> _ArgumentGroup:
15+
16+
17+
def add_parser_frozen_env(p: ArgumentParser):
18+
+ from ..common.constants import NULL
19+
+
20+
p.add_argument(
21+
"--override-frozen",
22+
action="store_false",
23+
+ default=NULL,
24+
help="DANGEROUS. Use at your own risk. Ignore protections if the environment is frozen.",
25+
dest="protect_frozen_envs",
26+
)
27+
--

0 commit comments

Comments
 (0)