Return True if the current Python executable is in a conda env
(*args, **kwargs)
| 21 | def is_conda_environment(func): |
| 22 | @functools.wraps(func) |
| 23 | def wrapper(*args, **kwargs): |
| 24 | """Return True if the current Python executable is in a conda env""" |
| 25 | # TODO: does this need to change on windows? |
| 26 | if not Path(sys.prefix, "conda-meta", "history").exists(): |
| 27 | raise ValueError( |
| 28 | "The python kernel does not appear to be a conda environment. " |
| 29 | "Please use ``%pip install`` instead." |
| 30 | ) |
| 31 | return func(*args, **kwargs) |
| 32 | |
| 33 | return wrapper |
| 34 |
nothing calls this directly
no test coverage detected
searching dependent graphs…