Exemplo n.º 1
0
        public IEnumerable <IPackageManager> GetPackageManagers(IPythonInterpreterFactory factory)
        {
            if (ExperimentalOptions.UseCondaPackageManager)
            {
                if (!Directory.Exists(Path.Combine(factory.Configuration.PrefixPath, "conda-meta")))
                {
                    yield break;
                }

                var condaPath = CondaUtils.GetCondaExecutablePath(factory.Configuration.PrefixPath);
                if (string.IsNullOrEmpty(condaPath))
                {
                    // conda.bat is no longer present in a conda 4.4 environment,
                    // so find a global conda.exe to use.
                    condaPath = _latestCondaExe.Value;
                }

                if (string.IsNullOrEmpty(condaPath))
                {
                    yield break;
                }

                IPackageManager pm = null;
                try {
                    pm = new CondaPackageManager(factory, condaPath);
                } catch (NotSupportedException) {
                    pm = null;
                }
                if (pm != null)
                {
                    yield return(pm);
                }
            }
        }
Exemplo n.º 2
0
        public IEnumerable <IPackageManager> GetPackageManagers(IPythonInterpreterFactory factory)
        {
            IPackageManager pm = null;
            string          condaPath;

            if (ExperimentalOptions.UseCondaPackageManager &&
                !string.IsNullOrEmpty(condaPath = CondaUtils.GetCondaExecutablePath(factory.Configuration.PrefixPath)))
            {
                try {
                    pm = new CondaPackageManager(factory, condaPath);
                } catch (NotSupportedException) {
                    pm = null;
                }
                if (pm != null)
                {
                    yield return(pm);
                }
            }
        }
Exemplo n.º 3
0
 public Suppressed(CondaPackageManager manager)
 {
     _manager = manager;
 }