Skip to content

Commit

Permalink
Migrate more imports from PyPi to Conda
Browse files Browse the repository at this point in the history
  • Loading branch information
torzdf committed Jun 30, 2019
1 parent 7ee48c0 commit 1742732
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
# Revisions of tensorflow-gpu and cuda/cudnn requirements
TENSORFLOW_REQUIREMENTS = {"==1.12.0": ["9.0", "7.2"],
">=1.13.1,<1.14": ["10.0", "7.4"]} # TF 1.14+ Not currently supported
# Mapping of Python packages to their conda names if different from pypi or in non-default channel
CONDA_MAPPING = {"opencv-python": ("opencv", "conda-forge"),
"fastcluster": ("fastcluster", "conda-forge"),
"toposort": ("toposort", "conda-forge"),
"imageio-ffmpeg": ("imageio-ffmpeg", "conda-forge")}


class Environment():
Expand Down Expand Up @@ -606,7 +611,12 @@ def install_python_packages(self):
for pkg in self.env.missing_packages:
if self.env.is_conda:
verbose = pkg.startswith("tensorflow")
if self.conda_installer(pkg, verbose=verbose):
pkg = CONDA_MAPPING.get(pkg, pkg)
channel = None
if isinstance(pkg, (tuple, list)):
channel = None if len(pkg) != 2 else pkg[1]
pkg = pkg[0]
if self.conda_installer(pkg, verbose=verbose, channel=channel, conda_only=False):
continue
self.pip_installer(pkg)

Expand Down

0 comments on commit 1742732

Please sign in to comment.