Skip to content
This repository was archived by the owner on Feb 2, 2026. It is now read-only.

Commit d37b1bd

Browse files
authored
Merge pull request #72 from chrisburr/fake-archspc
Add archspec packages for x86_64
2 parents 946ab16 + 8a901da commit d37b1bd

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
run: |
3636
conda install --yes --file=requirements.txt
3737
conda install --yes pytest flaky pip python-build setuptools_scm>=7 setuptools>=45 toml
38-
pip install -e .
38+
pip install --no-deps --no-build-isolation -e .
3939
4040
- name: test versions
4141
shell: bash -el {0}

.github/workflows/tests_mamba.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
conda install --yes --file=requirements.txt
3737
conda install --yes --file=requirements-mamba.txt
3838
conda install --yes pytest flaky pip python-build setuptools_scm>=7 setuptools>=45 toml
39-
pip install -e .
39+
pip install --no-deps --no-build-isolation -e .
4040
4141
- name: test versions
4242
shell: bash -el {0}

conda_forge_feedstock_check_solvable/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
MAX_GLIBC_MINOR = 50
3333
MAX_FUTURE_VERSION = 20
3434

35+
ARCHSPEC_X86_64_VERSIONS = ["x86_64_v1", "x86_64_v2", "x86_64_v3", "x86_64_v4"]
36+
3537
# these characters are start requirements that do not need to be munged from
3638
# 1.1 to 1.1.*
3739
REQ_START_NOSTAR = ["!=", "==", ">", "<", ">=", "<=", "~="]

conda_forge_feedstock_check_solvable/virtual_packages.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from conda_forge_feedstock_check_solvable.utils import (
1414
ALL_PLATFORMS,
15+
ARCHSPEC_X86_64_VERSIONS,
1516
MAX_GLIBC_MINOR,
1617
MINIMUM_CUDA_VERS,
1718
MINIMUM_OSX_64_VERS,
@@ -31,10 +32,14 @@ class FakePackage:
3132
timestamp: int = field(
3233
default_factory=lambda: int(time.mktime(time.gmtime()) * 1000),
3334
)
35+
# Give the option of overriding the build field
36+
build: str | None = None
3437

3538
def to_repodata_entry(self):
3639
out = self.__dict__.copy()
37-
if self.build_string:
40+
if self.build is not None:
41+
build = f"{self.build}"
42+
elif self.build_string:
3843
build = f"{self.build_string}_{self.build_number}"
3944
else:
4045
build = f"{self.build_number}"
@@ -129,6 +134,14 @@ def clean():
129134
tmp_path = pathlib.Path(tmp_dir)
130135
repodata = FakeRepoData(tmp_path)
131136

137+
# archspec
138+
for microarch in ARCHSPEC_X86_64_VERSIONS:
139+
# We have to manually override "build" here to prevent "_0" from being appended
140+
repodata.add_package(
141+
FakePackage("__archspec", "1", build=microarch),
142+
subdirs=[subdir for subdir in ALL_PLATFORMS if subdir.endswith("-64")],
143+
)
144+
132145
# glibc
133146
for glibc_minor in range(12, MAX_GLIBC_MINOR + 1):
134147
repodata.add_package(FakePackage("__glibc", "2.%d" % glibc_minor))

tests/test_solvers.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,24 @@ def test_solvers_nvcc_with_virtual_package(solver_factory):
165165
assert out[0], out[1]
166166

167167

168+
@flaky
169+
def test_solvers_archspec_with_virtual_package(solver_factory):
170+
with suppress_output():
171+
virtual_packages = virtual_package_repodata()
172+
173+
# Not having the fake virtual packages should fail
174+
solver = solver_factory(("conda-forge", "defaults"), "linux-64")
175+
out = solver.solve(["pythia8 8.312"])
176+
assert not out[0], out[1]
177+
178+
# Including the fake virtual packages should succeed
179+
solver = solver_factory(
180+
(virtual_packages, "conda-forge", "defaults"), "linux-64"
181+
)
182+
out = solver.solve(["pythia8 8.312"])
183+
assert out[0], out[1]
184+
185+
168186
@flaky
169187
def test_solvers_hang(solver_factory):
170188
with suppress_output():

0 commit comments

Comments
 (0)