这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion conda/core/package_cache_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from .. import CondaError, CondaMultiError, conda_signal_handler
from ..auxlib.collection import first
from ..auxlib.decorators import memoizemethod
from ..auxlib.entity import ValidationError
from ..base.constants import (
CONDA_PACKAGE_EXTENSION_V1,
CONDA_PACKAGE_EXTENSION_V2,
Expand Down Expand Up @@ -125,7 +126,16 @@ def load(self):
or isfile(full_path)
and full_path.endswith(_CONDA_TARBALL_EXTENSIONS)
):
package_cache_record = self._make_single_record(base_name)
try:
package_cache_record = self._make_single_record(base_name)
except ValidationError as err:
# ValidationError: package fields are invalid
log.warning(
f"Failed to create package cache record for '{base_name}'. {err}"
)
package_cache_record = None

# if package_cache_record is None, it means we couldn't create a record, ignore
if package_cache_record:
_package_cache_records[package_cache_record] = package_cache_record

Expand Down
3 changes: 3 additions & 0 deletions conda/models/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Arch(Enum):
ppc64le = "ppc64le"
riscv64 = "riscv64"
s390x = "s390x"
wasm32 = "wasm32"
z = "z"

@classmethod
Expand All @@ -45,6 +46,8 @@ class Platform(Enum):
openbsd = "openbsd5"
osx = "darwin"
zos = "zos"
emscripten = "emscripten"
wasi = "wasi"

@classmethod
def from_sys(cls):
Expand Down
19 changes: 19 additions & 0 deletions news/13962-emscripten-platform
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Add missing `emscripten` and `wasi` entries to the recognized platforms, and `wasm32` to the recognized architectures. (#13095)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>
25 changes: 24 additions & 1 deletion tests/cli/test_cli_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
from pathlib import Path

import pytest
from pytest import MonkeyPatch
from pytest_mock import MockerFixture

from conda.base.context import context
from conda.base.context import context, reset_context
from conda.exceptions import UnsatisfiableError
from conda.models.match_spec import MatchSpec
from conda.testing import CondaCLIFixture, PathFactoryFixture, TmpEnvFixture
from conda.testing.integration import package_is_installed

pytestmark = pytest.mark.usefixtures("parametrized_solver_fixture")

Expand Down Expand Up @@ -92,3 +94,24 @@ def test_find_conflicts_called_once(
*channels,
)
assert mocked_find_conflicts.call_count == 3


@pytest.mark.integration
def test_emscripten_forge(
tmp_path: Path,
monkeypatch: MonkeyPatch,
tmp_env: TmpEnvFixture,
):
monkeypatch.setenv("CONDA_PKGS_DIRS", str(tmp_path))
reset_context()

with tmp_env(
"--platform=emscripten-wasm32",
"--override-channels",
"-c",
"https://repo.mamba.pm/emscripten-forge",
"-c",
"conda-forge",
"pyjs",
) as prefix:
assert package_is_installed(prefix, "pyjs")
3 changes: 3 additions & 0 deletions tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -2379,6 +2379,9 @@ def test_conda_downgrade(
monkeypatch.setenv("CONDA_ALLOW_CONDA_DOWNGRADES", "true")
monkeypatch.setenv("CONDA_DLL_SEARCH_MODIFICATION_ENABLE", "1")

# elevate verbosity so we can inspect subprocess' stdout/stderr
monkeypatch.setenv("CONDA_VERBOSE", "2")

with tmp_env("python=3.11", "conda") as prefix: # rev 0
python_exe = str(prefix / PYTHON_BINARY)
conda_exe = str(prefix / BIN_DIRECTORY / ("conda.exe" if on_win else "conda"))
Expand Down