Coverage for mddb_workflow/__init__.py: 45%

11 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-10-29 15:48 +0000

1import os 

2import subprocess 

3 

4name = "mddb_workflow" 

5__all__ = ["resources", "tools", "utils"] 

6 

7# Workaround to fix ReadTheDocs build issue with conda environments 

8# when fix_gromacs_masses and helical_parameters are called. 

9if "CONDA_PREFIX" not in os.environ: 

10 try: 

11 # Get the path of the python executable 

12 python_path = subprocess.check_output(["which", "python"], text=True).strip() 

13 # Extract the directory path (one level up from bin/python) 

14 conda_prefix = os.path.dirname(os.path.dirname(python_path)) 

15 # Set the environment variable 

16 os.environ["CONDA_PREFIX"] = conda_prefix 

17 except subprocess.SubprocessError: 

18 print("Warning: Could not determine CONDA_PREFIX from 'which python'")