diff --git a/conda_libmamba_solver/solver.py b/conda_libmamba_solver/solver.py index 48ee4ae7..b39b7e07 100644 --- a/conda_libmamba_solver/solver.py +++ b/conda_libmamba_solver/solver.py @@ -32,6 +32,7 @@ from conda.common.constants import NULL from conda.common.io import Spinner, time_recorder from conda.common.path import paths_equal +from conda.common.url import percent_decode from conda.core.solve import Solver from conda.exceptions import ( CondaValueError, @@ -634,6 +635,7 @@ def _package_info_to_package_record( break else: url = pkg.package_url + url = percent_decode(url) return PackageRecord( name=pkg.name, version=pkg.version, diff --git a/dev/requirements.txt b/dev/requirements.txt index 56dba1a9..761ee516 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -5,6 +5,3 @@ boltons>=23.0.0 conda>=23.7.3 conda-forge::libmamba>=2.0.0 conda-forge::libmambapy>=2.0.0 -# NOTE: jaimergp/label/conda-libmamba-solver-for-libmamba-v2 is a temporary hack -# to allow upgrades to libmamba v2. Remove once CLS with v2 compat is released. -jaimergp/label/conda-libmamba-solver-for-libmamba-v2::conda-libmamba-solver diff --git a/tests/test_solver.py b/tests/test_solver.py index 2e90494a..906d8613 100644 --- a/tests/test_solver.py +++ b/tests/test_solver.py @@ -24,6 +24,7 @@ ) from conda_libmamba_solver.exceptions import LibMambaUnsatisfiableError +from conda_libmamba_solver.solver import LibMambaSolver as Solver from .utils import conda_subprocess @@ -500,3 +501,18 @@ def test_install_virtual_packages(conda_cli, spec): else: raises = (UnsatisfiableError, PackagesNotFoundError) conda_cli("create", "--dry-run", "--offline", spec, raises=raises) + + +def test_urls_are_percent_decoded(tmp_path): + solver = Solver( + prefix=tmp_path, channels=["conda-forge"], specs_to_add=["x264"], command="create" + ) + records = solver.solve_final_state() + for record in records: + if record.name == "x264": + print(record.url) + assert "!" in record.url + assert "%" not in record.url + break + else: + pytest.fail("Solution didn't include x264")