Skip to content

Commit

Permalink
pkgs/sage-conf_conda/setup.py: Exit early when no conda env is active
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Oct 1, 2023
1 parent 2c54bdc commit 46c28c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/sage-conf_conda/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ def run(self):
else:
SAGE_ROOT = self._create_writable_sage_root()

if not os.environ.get('CONDA_PREFIX', ''):
raise SetupError('No conda environment is active. '
'See https://doc.sagemath.org/html/en/installation/conda.html on how to get started.')

if os.path.exists(os.path.join(SAGE_ROOT, 'config.status')):
print(f'Reusing configured SAGE_ROOT={SAGE_ROOT}')
else:
Expand Down

0 comments on commit 46c28c0

Please sign in to comment.