Propagate recompilation through the dependency chains.
Avoid re-tainting packages that have already been compiled.
175302
public void taintPackagesDependingOnChangedPackages(Set<String> pkgs, Set<String> recentlyCompiled) {
        for (Package pkg : prev.packages().values()) {
            for (String dep : pkg.dependencies()) {
                if (pkgs.contains(dep) && !recentlyCompiled.contains(pkg.name())) {
                    taintPackage(pkg.name(), " its depending on "+dep);
                }
            }
        }
    }
1046994
public void rebuildDependencyGraph() {
        DependencyGraph graph = new DependencyGraph();
        graph.build();
        // volatile acts a as a memory barrier here and therefore guarantees
        // that graph is fully build, before it's visible to other threads
        dependencyGraph = graph;
        dependencyGraphDirty.set(false);
    }
1093588
def replace_built(self, built_packages):
    
    def map_packages(resolved_packages):
      packages = OrderedSet(built_packages.get(p, p) for p in resolved_packages.packages)
      return _ResolvedPackages(resolved_packages.resolvable, packages,
                               resolved_packages.parent, resolved_packages.constraint_only)

    return _ResolvableSet([map_packages(rp) for rp in self.__tuples])
1034765
def copy_dependencies
      @dependencies.each do |dependency|
        path =
          File.join('elm-stuff', 'packages', dependency.name,
                    dependency.version.to_simple)

        log_dependency dependency

        dependency.source.copy_to(dependency.version, Pathname.new(path))
      end
      nil
    end
221223
def use_software_cache(sw_dir=None, reload_deps=False):
    
    sw_dir = get_sw_dir(sw_dir)
    if os.path.exists(sw_dir):
        sys.path.insert(1, sw_dir)

        if reload_deps:
            reload_dependencies()
775256
def install_dependencies(dependencies, verbose=False):
    """"""
    if not dependencies:
        return

    stdout = stderr = None if verbose else subprocess.DEVNULL
    with tempfile.TemporaryDirectory() as req_dir:
        req_file = Path(req_dir) / "requirements.txt"

        with open(req_file, "w") as f:
            for dependency in dependencies:
                f.write(f"{dependency}\n")

        pip = ["python3", "-m", "pip", "install", "-r", req_file]
        # Unless we are in a virtualenv, we need --user
        if sys.base_prefix == sys.prefix and not hasattr(sys, "real_prefix"):
            pip.append("--user")

        try:
            subprocess.check_call(pip, stdout=stdout, stderr=stderr)
        except subprocess.CalledProcessError:
            raise Error(_("failed to install dependencies"))

        # Reload sys.path, to find recently installed packages
        importlib.reload(site)
1117658
def repackage_to_staging(output_path):
  """"""

  import google.datalab.ml as ml

  # Find the package root. __file__ is under [package_root]/mltoolbox/image/classification.
  package_root = os.path.join(os.path.dirname(__file__), '../../../')
  # We deploy setup.py in the same dir for repackaging purpose.
  setup_py = os.path.join(os.path.dirname(__file__), 'setup.py')
  staging_package_url = os.path.join(output_path, 'staging', 'image_classification.tar.gz')
  ml.package_and_copy(package_root, setup_py, staging_package_url)
  return staging_package_url
1146377
function(context, pkg, isRoot) {
		var deps = crawl.getDependencies(context.loader, pkg, isRoot);

		return Promise.all(utils.filter(utils.map(deps, function(childPkg){
			return crawl.fetchDep(context, pkg, childPkg, isRoot);
		}), truthy)).then(function(packages){
 			// at this point all dependencies of pkg have been loaded, it's ok to get their children

			return Promise.all(utils.map(packages, function(childPkg){
				// Also load 'steal' so that the builtins will be configured
				if(childPkg && childPkg.name === 'steal') {
					return crawl.deps(context, childPkg);
				}
			})).then(function(){
				return packages;
			});
		});
	}
393424
function processLinked(deps, processed) {
      if(_.isEmpty(deps)) {
        return;
      }
      if(!processed) {
        processed = _.clone(deps);
      }

      var newDeps = {};
      var promise = when.resolve();
      _.each(deps, function(version, link) {
        promise = promise.then(function() {
          var pkgPath = path.resolve(nodeModulesDir, link, 'package.json');
          if (!fs.existsSync(pkgPath)) { throw new Error('Invalid package at '+pkgPath); }
          var linkPackage = require(pkgPath);

          if(!_.isEmpty(linkPackage.peerDependencies)) {
            //Install OR link peer dependencies
            self.log.verbose("Installing peer dependencies " +
              JSON.stringify(_.keys(linkPackage.peerDependencies)) + " from "
              + linkPackage.name + "@" + linkPackage.version + " into " + cwd);
          }

          return self.installWorkspaceDependencies(cwd, linkPackage.peerDependencies, workspaceDescriptor, installed)
          .then(function(newResults) {
            _.extend(newDeps, newResults.linked);
          });
        });
      });

      return promise.then(function() {
        var diff = _.omit(newDeps, _.keys(processed));
        //update the global list
        var newProcessed = _.extend({}, processed, diff);
        //process only new links
        return processLinked(diff, newProcessed);
      });
    }
742106
public function rewritingSelfVersionDependencies()
    {
        $composer = $this->embeddedComposer->createComposer($this->io);
        $package = $composer->getPackage();
        $configSource = new JsonConfigSource(new JsonFile('composer.json'));

        foreach (BasePackage::$supportedLinkTypes as $type => $meta) {
            foreach ($package->{'get'.$meta['method']}() as $link) {
                if ($link->getPrettyConstraint() === 'self.version') {
                    $configSource->addLink(
                        $type,
                        $link->getTarget(),
                        $package->getPrettyVersion()
                    );
                }
            }
        }
    }
1308063
def _RepackTemplates(self):
    """"""
    dummy_config = os.path.join(
        args.grr_src, "grr/test/grr_response_test/test_data/dummyconfig.yaml")
    if args.build_32:
      template_i386 = glob.glob(os.path.join(args.output_dir,
                                             "*_i386*.zip")).pop()
    template_amd64 = glob.glob(os.path.join(args.output_dir,
                                            "*_amd64*.zip")).pop()

    # We put the installers in the output dir so they get stored as build
    # artifacts and we can test the 32bit build manually.
    subprocess.check_call([
        self.grr_client_build64, "--verbose", "--secondary_configs",
        dummy_config, "repack", "--template", template_amd64, "--output_dir",
        args.output_dir
    ])
    subprocess.check_call([
        self.grr_client_build64, "--verbose", "--context",
        "DebugClientBuild Context", "--secondary_configs", dummy_config,
        "repack", "--template", template_amd64, "--output_dir", args.output_dir
    ])
    if args.build_32:
      subprocess.check_call([
          self.grr_client_build32, "--verbose", "--secondary_configs",
          dummy_config, "repack", "--template", template_i386, "--output_dir",
          args.output_dir
      ])
      subprocess.check_call([
          self.grr_client_build32, "--verbose", "--context",
          "DebugClientBuild Context", "--secondary_configs", dummy_config,
          "repack", "--template", template_i386, "--output_dir", args.output_dir
      ])
447724
def dependencies(source):
    """"""
    loader = ClassLoader(source, max_cache=-1)
    all_dependencies = set()
    for klass in loader.classes:
        new_dependencies = loader.dependencies(klass) - all_dependencies
        all_dependencies.update(new_dependencies)
        for new_dep in new_dependencies:
            click.echo(new_dep)
67484
private void validateDepDefinitionUniqueness(final List<FlowTriggerDependency> dependencies) {
    final Set<String> seen = new HashSet<>();
    for (final FlowTriggerDependency dep : dependencies) {
      final Map<String, String> props = dep.getProps();
      // set.add() returns false when there exists duplicate
      Preconditions.checkArgument(seen.add(dep.getType() + ":" + props.toString()), String.format
          ("duplicate dependency config %s found, dependency config should be unique",
              dep.getName()));
    }
  }
33148
def _recursive_import(package):
    

    prefix = '%s.' % (package.__name__)

    path = getattr(package, '__path__', None)

    if path:
        for submod in pkgutil.walk_packages(path, prefix=prefix):
            _import_module(submod[1], submod[0].path)
972205
def resync_package(ctx, opts, owner, repo, slug, skip_errors):
    """"""
    click.echo(
        "Resynchonising the %(slug)s package ... "
        % {"slug": click.style(slug, bold=True)},
        nl=False,
    )

    context_msg = "Failed to resynchronise package!"
    with handle_api_exceptions(
        ctx, opts=opts, context_msg=context_msg, reraise_on_error=skip_errors
    ):
        with maybe_spinner(opts):
            api_resync_package(owner=owner, repo=repo, identifier=slug)

    click.secho("OK", fg="green")
495092
def resolve_dependencies(self, to_build, depender):
		
		shutit_global.shutit_global_object.yield_to_draw()
		self.log('In resolve_dependencies',level=logging.DEBUG)
		cfg = self.cfg
		for dependee_id in depender.depends_on:
			dependee = self.shutit_map.get(dependee_id)
			# Don't care if module doesn't exist, we check this later
			if (dependee and dependee not in to_build
			    and cfg[dependee_id]['shutit.core.module.build_ifneeded']):
				to_build.append(dependee)
				cfg[dependee_id]['shutit.core.module.build'] = True
		return True
668275
def _fix_deps_repos(self, dependencies):
        
        requires = []
        for dep in dependencies:
            if dep in self.repo_pkg_names:
                requires.append(dep)
        return requires