Skip to content

Commit

Permalink
refactor: keep old behavior for future testing
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Jun 26, 2024
1 parent 83e2ecc commit cbe5d3a
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,35 @@ def variants_conda_build_sysroot(monkeypatch, request):
if not on_mac:
return {}

monkeypatch.setenv(
"MACOSX_DEPLOYMENT_TARGET",
os.path.basename(os.environ["CONDA_BUILD_SYSROOT"])
.replace("MacOSX", "")
.replace(".sdk", ""),
)
# if we do not speciy a custom sysroot, we get what the
# current SDK has
if "CONDA_BUILD_SYSROOT" not in os.environ:
monkeypatch.setenv(
"CONDA_BUILD_SYSROOT",
subprocess.run(
["xcrun", "--sdk", "macosx", "--show-sdk-path"],
check=True,
capture_output=True,
text=True,
).stdout.strip(),
)

mdt = subprocess.run(
["xcrun", "--sdk", "macosx", "--show-sdk-version"],
check=True,
capture_output=True,
text=True,
).stdout.strip()
else:
# custom sysroots always have names like MacOSX<version>.sdk
mdt = (
os.path.basename(os.environ["CONDA_BUILD_SYSROOT"])
.replace("MacOSX", "")
.replace(".sdk", "")
)

monkeypatch.setenv("MACOSX_DEPLOYMENT_TARGET", mdt)

return request.param


Expand Down

0 comments on commit cbe5d3a

Please sign in to comment.