How to use requirements - 7 common examples

To help you get started, we’ve selected a few requirements examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zeit / now / packages / now-python / src / index.ts View on Github external
const convertCmd = join(tempDir, 'bin', 'pipfile2req');
    await pipenvConvert(convertCmd, pipfileLockDir);
  }

  fsFiles = await glob('**', workPath);
  const requirementsTxt = join(entryDirectory, 'requirements.txt');

  if (fsFiles[requirementsTxt]) {
    debug('Found local "requirements.txt"');
    const requirementsTxtPath = fsFiles[requirementsTxt].fsPath;
    await installRequirementsFile({
      filePath: requirementsTxtPath,
      workPath,
      meta,
    });
  } else if (fsFiles['requirements.txt']) {
    debug('Found global "requirements.txt"');
    const requirementsTxtPath = fsFiles['requirements.txt'].fsPath;
    await installRequirementsFile({
      filePath: requirementsTxtPath,
      workPath,
      meta,
    });
  }

  const originalPyPath = join(__dirname, '..', 'now_init.py');
  const originalNowHandlerPyContents = await readFile(originalPyPath, 'utf8');

  // will be used on `from $here import handler`
  // for example, `from api.users import handler`
  debug('Entrypoint is', entrypoint);
  const userHandlerFilePath = entrypoint
github zeit / now / packages / now-python / src / index.ts View on Github external
}

  fsFiles = await glob('**', workPath);
  const requirementsTxt = join(entryDirectory, 'requirements.txt');

  if (fsFiles[requirementsTxt]) {
    debug('Found local "requirements.txt"');
    const requirementsTxtPath = fsFiles[requirementsTxt].fsPath;
    await installRequirementsFile({
      filePath: requirementsTxtPath,
      workPath,
      meta,
    });
  } else if (fsFiles['requirements.txt']) {
    debug('Found global "requirements.txt"');
    const requirementsTxtPath = fsFiles['requirements.txt'].fsPath;
    await installRequirementsFile({
      filePath: requirementsTxtPath,
      workPath,
      meta,
    });
  }

  const originalPyPath = join(__dirname, '..', 'now_init.py');
  const originalNowHandlerPyContents = await readFile(originalPyPath, 'utf8');

  // will be used on `from $here import handler`
  // for example, `from api.users import handler`
  debug('Entrypoint is', entrypoint);
  const userHandlerFilePath = entrypoint
    .replace(/\//g, '.')
    .replace(/\.py$/, '');
github depscloud / depscloud / extractor / src / extractors / RequirementsTxtExtractor.ts View on Github external
public async extract(url: string, files: { [p: string]: ExtractorFile }): Promise {
        const dependencies: Array = [];

        const contents = files["requirements.txt"].raw();
        const lines = contents.split("\n");

        lines.forEach((line) => {
            const commentIndex = line.indexOf("#");
            if (commentIndex > -1) {
                line = line.substring(0, commentIndex);
            }

            line = line.trim()

            if (!line || line[0] === "-") {
                return
            }

            let l = line.length;
            for (const operator of operators) {
github nadav96 / rocketsam / src / actions / build / hash_util.js View on Github external
dirsum.digest(dir, 'sha1', function(err, hashes) {
		var requirementsHash = undefined
		var totalHash = ""

		if (hashes && hashes["files"] != undefined) {
			requirementsHash = hashes["files"]["requirements.txt"]
			if(requirementsHash == undefined) {
				requirementsHash = hashes["files"]["package.json"]
			}
			totalHash = hashes.hash
		}

		deferred.resolve({
			requirements: requirementsHash,
			total: totalHash
		})
	})
github phingofficial / phing / docs / docbook5 / en / output / webhelp / search / index-3.js View on Github external
w["repositori"]="56*1,69*2,79*1,85*1,97*2,100*8,107*2,110*8,113*8,114*10,124*1,133*4,145*1,150*10,159*5,166*4,186*3,190*2,204*4,221*3,239*1,278*1,282*1,287*6,295*6,301*10,323*2,355*14,364*1,388*2,413*4,466*7,470*3,484*2,488*6,493*1,495*13,499*43,502*2,513*1,520*6";
w["repository."]="166*1,186*1,204*1,295*1,413*1,499*1";
w["repositoryurl"]="56*2,88*4,124*2,127*3,145*2,190*1,239*2,281*2,323*1,349*2,383*3,388*1,398*5,498*3,502*1,530*4";
w["repres"]="17*1,29*1,125*1,155*3,182*1,288*1,307*1,325*2,356*1,357*1,377*2,402*1,448*1,460*1,499*1,501*1,517*1,523*1,528*2";
w["represent."]="29*1";
w["reproduc"]="42*1,402*1";
w["republish"]="402*2";
w["reput"]="42*1";
w["req"]="402*1";
w["request"]="21*4,26*1,76*12,86*1,252*1,256*1,326*3,334*1,386*1,402*1,470*1";
w["request."]="256*1";
w["requir"]="0*1,10*1,15*1,17*1,19*1,23*1,25*2,26*2,27*9,28*46,29*1,33*1,39*1,42*7,43*1,50*1,53*3,54*1,56*1,65*1,69*1,70*3,73*1,74*1,78*1,85*1,87*3,91*1,94*1,95*1,97*1,98*1,101*1,103*1,107*1,108*1,109*3,111*1,115*1,117*1,121*2,123*1,124*1,125*1,130*1,131*2,133*1,136*1,137*1,138*5,145*1,146*1,147*2,149*1,155*1,159*1,162*1,163*1,166*1,167*1,168*1,169*1,170*1,171*1,179*1,180*1,181*1,182*1,186*1,190*1,191*2,194*1,195*1,197*2,198*1,199*1,200*2,203*1,204*2,207*1,208*1,210*1,217*1,218*1,221*1,222*1,223*1,227*1,232*3,238*1,239*1,240*2,250*1,252*1,253*2,254*1,255*1,256*3,257*1,258*1,259*2,263*1,268*1,270*3,277*1,278*1,280*1,284*1,289*1,291*1,294*2,295*1,296*1,297*1,299*1,307*1,310*2,317*1,318*1,322*1,323*1,324*1,325*1,326*1,327*1,333*1,335*2,339*1,340*3,344*1,345*1,353*1,354*2,356*1,357*4,359*1,360*1,365*5,369*1,374*1,375*1,377*7,380*1,385*1,386*1,388*1,389*1,390*3,392*1,395*1,402*10,403*2,404*1,406*1,412*1,413*1,414*1,416*1,417*1,418*1,420*1,426*1,430*1,431*2,433*1,440*2,445*1,447*1,448*1,451*2,455*1,456*2,457*1,459*1,460*4,462*1,464*1,473*1,475*1,483*2,484*1,486*1,492*1,493*1,496*1,501*1,502*1,504*2,505*2,506*1,509*1,510*1,512*2,517*1,518*2,523*1,524*1,525*1,527*1,528*1,529*1";
w["require_onc"]="99*1,177*1,288*1";
w["required."]="70*2,109*1,232*1,294*1,335*1,340*1,365*1,390*1,403*1,456*1,512*1";
w["requirement."]="402*1";
w["requirements."]="53*1";
w["res"]="99*3";
w["reserv"]="382*1,402*1";
w["reset"]="69*1,221*1";
w["resid"]="49*1,129*1";
w["resolv"]="35*1,60*1,100*3,110*2,113*1,114*4,146*2,150*4,159*1,169*2,201*1,210*1,234*1,236*1,268*3,287*3,301*4,355*6,399*1,453*1,464*1,466*4,484*3,488*3,495*7,508*1,515*42";
w["resolve."]="268*1";
w["resolvedocumentextern"]="146*1,169*1";
w["resolveextern"]="210*1";
w["resolvepath"]="100*1,110*1,113*1,114*1,150*1,287*1,301*1,355*1,466*1,488*1,495*1,508*1";
w["resolvepathtask"]="268*47,453*1";
w["resolvestylesheetextern"]="146*1,169*1";
w["resourc"]="176*2,198*1,333*5,518*3,520*40";
w["resp"]="402*1";
w["respect"]="268*1,402*3";
w["respects."]="402*2";
w["respons"]="26*1,42*2,76*1,237*1,261*1,297*1,326*2,354*1,402*1,489*1";

requirements

[![npm](https://img.shields.io/npm/v/requirements?style=flat-square)](https://www.npmjs.com/package/requirements) [![coveralls](https://img.shields.io/coveralls/chimurai/requirements.svg?style=flat-square)](https://coveralls.io/r/chimurai/requirements) [!

MIT
Latest version published 9 days ago

Package Health Score

70 / 100
Full package analysis

Popular requirements functions