diff --git a/0001-Use-main-entry-point-for-conda-and-re-add-conda-env-.patch b/0001-Use-main-entry-point-for-conda-and-re-add-conda-env-.patch new file mode 100644 index 0000000..c655aa9 --- /dev/null +++ b/0001-Use-main-entry-point-for-conda-and-re-add-conda-env-.patch @@ -0,0 +1,27 @@ +From b5f226ef5dd81dec3b01f58e22c252a27a84e515 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Sun, 8 Oct 2023 19:51:26 -0600 +Subject: [PATCH] Use main entry point for conda and re-add conda-env entry + point, no need to run conda init + +--- + pyproject.toml | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 2c897d3..1abe369 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -49,7 +49,8 @@ documentation = "https://docs.conda.io/projects/conda/en/stable/" + repository = "https://github.com/conda/conda" + + [project.scripts] +-conda = "conda.cli.main_pip:main" ++conda = "conda.cli.main:main" ++conda-env = "conda_env.cli.main:main" + + [tool.hatch.version] + source = "vcs" +-- +2.42.0 + diff --git a/0002-Use-main-entry-point-for-conda-and-re-add-conda-env-.patch b/0002-Use-main-entry-point-for-conda-and-re-add-conda-env-.patch deleted file mode 100644 index 3d3d298..0000000 --- a/0002-Use-main-entry-point-for-conda-and-re-add-conda-env-.patch +++ /dev/null @@ -1,26 +0,0 @@ -From f8f9a23a2a7540ec39cab9606f8b95aa8b346b65 Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Mon, 24 Nov 2025 17:30:20 -0700 -Subject: [PATCH 2/2] Use main entry point for conda and re-add conda-env entry - ---- - pyproject.toml | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/pyproject.toml b/pyproject.toml -index 7c8f24f..049859b 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -51,7 +51,8 @@ readme = "README.md" - requires-python = ">=3.10" - - [project.scripts] --conda = "conda.cli.main_pip:main" -+conda = "conda.cli.main:main" -+conda-env = "conda_env.cli.main:main" - - [project.urls] - changelog = "https://github.com/conda/conda/blob/main/CHANGELOG.md" --- -2.51.1 - diff --git a/0004-Do-not-try-to-run-usr-bin-python.patch b/0004-Do-not-try-to-run-usr-bin-python.patch index f747eb0..197eb23 100644 --- a/0004-Do-not-try-to-run-usr-bin-python.patch +++ b/0004-Do-not-try-to-run-usr-bin-python.patch @@ -1,15 +1,16 @@ -diff -up conda-24.9.1/conda/common/path/python.py.python conda-24.9.1/conda/common/path/python.py ---- conda-24.9.1/conda/common/path/python.py.python 2024-10-01 15:11:32.000000000 -0600 -+++ conda-24.9.1/conda/common/path/python.py 2024-10-07 21:43:44.951895698 -0600 -@@ -5,6 +5,7 @@ - from __future__ import annotations - +diff --git a/conda/common/path.py b/conda/common/path.py +index 32ed396..76bc20a 100644 +--- a/conda/common/path.py ++++ b/conda/common/path.py +@@ -5,6 +5,7 @@ from __future__ import annotations + import os import re + import subprocess +import sys + from functools import lru_cache, reduce + from itertools import accumulate, chain from logging import getLogger - from os.path import join, split, splitext - -@@ -52,9 +53,11 @@ def parse_entry_point_def(ep_definition) +@@ -175,9 +176,11 @@ def parse_entry_point_def(ep_definition): def get_python_short_path(python_version=None): if on_win: return "python.exe" diff --git a/0006-shell-assume-shell-plugins-are-in-etc.patch b/0006-shell-assume-shell-plugins-are-in-etc.patch index 68c60df..b7710f9 100644 --- a/0006-shell-assume-shell-plugins-are-in-etc.patch +++ b/0006-shell-assume-shell-plugins-are-in-etc.patch @@ -1,51 +1,51 @@ diff --git a/conda/activate.py b/conda/activate.py -index f79a03f..951bed4 100644 +index 8149162..0d751e3 100644 --- a/conda/activate.py +++ b/conda/activate.py -@@ -914,13 +914,7 @@ class PosixActivator(_Activator): +@@ -918,13 +918,7 @@ class PosixActivator(_Activator): set_var_tmpl = "%s='%s'" - run_script_tmpl = ". \"`cygpath '%s'`\"" if on_win else '. "%s"' + run_script_tmpl = '. "%s"' -- hook_source_path = Path( +- hook_source_path = join( - CONDA_PACKAGE_ROOT, - "shell", - "etc", - "profile.d", - "conda.sh", - ) -+ hook_source_path = Path("/etc/profile.d/conda.sh") - inline_hook_source = True ++ hook_source_path = '/etc/profile.d/conda.sh' def _update_prompt(self, set_vars, conda_prompt_modifier): -@@ -956,13 +950,7 @@ class CshActivator(_Activator): + ps1 = self.environ.get("PS1", "") +@@ -971,13 +965,7 @@ class CshActivator(_Activator): set_var_tmpl = "set %s='%s'" - run_script_tmpl = "source \"`cygpath '%s'`\"" if on_win else 'source "%s"' + run_script_tmpl = 'source "%s"' -- hook_source_path = Path( +- hook_source_path = join( - CONDA_PACKAGE_ROOT, - "shell", - "etc", - "profile.d", - "conda.csh", - ) -+ hook_source_path = Path("/etc/profile.d/conda.csh") - # TCSH/CSH removes newlines when doing command substitution (see `man tcsh`), - # source conda.csh directly and use line terminators to separate commands - inline_hook_source = False -@@ -1001,7 +989,7 @@ class XonshActivator(_Activator): ++ hook_source_path = '/etc/profile.d/conda.csh' + + def _update_prompt(self, set_vars, conda_prompt_modifier): + prompt = self.environ.get("prompt", "") +@@ -1033,7 +1021,7 @@ class XonshActivator(_Activator): else 'source-bash --suppress-skip-message -n "%s"' ) -- hook_source_path = Path(CONDA_PACKAGE_ROOT, "shell", "conda.xsh") -+ hook_source_path = Path("/etc/profile.d/conda.xsh") - inline_hook_source = True +- hook_source_path = join(CONDA_PACKAGE_ROOT, "shell", "conda.xsh") ++ hook_source_path = "/etc/profile.d/conda.xsh" - def template_path_var(self, key: str, value: str) -> str: -@@ -1055,14 +1043,7 @@ class FishActivator(_Activator): + def _hook_preamble(self) -> str: + return '$CONDA_EXE = "%s"' % self.path_conversion(context.conda_exe) +@@ -1074,14 +1062,7 @@ class FishActivator(_Activator): set_var_tmpl = 'set -g %s "%s"' run_script_tmpl = 'source "%s"' -- hook_source_path = Path( +- hook_source_path = join( - CONDA_PACKAGE_ROOT, - "shell", - "etc", @@ -53,20 +53,20 @@ index f79a03f..951bed4 100644 - "conf.d", - "conda.fish", - ) -+ hook_source_path = Path("/etc/fish/conf.d/conda.fish") - inline_hook_source = True - ++ hook_source_path = "/etc/fish/conf.d/conda.fish" + def _hook_preamble(self) -> str: + if on_win: diff --git a/conda/base/context.py b/conda/base/context.py -index adf6d6e..612ea4a 100644 +index c22fafd..cf29eb6 100644 --- a/conda/base/context.py +++ b/conda/base/context.py -@@ -848,7 +848,7 @@ class Context(Configuration): - def av_data_dir(self) -> PathType: +@@ -739,7 +739,7 @@ class Context(Configuration): + def av_data_dir(self): """Where critical artifact verification data (e.g., various public keys) can be found.""" # TODO (AV): Find ways to make this user configurable? - return join(self.conda_prefix, "etc", "conda") + return '/etc/conda' @property - def signing_metadata_url_base(self) -> str | None: + def signing_metadata_url_base(self): diff --git a/conda-32bit.patch b/conda-32bit.patch new file mode 100644 index 0000000..19fa4d3 --- /dev/null +++ b/conda-32bit.patch @@ -0,0 +1,21 @@ +diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py +index 71812ca..778bbb4 100644 +--- a/tests/core/test_solve.py ++++ b/tests/core/test_solve.py +@@ -224,14 +224,14 @@ def test_cuda_fail_1(tmpdir, clear_cuda_version): + else: + plat = "osx-64" + elif sys.platform == "linux": +- plat = "linux-64" ++ plat = "linux-%s" % platform.architecture()[0][0:2] + elif sys.platform == "win32": + if platform.architecture()[0] == "32bit": + plat = "win-32" + else: + plat = "win-64" + else: +- plat = "linux-64" ++ plat = "linux-%s" % platform.architecture()[0][0:2] + + assert str(exc.value).strip() == dals( + """The following specifications were found to be incompatible with your system: diff --git a/conda-cpuinfo.patch b/conda-cpuinfo.patch new file mode 100644 index 0000000..d395727 --- /dev/null +++ b/conda-cpuinfo.patch @@ -0,0 +1,26 @@ +diff --git a/conda/base/context.py b/conda/base/context.py +index dbeac32..8b78e69 100644 +--- a/conda/base/context.py ++++ b/conda/base/context.py +@@ -1864,7 +1864,7 @@ conda_tests_ctxt_mgmt_def_pol = replace_context_default + @lru_cache(maxsize=None) + def _get_cpu_info(): + # DANGER: This is rather slow +- from .._vendor.cpuinfo import get_cpu_info ++ from cpuinfo import get_cpu_info + + return frozendict(get_cpu_info()) + +diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py +index efb839a..71812ca 100644 +--- a/tests/core/test_solve.py ++++ b/tests/core/test_solve.py +@@ -8,7 +8,7 @@ from unittest.mock import Mock + + import pytest + +-from conda._vendor.cpuinfo import get_cpu_info ++from cpuinfo import get_cpu_info + from conda.auxlib.ish import dals + from conda.base.context import conda_tests_ctxt_mgmt_def_pol, context + from conda.common.compat import on_linux diff --git a/conda.spec b/conda.spec index 5e7e2c3..29d07b3 100644 --- a/conda.spec +++ b/conda.spec @@ -1,7 +1,7 @@ %bcond_without tests Name: conda -Version: 25.11.1 +Version: 23.9.0 Release: %autorelease Summary: Cross-platform, Python-agnostic binary package manager @@ -13,9 +13,14 @@ URL: http://conda.pydata.org/docs/ Source0: https://github.com/conda/conda/archive/%{version}/%{name}-%{version}.tar.gz # bash completion script moved to a separate project Source1: https://raw.githubusercontent.com/tartansandal/conda-bash-completion/1.7/conda -Patch0: 0001-conda_sys_prefix.patch.patch +Patch0: conda_sys_prefix.patch # Use main entry point for conda and re-add conda-env entry point, no need to run conda init -Patch1: 0002-Use-main-entry-point-for-conda-and-re-add-conda-env-.patch +Patch1: 0001-Use-main-entry-point-for-conda-and-re-add-conda-env-.patch +# Use system cpuinfo +Patch3: conda-cpuinfo.patch +# Fix tests on 32bit +# https://github.com/conda/conda/pull/9759 +Patch4: conda-32bit.patch Patch10004: 0004-Do-not-try-to-run-usr-bin-python.patch Patch10005: 0005-Fix-failing-tests-in-test_api.py.patch @@ -26,13 +31,13 @@ BuildArch: noarch BuildRequires: pkgconfig(bash-completion) %global bash_completionsdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null || echo '/etc/bash_completion.d') BuildRequires: sed -# For man pages -BuildRequires: python-conda-sphinx-theme Requires: python%{python3_pkgversion}-conda = %{version}-%{release} # Removed upstream in favour of calling "conda activate" in version 4.4.0 Obsoletes: conda-activate < 4.4 +%?python_enable_dependency_generator + %global _description %{expand: Conda is a cross-platform, Python-agnostic binary package manager. It @@ -63,37 +68,54 @@ Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel # For tests BuildRequires: python-unversioned-command -BuildRequires: python%{python3_pkgversion}-boltons BuildRequires: python%{python3_pkgversion}-boto3 -BuildRequires: python%{python3_pkgversion}-conda-libmamba-solver BuildRequires: python%{python3_pkgversion}-flask BuildRequires: python%{python3_pkgversion}-jsonpatch -BuildRequires: python%{python3_pkgversion}-libmambapy -BuildRequires: python%{python3_pkgversion}-pexpect BuildRequires: python%{python3_pkgversion}-pytest-mock BuildRequires: python%{python3_pkgversion}-pytest-rerunfailures -BuildRequires: python%{python3_pkgversion}-pytest-split BuildRequires: python%{python3_pkgversion}-pytest-timeout BuildRequires: python%{python3_pkgversion}-pytest-xprocess BuildRequires: python%{python3_pkgversion}-responses -# conda uses a modified version of auxlib +# Some versions in conda/_vendor/vendor.txt +Provides: bundled(python%{python3_pkgversion}-appdirs) = 1.2.0 Provides: bundled(python%{python3_pkgversion}-auxlib) = 0.0.43 +Provides: bundled(python%{python3_pkgversion}-boltons) = 21.0.0 + +%{?python_provide:%python_provide python%{python3_pkgversion}-conda} %description -n python%{python3_pkgversion}-conda %_description %prep %autosetup -p1 -# Re-enable dep on conda-libmamba-solver -sed -i -e '/"conda-libmamba-solver/s/# *//' pyproject.toml - # Do not restrict upper bound of ruamel-yaml sed -i -e '/ruamel.yaml/s/,<[0-9.]*//' pyproject.toml +# F38 has an older jsonpatch +sed -i -e '/jsonpatch/d' pyproject.toml + # pytest-split/xdoctest not packaged, store-duration not needed sed -i -e '/splitting-algorithm/d' -e '/store-durations/d' -e '/xdoctest/d' pyproject.toml +# delete interpreter line, the user can always call the file +# explicitly as python3 /usr/lib/python3.6/site-packages/conda/_vendor/appdirs.py +# or so. +sed -r -i '1 {/#![/]usr[/]bin[/]env/d}' conda/_vendor/appdirs.py + +# Use Fedora's cpuinfo since it supports more arches +rm -r conda/_vendor/cpuinfo +sed -i -e '/^dependencies = /a\ \ "py-cpuinfo",' pyproject.toml + +# Use system versions +rm -r conda/_vendor/{distro.py,frozendict} +find conda -name \*.py | xargs sed -i -e 's/^\( *\)from .*_vendor\.\(\(distro\|frozendict\).*\) import/\1from \2 import/' +sed -i -e '/^dependencies = /a\ \ "distro",' pyproject.toml +sed -i -e '/^dependencies = /a\ \ "frozendict",' pyproject.toml + +# Unpackaged - use vendored version +sed -i -e '/"boltons *>/d' pyproject.toml + # Unpackaged - really only applicable for macOS/Windows? sed -i -e '/"truststore *>/d' pyproject.toml @@ -110,24 +132,19 @@ sed -i -e s/linux-64/%{python3_platform}/ tests/data/conda_format_repo/%{python3 sed -i -e '/"--cov/d' pyproject.toml %generate_buildrequires -# When not testing, we don't need runtime dependencies. -# Normally, we would still BuildRequire them to not accidentally build an uninstallable package, -# but there is a runtime dependency loop with python3-conda-libmamba-solver. -%pyproject_buildrequires %{!?with_tests:-R} +%pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install -#py3_shebang_fix %{buildroot}%{python3_sitelib}/conda/shell/bin/conda +%py3_shebang_fix %{buildroot}%{python3_sitelib}/conda/shell/bin/conda %pyproject_save_files conda* mkdir -p %{buildroot}%{_sysconfdir}/conda/condarc.d mkdir -p %{buildroot}%{_datadir}/conda/condarc.d cat >%{buildroot}%{_datadir}/conda/condarc.d/defaults.yaml < -Date: Tue, 30 Jul 2024 18:00:00 -0600 -Subject: [PATCH 1/2] conda_sys_prefix.patch - ---- - conda/__init__.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - diff --git a/conda/__init__.py b/conda/__init__.py -index 4245cae..a436b1d 100644 +index 923ccde..2b64a72 100644 --- a/conda/__init__.py +++ b/conda/__init__.py -@@ -54,7 +54,7 @@ __summary__ = __doc__ +@@ -28,7 +28,7 @@ __summary__ = __doc__ __url__ = "https://github.com/conda/conda" if os.getenv("CONDA_ROOT") is None: @@ -20,6 +11,3 @@ index 4245cae..a436b1d 100644 #: The conda package directory. CONDA_PACKAGE_ROOT = abspath(dirname(__file__)) --- -2.45.2 - diff --git a/sources b/sources index 28be694..f3592f5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (conda-25.11.1.tar.gz) = ce04c8805ca51047cf1e1ebb945fcce1fbb559fe472d4f5fb4217d49b93b67c8e38baf735c6a9244b31d559247ec10d46e1e33caf8ac7fedc105ce3645121609 +SHA512 (conda-23.9.0.tar.gz) = 2aaa5ba01f49f7ad5dc55e48bc4811a4f7e969ba67d075536e3822ddb2e4e481a32a78e9234112be5dcec0ec14b9090aea079dc48840aebb1e380a288413ac7a