Skip to content

Commit

Permalink
Adjust how the opencv dependency is requested. (#927)
Browse files Browse the repository at this point in the history
This allows using an existing installation of it if available.
  • Loading branch information
manthey authored Mar 3, 2022
1 parent 58ee15c commit 2d4d848
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#! /usr/bin/env python

import importlib
import os
import sys

Expand Down Expand Up @@ -63,7 +64,6 @@ def prerelease_local_scheme(version):
'scikit-learn>=0.18.1',
'imageio>=2.3.0',
'shapely[vectorized]',
'opencv-python-headless',
'sqlalchemy',
'matplotlib',
'pyvips',
Expand All @@ -78,7 +78,12 @@ def prerelease_local_scheme(version):
'girder-slicer-cli-web',
# cli
'ctk-cli',
],
] + (
# Only require opencv if it isn't installed. This can allow alternate
# forms to be in the environment (such as a headed form) without
# causing conflicts
['opencv-python-headless'] if not importlib.util.find_spec('cv2') else []
),
license='Apache Software License 2.0',
keywords='histomicstk',
classifiers=[
Expand Down

0 comments on commit 2d4d848

Please sign in to comment.