Merge branch release-2021
[alexxy/gromacs.git] / python_packaging / src / setup.py
index 612f5d8c16970b59fca71e366248a5b1d9b6ceb3..e1246075cc436d08ccb0192e26a949ae4f99f03d 100644 (file)
 
 import os
 
+# Import setuptools early to avoid UserWarning from Distutils.
+# Ref: https://gitlab.com/gromacs/gromacs/-/issues/3715
+import setuptools
+
 # Allow setup.py to be run when scikit-build is not installed, such as to
 # produce source distribution archives with `python setup.py sdist`
 try:
@@ -101,12 +105,14 @@ if gmxapi_DIR is None:
     # Infer from GMXRC exports, if available.
     gmxapi_DIR = os.getenv('GROMACS_DIR')
 
+
 def _find_first_gromacs_suffix(directory):
     dir_contents = os.listdir(directory)
     for entry in dir_contents:
         if entry.startswith('gromacs'):
             return entry.strip('gromacs')
 
+
 if gmx_toolchain_dir is None:
     # Try to guess from standard GMXRC environment variables.
     if gmxapi_DIR is not None: