snyk 1.1261.0 → 1.1262.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -237124,7 +237124,7 @@ exports.generate = generate;
237124
237124
 
237125
237125
  /***/ }),
237126
237126
 
237127
- /***/ 86139:
237127
+ /***/ 93935:
237128
237128
  /***/ ((__unused_webpack_module, exports) => {
237129
237129
 
237130
237130
  "use strict";
@@ -237380,7 +237380,7 @@ const fs = __webpack_require__(57147);
237380
237380
  const path = __webpack_require__(71017);
237381
237381
  const parseXML = __webpack_require__(5055);
237382
237382
  const debugModule = __webpack_require__(15158);
237383
- const framework_1 = __webpack_require__(86139);
237383
+ const framework_1 = __webpack_require__(93935);
237384
237384
  const debug = debugModule('snyk');
237385
237385
  function findFile(rootDir, filter) {
237386
237386
  if (!fs.existsSync(rootDir)) {
@@ -238140,7 +238140,7 @@ exports.getMinimumTargetFramework = exports.parse = exports.fromPackagesConfigEn
238140
238140
  const parseXML = __webpack_require__(5055);
238141
238141
  const debugModule = __webpack_require__(15158);
238142
238142
  const depsParser = __webpack_require__(91885);
238143
- const framework_1 = __webpack_require__(86139);
238143
+ const framework_1 = __webpack_require__(93935);
238144
238144
  const debug = debugModule('snyk');
238145
238145
  function fromPackagesConfigEntry(manifest) {
238146
238146
  debug('Extracting by packages.config entry:' +
@@ -239302,12 +239302,19 @@ exports.buildDepGraph = buildDepGraph;
239302
239302
  "use strict";
239303
239303
 
239304
239304
  Object.defineProperty(exports, "__esModule", ({ value: true }));
239305
- exports.LockFileNotValid = exports.packageSpecsFrom = void 0;
239305
+ exports.packageSpecsFrom = void 0;
239306
239306
  const toml = __webpack_require__(5022);
239307
+ const error_catalog_nodejs_public_1 = __webpack_require__(88404);
239307
239308
  function packageSpecsFrom(lockFileContents) {
239308
- const lockFile = toml.parse(lockFileContents);
239309
+ let lockFile;
239310
+ try {
239311
+ lockFile = toml.parse(lockFileContents);
239312
+ }
239313
+ catch (error) {
239314
+ throw new error_catalog_nodejs_public_1.OpenSourceEcosystems.UnparseableLockFileError('The poetry.lock file is not parsable.', { error });
239315
+ }
239309
239316
  if (!lockFile.package) {
239310
- throw new LockFileNotValid();
239317
+ throw new error_catalog_nodejs_public_1.OpenSourceEcosystems.UnparseableLockFileError('The poetry.lock file contains no package stanza.');
239311
239318
  }
239312
239319
  return lockFile.package.map((pkg) => {
239313
239320
  return {
@@ -239318,13 +239325,6 @@ function packageSpecsFrom(lockFileContents) {
239318
239325
  });
239319
239326
  }
239320
239327
  exports.packageSpecsFrom = packageSpecsFrom;
239321
- class LockFileNotValid extends Error {
239322
- constructor() {
239323
- super("The poetry.lock file contains no package stanza'");
239324
- this.name = 'LockFileNotValid';
239325
- }
239326
- }
239327
- exports.LockFileNotValid = LockFileNotValid;
239328
239328
  //# sourceMappingURL=lock-file-parser.js.map
239329
239329
 
239330
239330
  /***/ }),
@@ -239335,8 +239335,9 @@ exports.LockFileNotValid = LockFileNotValid;
239335
239335
  "use strict";
239336
239336
 
239337
239337
  Object.defineProperty(exports, "__esModule", ({ value: true }));
239338
- exports.ManifestFileNotValid = exports.getDependenciesFrom = exports.pkgInfoFrom = void 0;
239338
+ exports.getDependenciesFrom = exports.pkgInfoFrom = void 0;
239339
239339
  const toml = __webpack_require__(5022);
239340
+ const error_catalog_nodejs_public_1 = __webpack_require__(88404);
239340
239341
  function pkgInfoFrom(manifestFileContents) {
239341
239342
  let manifest;
239342
239343
  try {
@@ -239346,16 +239347,22 @@ function pkgInfoFrom(manifestFileContents) {
239346
239347
  version: manifest.tool.poetry.version,
239347
239348
  };
239348
239349
  }
239349
- catch (_a) {
239350
- throw new ManifestFileNotValid();
239350
+ catch (error) {
239351
+ throw new error_catalog_nodejs_public_1.OpenSourceEcosystems.UnparseableManifestError('The pyproject.toml file is not parsable.', { error });
239351
239352
  }
239352
239353
  }
239353
239354
  exports.pkgInfoFrom = pkgInfoFrom;
239354
239355
  function getDependenciesFrom(manifestFileContents, includeDevDependencies) {
239355
239356
  var _a;
239356
- const manifest = toml.parse(manifestFileContents);
239357
+ let manifest;
239358
+ try {
239359
+ manifest = toml.parse(manifestFileContents);
239360
+ }
239361
+ catch (error) {
239362
+ throw new error_catalog_nodejs_public_1.OpenSourceEcosystems.UnparseableManifestError('The pyproject.toml file is not parsable.', { error });
239363
+ }
239357
239364
  if (!((_a = manifest.tool) === null || _a === void 0 ? void 0 : _a.poetry)) {
239358
- throw new ManifestFileNotValid();
239365
+ throw new error_catalog_nodejs_public_1.OpenSourceEcosystems.UnparseableManifestError('The pyproject.toml is not a valid poetry file.');
239359
239366
  }
239360
239367
  const dependencies = dependenciesFrom(manifest).map((dep) => ({
239361
239368
  name: dep,
@@ -239393,13 +239400,6 @@ function devDependenciesFrom(manifest) {
239393
239400
  function dependenciesFrom(manifest) {
239394
239401
  return Object.keys(manifest.tool.poetry.dependencies || []);
239395
239402
  }
239396
- class ManifestFileNotValid extends Error {
239397
- constructor() {
239398
- super('pyproject.toml is not a valid poetry file.');
239399
- this.name = 'ManifestFileNotValid';
239400
- }
239401
- }
239402
- exports.ManifestFileNotValid = ManifestFileNotValid;
239403
239403
  //# sourceMappingURL=manifest-parser.js.map
239404
239404
 
239405
239405
  /***/ }),
@@ -239583,6 +239583,8 @@ const subProcess = __webpack_require__(9783);
239583
239583
  const build_dep_graph_1 = __webpack_require__(41669);
239584
239584
  const types_1 = __webpack_require__(62914);
239585
239585
  const errors_1 = __webpack_require__(99893);
239586
+ const PYTHON_3_12_REGEX = new RegExp('^Python 3.12.*');
239587
+ const UPDATED_SETUPTOOLS_VERSION = '68.0.0';
239586
239588
  const returnedTargetFile = (originalTargetFile) => {
239587
239589
  const basename = path.basename(originalTargetFile);
239588
239590
  switch (basename) {
@@ -239664,6 +239666,7 @@ function createAssets() {
239664
239666
  path.join(__dirname, '../../pysrc/pkg_resources_py3/_vendor/pyparsing.py'),
239665
239667
  path.join(__dirname, '../../pysrc/pkg_resources_py3/__init__.py'),
239666
239668
  path.join(__dirname, '../../pysrc/pkg_resources_py3/extern/__init__.py'),
239669
+ path.join(__dirname, '../../pysrc/pkg_resources_py3_12/__init__.py'),
239667
239670
  ];
239668
239671
  }
239669
239672
  function writeFile(writeFilePath, contents) {
@@ -239694,6 +239697,24 @@ function dumpAllFilesInTempDir(tempDirName) {
239694
239697
  writeFile(writeFilePath, contents);
239695
239698
  });
239696
239699
  }
239700
+ function updateSetuptools(setuptoolsVersion, dir, pythonEnv) {
239701
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
239702
+ // For python 3.12, setuptools needs to be updated
239703
+ // due to removal of some deprecated packages
239704
+ // see: https://github.com/pypa/pip/pull/11997
239705
+ const pythonVersion = yield subProcess.execute(`python`, ['--version'], {
239706
+ cwd: dir,
239707
+ env: pythonEnv,
239708
+ });
239709
+ if (!PYTHON_3_12_REGEX.test(pythonVersion)) {
239710
+ return;
239711
+ }
239712
+ yield subProcess.execute(`pip install setuptools==${setuptoolsVersion}`, [], {
239713
+ cwd: dir,
239714
+ env: pythonEnv,
239715
+ });
239716
+ });
239717
+ }
239697
239718
  function inspectInstalledDeps(command, baseargs, root, targetFile, allowMissing, includeDevDeps, allowEmpty, args, projectName) {
239698
239719
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
239699
239720
  const tempDirObj = tmp.dirSync({
@@ -239702,6 +239723,7 @@ function inspectInstalledDeps(command, baseargs, root, targetFile, allowMissing,
239702
239723
  dumpAllFilesInTempDir(tempDirObj.name);
239703
239724
  try {
239704
239725
  const pythonEnv = getPythonEnv(targetFile);
239726
+ yield updateSetuptools(UPDATED_SETUPTOOLS_VERSION, root, pythonEnv);
239705
239727
  // See ../../pysrc/README.md
239706
239728
  const output = yield subProcess.execute(command, [
239707
239729
  ...baseargs,
@@ -293330,7 +293352,7 @@ exports.CompositeError = CompositeError;
293330
293352
  */
293331
293353
 
293332
293354
  Object.defineProperty(exports, "__esModule", ({ value: true }));
293333
- const tslib_1 = __webpack_require__(1212);
293355
+ const tslib_1 = __webpack_require__(86139);
293334
293356
  tslib_1.__exportStar(__webpack_require__(83649), exports);
293335
293357
  tslib_1.__exportStar(__webpack_require__(68218), exports);
293336
293358
  tslib_1.__exportStar(__webpack_require__(60826), exports);
@@ -293516,7 +293538,7 @@ exports.JsonApi = JsonApi;
293516
293538
  */
293517
293539
 
293518
293540
  Object.defineProperty(exports, "__esModule", ({ value: true }));
293519
- const tslib_1 = __webpack_require__(1212);
293541
+ const tslib_1 = __webpack_require__(86139);
293520
293542
  tslib_1.__exportStar(__webpack_require__(40697), exports);
293521
293543
  //# sourceMappingURL=index.js.map
293522
293544
 
@@ -302442,7 +302464,7 @@ module.exports = __webpack_require__(93419).YAML
302442
302464
 
302443
302465
  /***/ }),
302444
302466
 
302445
- /***/ 1212:
302467
+ /***/ 86139:
302446
302468
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
302447
302469
 
302448
302470
  "use strict";