From 1a31cfee0ee05b82a9f6cb4e595017fb01a0b49c Mon Sep 17 00:00:00 2001 From: Tyler Reddy Date: Sat, 12 Feb 2022 17:33:47 -0700 Subject: [PATCH] BLD, MAINT: hoist packaging import * hoist the import of `packaging` outside of a Cython-focused `try`/`except` block to avoid a deceptive error message when `packaging` is missing, per discussion at: https://github.com/MDAnalysis/mdanalysis/pull/3398#issuecomment-1037371853 * we may also want to consider removing the external dependency completely and vendoring the pertinent code since it is so small, but maybe not this close to a release; an example: https://github.com/scipy/scipy/blob/main/scipy/_lib/_pep440.py --- package/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/setup.py b/package/setup.py index 3634a972c81..9fff1292f18 100755 --- a/package/setup.py +++ b/package/setup.py @@ -46,6 +46,7 @@ from setuptools import setup, Extension, find_packages from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler +from packaging.version import Version import codecs import os import sys @@ -83,7 +84,6 @@ import Cython from Cython.Build import cythonize cython_found = True - from packaging.version import Version required_version = "0.16" if not Version(Cython.__version__) >= Version(required_version):