setup.py - Fix AMD conflicts

This commit is contained in:
torzdf 2022-08-10 17:38:04 +01:00
parent 26dde3c19a
commit 39ac1f53a3
2 changed files with 13 additions and 2 deletions

View File

@ -2,8 +2,8 @@ tqdm>=4.64
psutil>=5.9.0
opencv-python>=4.6.0.0
pillow>=9.2.0
scikit-learn==1.0.2; python_version < '3.8'
scikit-learn>=1.1.0; python_version >= '3.8'
scikit-learn==1.0.2; python_version < '3.9' # AMD needs version 1.0.2 and 1.1.0 not available in Python 3.7
scikit-learn>=1.1.0; python_version >= '3.9'
fastcluster>=1.2.6
matplotlib>=3.5.1
imageio>=2.19.3

View File

@ -32,9 +32,13 @@ _CONDA_MAPPING: Dict[str, Tuple[str, str]] = {
# "opencv-python": ("opencv", "conda-forge"), # Periodic issues with conda-forge opencv
"fastcluster": ("fastcluster", "conda-forge"),
"imageio-ffmpeg": ("imageio-ffmpeg", "conda-forge"),
"scikit-learn": ("scikit-learn", "conda-forge"), # Exists in Default but is dependency hell
"tensorflow-deps": ("tensorflow-deps", "apple"),
"libblas": ("libblas", "conda-forge")}
# Packages that should be installed first to prevent version conflicts
_PRIORITY = ["numpy"]
class Environment():
""" The current install environment
@ -720,6 +724,13 @@ class Install(): # pylint:disable=too-few-public-methods
[int(s) for s in spec[1].split(".")])
for spec in specs):
self._env.missing_packages.append((key, specs))
for priority in reversed(_PRIORITY):
# Put priority packages at beginning of list
package = next((pkg for pkg in self._env.missing_packages if pkg[0] == priority), None)
if package:
idx = self._env.missing_packages.index(package)
self._env.missing_packages.insert(0, self._env.missing_packages.pop(idx))
logger.debug(self._env.missing_packages)
def _check_conda_missing_dep(self) -> None: