Skip to content

Commit

Permalink
MAINT: Lint things better
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed Feb 4, 2024
1 parent 6a2af5c commit 63b12fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion test/test_environment_bench.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import subprocess
import os
import pytest
import json

import pytest

from . import tools

ENVIRONMENTS = []
Expand Down
9 changes: 5 additions & 4 deletions test/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import subprocess
import platform
import http.server
import importlib
from os.path import abspath, join, dirname, relpath, isdir
from contextlib import contextmanager
from hashlib import sha256
Expand Down Expand Up @@ -95,10 +96,10 @@ def _check_conda():
def _check_mamba():
conda = _find_conda()
try:
# Attempt to import libmambapy to check if libmambapy is available
import libmambapy
subprocess.check_call([conda, 'build', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# If both checks pass, return True indicating Mamba is available and conda-build is installed
importlib.import_module('libmambapy')
subprocess.check_call([conda, 'build', '--version'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
return True
except (ImportError, subprocess.CalledProcessError, FileNotFoundError):
return False
Expand Down

0 comments on commit 63b12fb

Please sign in to comment.