Skip to content

Commit

Permalink
feat: support toml v0.5.0 (#7559)
Browse files Browse the repository at this point in the history
Co-authored-by: Jamie Magee <JamieMagee@users.noreply.github.com>
  • Loading branch information
viceice and JamieMagee authored Oct 27, 2020
1 parent 3bffe6f commit 905cef7
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 20 deletions.
5 changes: 3 additions & 2 deletions lib/manager/cargo/extract.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from 'toml';
import { parse } from '@iarna/toml';
import * as datasourceCrate from '../../datasource/crate';
import { logger } from '../../logger';
import { SkipReason } from '../../types';
Expand Down Expand Up @@ -68,7 +68,8 @@ export function extractPackageFile(
logger.trace(`cargo.extractPackageFile(${fileName})`);
let parsedContent: CargoConfig;
try {
parsedContent = parse(content);
// TODO: fix type
parsedContent = parse(content) as any;
} catch (err) {
logger.debug({ err }, 'Error parsing Cargo.toml file');
return null;
Expand Down
5 changes: 3 additions & 2 deletions lib/manager/pipenv/extract.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import toml from '@iarna/toml';
import { RANGE_PATTERN } from '@renovate/pep440/lib/specifier';
import is from '@sindresorhus/is';
import toml from 'toml';
import * as datasourcePypi from '../../datasource/pypi';
import { logger } from '../../logger';
import { SkipReason } from '../../types';
Expand Down Expand Up @@ -121,7 +121,8 @@ export function extractPackageFile(content: string): PackageFile | null {

let pipfile: PipFile;
try {
pipfile = toml.parse(content);
// TODO: fix type
pipfile = toml.parse(content) as any;
} catch (err) {
logger.debug({ err }, 'Error parsing Pipfile');
return null;
Expand Down
4 changes: 4 additions & 0 deletions lib/manager/poetry/__fixtures__/pyproject.1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ dev_dep2 = "Invalid version."
[build-system]
requires = ["poetry>=1.0", "wheel"]
build-backend = "poetry.masonry.api"

[tool.coverage]
run.omit = ["*/tests_*.py"]
report.precision = 2
2 changes: 1 addition & 1 deletion lib/manager/poetry/artifacts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parse } from '@iarna/toml';
import is from '@sindresorhus/is';
import { quote } from 'shlex';
import { parse } from 'toml';
import { logger } from '../../logger';
import { ExecOptions, exec } from '../../util/exec';
import {
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/poetry/extract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parse } from '@iarna/toml';
import is from '@sindresorhus/is';
import { parse } from 'toml';
import * as datasourcePypi from '../../datasource/pypi';
import { logger } from '../../logger';
import { SkipReason } from '../../types';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"yarn": "^1.17.0"
},
"dependencies": {
"@iarna/toml": "2.2.5",
"@renovate/pep440": "0.4.1",
"@renovatebot/ruby-semver": "0.2.1",
"@sindresorhus/is": "4.0.0",
Expand Down Expand Up @@ -166,7 +167,6 @@
"shortid": "2.2.16",
"simple-git": "2.21.0",
"slugify": "1.4.5",
"toml": "3.0.0",
"traverse": "0.6.6",
"upath": "2.0.0",
"url-join": "4.0.1",
Expand Down
18 changes: 5 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,11 @@
glob "^7.1.2"
signal-exit "^3.0.2"

"@iarna/toml@2.2.5":
version "2.2.5"
resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c"
integrity sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==

"@istanbuljs/load-nyc-config@^1.0.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
Expand Down Expand Up @@ -7675,7 +7680,6 @@ npm@^6.13.0:
cmd-shim "^3.0.3"
columnify "~1.5.4"
config-chain "^1.1.12"
debuglog "*"
detect-indent "~5.0.0"
detect-newline "^2.1.0"
dezalgo "~1.0.3"
Expand All @@ -7690,7 +7694,6 @@ npm@^6.13.0:
has-unicode "~2.0.1"
hosted-git-info "^2.8.8"
iferr "^1.0.2"
imurmurhash "*"
infer-owner "^1.0.4"
inflight "~1.0.6"
inherits "^2.0.4"
Expand All @@ -7709,14 +7712,8 @@ npm@^6.13.0:
libnpx "^10.2.4"
lock-verify "^2.1.0"
lockfile "^1.0.4"
lodash._baseindexof "*"
lodash._baseuniq "~4.6.0"
lodash._bindcallback "*"
lodash._cacheindexof "*"
lodash._createcache "*"
lodash._getnative "*"
lodash.clonedeep "~4.5.0"
lodash.restparam "*"
lodash.union "~4.6.0"
lodash.uniq "~4.5.0"
lodash.without "~4.4.0"
Expand Down Expand Up @@ -10183,11 +10180,6 @@ to-vfile@^2.2.0:
vfile "^2.0.0"
x-is-function "^1.0.4"

toml@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee"
integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==

tough-cookie@^2.3.3, tough-cookie@~2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
Expand Down

0 comments on commit 905cef7

Please sign in to comment.