Skip to content

Commit

Permalink
MAINT: Catch OSError for conda path exploration
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed Feb 4, 2024
1 parent f8db9e4 commit cc2772f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linux CI
name: Linux and MacOS CI

on: [push, pull_request]

Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:

test_env:
name: test_environments
runs-on: [ "ubuntu-latest", "macos-latest" ]
runs-on: [ ubuntu-latest, macos-latest ]
strategy:
fail-fast: false
timeout-minutes: 10
Expand Down
14 changes: 8 additions & 6 deletions test/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@ def _check_conda():


def _check_mamba():
conda = _find_conda()
try:
importlib.import_module('libmambapy')
subprocess.check_call([conda, 'build', '--version'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
conda = _find_conda()
importlib.import_module("libmambapy")
subprocess.check_call(
[conda, "build", "--version"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
return True
except (ImportError, subprocess.CalledProcessError, FileNotFoundError):
except (ImportError, OSError, subprocess.CalledProcessError, FileNotFoundError):
return False


Expand Down

0 comments on commit cc2772f

Please sign in to comment.