Skip to content

Commit

Permalink
Instead of reimplementing platform detection here use the function fr…
Browse files Browse the repository at this point in the history
…om ensureconda
  • Loading branch information
mariusvniekerk committed May 29, 2021
1 parent d46e4c0 commit a54774a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions conda_lock/conda_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
CONDA_PKGS_DIRS = None
DEFAULT_PLATFORMS = ["osx-64", "linux-64", "win-64"]

_PLATFORM_MAP = {"osx-64": "darwin", "linux-64": "linux", "win-64": "win"}


def _extract_platform(line: str) -> Optional[str]:
search = PLATFORM_PATTERN.search(line)
Expand All @@ -82,7 +80,10 @@ def extract_platform(lockfile: str) -> str:


def _do_validate_platform(platform: str) -> Tuple[bool, str]:
return sys.platform.startswith(_PLATFORM_MAP[platform]), sys.platform
from ensureconda.resolve import platform_subdir

determined_subdir = platform_subdir()
return platform == determined_subdir, platform


def do_validate_platform(lockfile: str):
Expand Down

0 comments on commit a54774a

Please sign in to comment.