spack/var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch
ajaust e4851d1a89
New package: py-pyprecice (#19558)
* added initial version of package and patch for precice-bindings

* updated package name

* cleanup in script; added version requirement to cython

* Remove unnecessary part of patch

* cleanup package

* added initial version of package and patch for precice-bindings

* updated package name

* cleanup in script; added version requirement to cython

* Remove unnecessary part of patch

* cleanup package

* update style of package

* reformatting to fullfil style requirements

* reformatting again

* fixing some of the issues mention in PR; working on fixing install stage

* readded py-wheel as dependency

Co-authored-by: Benjamin Rüth <benjamin.rueth@tum.de>
2020-10-30 11:39:59 -05:00

33 lines
2.3 KiB
Diff

diff --git a/setup.py b/setup.py
index 9282639..d69c285 100644
--- a/setup.py
+++ b/setup.py
@@ -1,15 +1,20 @@
import os
import subprocess
import warnings
-from packaging import version
-import pip
+from setuptools._vendor.packaging import version
+
+# If installed with pip we need to check its version
+try:
+ import pip
+ if version.parse(pip.__version__) < version.parse("19.0"):
+ # version 19.0 is required, since we are using pyproject.toml for definition of build-time depdendencies. See https://pip.pypa.io/en/stable/news/#id209
+ warnings.warn("You are using pip version {}. However, pip version > 19.0 is recommended. You can continue with the installation, but installation problems can occour. Please refer to https://github.com/precice/python-bindings#build-time-dependencies-cython-numpy-defined-in-pyprojecttoml-are-not-installed-automatically for help.".format(pip.__version__))
-if version.parse(pip.__version__) < version.parse("19.0"):
- # version 19.0 is required, since we are using pyproject.toml for definition of build-time depdendencies. See https://pip.pypa.io/en/stable/news/#id209
- warnings.warn("You are using pip version {}. However, pip version > 19.0 is recommended. You can continue with the installation, but installation problems can occour. Please refer to https://github.com/precice/python-bindings#build-time-dependencies-cython-numpy-defined-in-pyprojecttoml-are-not-installed-automatically for help.".format(pip.__version__))
+ if version.parse(pip.__version__) < version.parse("10.0.1"):
+ warnings.warn("You are using pip version {}. However, pip version > 10.0.1 is required. If you continue with installation it is likely that you will face an error. See https://github.com/precice/python-bindings#version-of-pip3-is-too-old".format(pip.__version__))
+except:
+ warnings.warn("Assuming that you are not using pip!")
-if version.parse(pip.__version__) < version.parse("10.0.1"):
- warnings.warn("You are using pip version {}. However, pip version > 10.0.1 is required. If you continue with installation it is likely that you will face an error. See https://github.com/precice/python-bindings#version-of-pip3-is-too-old".format(pip.__version__))
from enum import Enum
from setuptools import setup