Skip to content
This repository was archived by the owner on Feb 2, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: |
conda install --yes --file=requirements.txt
conda install --yes pytest flaky pip python-build setuptools_scm>=7 setuptools>=45 toml
pip install -e .
pip install --no-deps --no-build-isolation -e .

- name: test versions
shell: bash -el {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_mamba.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
conda install --yes --file=requirements.txt
conda install --yes --file=requirements-mamba.txt
conda install --yes pytest flaky pip python-build setuptools_scm>=7 setuptools>=45 toml
pip install -e .
pip install --no-deps --no-build-isolation -e .

- name: test versions
shell: bash -el {0}
Expand Down
2 changes: 2 additions & 0 deletions conda_forge_feedstock_check_solvable/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
MAX_GLIBC_MINOR = 50
MAX_FUTURE_VERSION = 20

ARCHSPEC_X86_64_VERSIONS = ["x86_64_v1", "x86_64_v2", "x86_64_v3", "x86_64_v4"]

# these characters are start requirements that do not need to be munged from
# 1.1 to 1.1.*
REQ_START_NOSTAR = ["!=", "==", ">", "<", ">=", "<=", "~="]
Expand Down
15 changes: 14 additions & 1 deletion conda_forge_feedstock_check_solvable/virtual_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from conda_forge_feedstock_check_solvable.utils import (
ALL_PLATFORMS,
ARCHSPEC_X86_64_VERSIONS,
MAX_GLIBC_MINOR,
MINIMUM_CUDA_VERS,
MINIMUM_OSX_64_VERS,
Expand All @@ -31,10 +32,14 @@ class FakePackage:
timestamp: int = field(
default_factory=lambda: int(time.mktime(time.gmtime()) * 1000),
)
# Give the option of overriding the build field
build: str | None = None

def to_repodata_entry(self):
out = self.__dict__.copy()
if self.build_string:
if self.build is not None:
build = f"{self.build}"
elif self.build_string:
build = f"{self.build_string}_{self.build_number}"
else:
build = f"{self.build_number}"
Expand Down Expand Up @@ -129,6 +134,14 @@ def clean():
tmp_path = pathlib.Path(tmp_dir)
repodata = FakeRepoData(tmp_path)

# archspec
for microarch in ARCHSPEC_X86_64_VERSIONS:
# We have to manually override "build" here to prevent "_0" from being appended
repodata.add_package(
FakePackage("__archspec", "1", build=microarch),
subdirs=[subdir for subdir in ALL_PLATFORMS if subdir.endswith("-64")],
)

# glibc
for glibc_minor in range(12, MAX_GLIBC_MINOR + 1):
repodata.add_package(FakePackage("__glibc", "2.%d" % glibc_minor))
Expand Down
19 changes: 19 additions & 0 deletions tests/test_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,25 @@ def test_solvers_nvcc_with_virtual_package(solver_factory):
assert out[0], out[1]


@flaky
def test_solvers_archspec_with_virtual_package(solver_factory):
with suppress_output():
virtual_packages = virtual_package_repodata()

# Not having the fake virtual packages should fail
solver = solver_factory(("conda-forge", "defaults"), "linux-64")
out = solver.solve(["pythia8 8.312"])
assert not out[0], out[1]

# Including the fake virtual packages should succeed
solver = solver_factory(
(virtual_packages, "conda-forge", "defaults"), "linux-64"
)
out = solver.solve(["pythia8 8.312"])
print(out)
assert out[0], out[1]


@flaky
def test_solvers_hang(solver_factory):
with suppress_output():
Expand Down
Loading