From: M. Eric Irrgang Date: Fri, 27 Nov 2020 14:24:01 +0000 (+0300) Subject: Import setuptools early to suppress distutils warning. X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=1adc55c42639372f057cbb1acaddfdd86aef09e1;p=alexxy%2Fgromacs.git Import setuptools early to suppress distutils warning. Also apply PEP-8 formatting corrections. Fixes #3715 --- diff --git a/python_packaging/src/setup.py b/python_packaging/src/setup.py index ff01060419..42c9b95bba 100644 --- a/python_packaging/src/setup.py +++ b/python_packaging/src/setup.py @@ -50,6 +50,10 @@ 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: