lib/poetry.js
function isPoetryProject(servicePath) {
  const pyprojectPath = path.join(servicePath, 'pyproject.toml');

  if (!fse.existsSync(pyprojectPath)) {
    return false;
  }

  const pyprojectToml = fs.readFileSync(pyprojectPath);
  const pyproject = tomlParse(pyprojectToml);

  const buildSystemReqs =
    (pyproject['build-system'] && pyproject['build-system']['requires']) || [];

  for (var i = 0; i < buildSystemReqs.length; i++) {
    if (buildSystemReqs[i].startsWith('poetry')) {
      return true;
    }
  }

  return false;
}
function isPoetryProject(servicePath) {
  const pyprojectPath = path.join(servicePath, 'pyproject.toml');

  if (!fse.existsSync(pyprojectPath)) {
    return false;
  }

  const pyprojectToml = fs.readFileSync(pyprojectPath);
  const pyproject = tomlParse(pyprojectToml);

  const buildSystemReqs =
    (pyproject['build-system'] && pyproject['build-system']['requires']) || [];

  for (var i = 0; i < buildSystemReqs.length; i++) {
    if (buildSystemReqs[i].startsWith('poetry')) {
      return true;
    }
  }

  return false;
}
function isPoetryProject ( servicePath ) { const pyprojectPath = path . join ( servicePath , 'pyproject.toml' ) ; if ( ! fse . existsSync ( pyprojectPath ) ) { return false ; } const pyprojectToml = fs . readFileSync ( pyprojectPath ) ; const pyproject = tomlParse ( pyprojectToml ) ; const buildSystemReqs = ( pyproject [ 'build-system' ] && pyproject [ 'build-system' ] [ 'requires' ] ) || [ ] ; for ( var i = 0 ; i < buildSystemReqs . length ; i ++ ) { if ( buildSystemReqs [ i ] . startsWith ( 'poetry' ) ) { return true ; } } return false ; }
Check if pyproject.toml file exists and is a poetry project.
Check if pyproject . toml file exists and is a poetry project .