renovate 42.4.0 → 42.5.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.
- package/dist/config/decrypt.js +13 -14
- package/dist/config/decrypt.js.map +1 -1
- package/dist/config/massage.js +6 -7
- package/dist/config/massage.js.map +1 -1
- package/dist/config/migrate-validate.js +3 -3
- package/dist/config/migrate-validate.js.map +1 -1
- package/dist/config/migration.js +19 -20
- package/dist/config/migration.js.map +1 -1
- package/dist/config/migrations/base/abstract-migration.js +5 -6
- package/dist/config/migrations/base/abstract-migration.js.map +1 -1
- package/dist/config/migrations/custom/automerge-major-migration.js +2 -3
- package/dist/config/migrations/custom/automerge-major-migration.js.map +1 -1
- package/dist/config/migrations/custom/automerge-migration.js +4 -5
- package/dist/config/migrations/custom/automerge-migration.js.map +1 -1
- package/dist/config/migrations/custom/automerge-minor-migration.js +2 -3
- package/dist/config/migrations/custom/automerge-minor-migration.js.map +1 -1
- package/dist/config/migrations/custom/automerge-patch-migration.js +2 -3
- package/dist/config/migrations/custom/automerge-patch-migration.js.map +1 -1
- package/dist/config/migrations/custom/automerge-type-migration.js +2 -3
- package/dist/config/migrations/custom/automerge-type-migration.js.map +1 -1
- package/dist/config/migrations/custom/base-branch-migration.js +3 -4
- package/dist/config/migrations/custom/base-branch-migration.js.map +1 -1
- package/dist/config/migrations/custom/branch-name-migration.js +2 -3
- package/dist/config/migrations/custom/branch-name-migration.js.map +1 -1
- package/dist/config/migrations/custom/branch-prefix-migration.js +2 -3
- package/dist/config/migrations/custom/branch-prefix-migration.js.map +1 -1
- package/dist/config/migrations/custom/compatibility-migration.js +2 -3
- package/dist/config/migrations/custom/compatibility-migration.js.map +1 -1
- package/dist/config/migrations/custom/composer-ignore-platform-reqs-migration.js +2 -3
- package/dist/config/migrations/custom/composer-ignore-platform-reqs-migration.js.map +1 -1
- package/dist/config/migrations/custom/custom-managers-migration.js +2 -3
- package/dist/config/migrations/custom/custom-managers-migration.js.map +1 -1
- package/dist/config/migrations/custom/datasource-migration.js +2 -3
- package/dist/config/migrations/custom/datasource-migration.js.map +1 -1
- package/dist/config/migrations/custom/dep-types-migration.js +4 -5
- package/dist/config/migrations/custom/dep-types-migration.js.map +1 -1
- package/dist/config/migrations/custom/enabled-managers-migration.js +2 -3
- package/dist/config/migrations/custom/enabled-managers-migration.js.map +1 -1
- package/dist/config/migrations/custom/extends-migration.js +4 -5
- package/dist/config/migrations/custom/extends-migration.js.map +1 -1
- package/dist/config/migrations/custom/fetch-release-notes-migration.js +2 -3
- package/dist/config/migrations/custom/fetch-release-notes-migration.js.map +1 -1
- package/dist/config/migrations/custom/file-match-migration.js +3 -4
- package/dist/config/migrations/custom/file-match-migration.js.map +1 -1
- package/dist/config/migrations/custom/host-rules-migration.js +6 -7
- package/dist/config/migrations/custom/host-rules-migration.js.map +1 -1
- package/dist/config/migrations/custom/ignore-npmrc-file-migration.js +2 -3
- package/dist/config/migrations/custom/ignore-npmrc-file-migration.js.map +1 -1
- package/dist/config/migrations/custom/include-forks-migration.js +2 -3
- package/dist/config/migrations/custom/include-forks-migration.js.map +1 -1
- package/dist/config/migrations/custom/match-datasources-migration.js +2 -3
- package/dist/config/migrations/custom/match-datasources-migration.js.map +1 -1
- package/dist/config/migrations/custom/match-managers-migration.js +2 -3
- package/dist/config/migrations/custom/match-managers-migration.js.map +1 -1
- package/dist/config/migrations/custom/match-strings-migration.js +2 -3
- package/dist/config/migrations/custom/match-strings-migration.js.map +1 -1
- package/dist/config/migrations/custom/package-files-migration.js +6 -7
- package/dist/config/migrations/custom/package-files-migration.js.map +1 -1
- package/dist/config/migrations/custom/package-rules-migration.js +15 -16
- package/dist/config/migrations/custom/package-rules-migration.js.map +1 -1
- package/dist/config/migrations/custom/packages-migration.js +3 -4
- package/dist/config/migrations/custom/packages-migration.js.map +1 -1
- package/dist/config/migrations/custom/path-rules-migration.js +3 -4
- package/dist/config/migrations/custom/path-rules-migration.js.map +1 -1
- package/dist/config/migrations/custom/pin-versions-migration.js +2 -3
- package/dist/config/migrations/custom/pin-versions-migration.js.map +1 -1
- package/dist/config/migrations/custom/platform-commit-migration.js +2 -3
- package/dist/config/migrations/custom/platform-commit-migration.js.map +1 -1
- package/dist/config/migrations/custom/post-update-options-migration.js +2 -3
- package/dist/config/migrations/custom/post-update-options-migration.js.map +1 -1
- package/dist/config/migrations/custom/rebase-stale-prs-migration.js +2 -3
- package/dist/config/migrations/custom/rebase-stale-prs-migration.js.map +1 -1
- package/dist/config/migrations/custom/recreate-closed-migration.js +2 -3
- package/dist/config/migrations/custom/recreate-closed-migration.js.map +1 -1
- package/dist/config/migrations/custom/renovate-fork-migration.js +2 -3
- package/dist/config/migrations/custom/renovate-fork-migration.js.map +1 -1
- package/dist/config/migrations/custom/schedule-migration.js +4 -4
- package/dist/config/migrations/custom/schedule-migration.js.map +1 -1
- package/dist/config/migrations/custom/semantic-commits-migration.js +2 -3
- package/dist/config/migrations/custom/semantic-commits-migration.js.map +1 -1
- package/dist/config/migrations/custom/semantic-prefix-migration.js +2 -3
- package/dist/config/migrations/custom/semantic-prefix-migration.js.map +1 -1
- package/dist/config/migrations/custom/stability-days-migration.js +2 -3
- package/dist/config/migrations/custom/stability-days-migration.js.map +1 -1
- package/dist/config/migrations/custom/suppress-notifications-migration.js +2 -3
- package/dist/config/migrations/custom/suppress-notifications-migration.js.map +1 -1
- package/dist/config/migrations/custom/unpublish-safe-migration.js +2 -3
- package/dist/config/migrations/custom/unpublish-safe-migration.js.map +1 -1
- package/dist/config/migrations/migrations-service.js +2 -3
- package/dist/config/migrations/migrations-service.js.map +1 -1
- package/dist/config/options/index.js +7 -0
- package/dist/config/options/index.js.map +1 -1
- package/dist/config/presets/github/index.js +2 -3
- package/dist/config/presets/github/index.js.map +1 -1
- package/dist/config/presets/gitlab/index.js +2 -3
- package/dist/config/presets/gitlab/index.js.map +1 -1
- package/dist/config/presets/index.js +8 -8
- package/dist/config/presets/index.js.map +1 -1
- package/dist/config/presets/parse.js +2 -3
- package/dist/config/presets/parse.js.map +1 -1
- package/dist/config/secrets.js +3 -4
- package/dist/config/secrets.js.map +1 -1
- package/dist/config/types.d.ts +1 -0
- package/dist/config/types.js.map +1 -1
- package/dist/config/validation-helpers/match-base-branches.js +2 -3
- package/dist/config/validation-helpers/match-base-branches.js.map +1 -1
- package/dist/config/validation-helpers/regex-glob-matchers.js +2 -3
- package/dist/config/validation-helpers/regex-glob-matchers.js.map +1 -1
- package/dist/config/validation-helpers/utils.js +6 -6
- package/dist/config/validation-helpers/utils.js.map +1 -1
- package/dist/config/validation.js +29 -29
- package/dist/config/validation.js.map +1 -1
- package/dist/instrumentation/reporting.js +7 -8
- package/dist/instrumentation/reporting.js.map +1 -1
- package/dist/instrumentation/utils.js +2 -3
- package/dist/instrumentation/utils.js.map +1 -1
- package/dist/logger/err-serializer.js +2 -2
- package/dist/logger/err-serializer.js.map +1 -1
- package/dist/logger/index.js +3 -3
- package/dist/logger/index.js.map +1 -1
- package/dist/logger/renovate-logger.js +4 -5
- package/dist/logger/renovate-logger.js.map +1 -1
- package/dist/logger/utils.js +19 -19
- package/dist/logger/utils.js.map +1 -1
- package/dist/modules/datasource/aws-eks-addon/index.js +2 -2
- package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -1
- package/dist/modules/datasource/bazel/index.js +2 -2
- package/dist/modules/datasource/bazel/index.js.map +1 -1
- package/dist/modules/datasource/bitrise/index.js +2 -2
- package/dist/modules/datasource/bitrise/index.js.map +1 -1
- package/dist/modules/datasource/common.js +4 -4
- package/dist/modules/datasource/common.js.map +1 -1
- package/dist/modules/datasource/conan/index.js +3 -3
- package/dist/modules/datasource/conan/index.js.map +1 -1
- package/dist/modules/datasource/custom/formats/html.js +2 -5
- package/dist/modules/datasource/custom/formats/html.js.map +1 -1
- package/dist/modules/datasource/custom/index.js +2 -3
- package/dist/modules/datasource/custom/index.js.map +1 -1
- package/dist/modules/datasource/custom/utils.js +4 -4
- package/dist/modules/datasource/custom/utils.js.map +1 -1
- package/dist/modules/datasource/dart-version/index.js +2 -3
- package/dist/modules/datasource/dart-version/index.js.map +1 -1
- package/dist/modules/datasource/deno/index.js +2 -2
- package/dist/modules/datasource/deno/index.js.map +1 -1
- package/dist/modules/datasource/docker/common.js +5 -5
- package/dist/modules/datasource/docker/common.js.map +1 -1
- package/dist/modules/datasource/docker/index.js +6 -6
- package/dist/modules/datasource/docker/index.js.map +1 -1
- package/dist/modules/datasource/endoflife-date/index.js +2 -2
- package/dist/modules/datasource/endoflife-date/index.js.map +1 -1
- package/dist/modules/datasource/galaxy/index.js +2 -2
- package/dist/modules/datasource/galaxy/index.js.map +1 -1
- package/dist/modules/datasource/galaxy-collection/index.js +2 -2
- package/dist/modules/datasource/galaxy-collection/index.js.map +1 -1
- package/dist/modules/datasource/git-refs/base.js +2 -2
- package/dist/modules/datasource/git-refs/base.js.map +1 -1
- package/dist/modules/datasource/github-release-attachments/index.js +2 -2
- package/dist/modules/datasource/github-release-attachments/index.js.map +1 -1
- package/dist/modules/datasource/github-releases/index.js +2 -3
- package/dist/modules/datasource/github-releases/index.js.map +1 -1
- package/dist/modules/datasource/github-tags/index.js +2 -3
- package/dist/modules/datasource/github-tags/index.js.map +1 -1
- package/dist/modules/datasource/go/goproxy-parser.js +3 -3
- package/dist/modules/datasource/go/goproxy-parser.js.map +1 -1
- package/dist/modules/datasource/go/index.js +2 -2
- package/dist/modules/datasource/go/index.js.map +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js +3 -3
- package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
- package/dist/modules/datasource/hackage/index.js +2 -2
- package/dist/modules/datasource/hackage/index.js.map +1 -1
- package/dist/modules/datasource/hex/schema.js +2 -3
- package/dist/modules/datasource/hex/schema.js.map +1 -1
- package/dist/modules/datasource/hexpm-bob/index.js +2 -2
- package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
- package/dist/modules/datasource/index.js +14 -14
- package/dist/modules/datasource/index.js.map +1 -1
- package/dist/modules/datasource/jsr/index.js +2 -2
- package/dist/modules/datasource/jsr/index.js.map +1 -1
- package/dist/modules/datasource/jsr/util.js +3 -4
- package/dist/modules/datasource/jsr/util.js.map +1 -1
- package/dist/modules/datasource/metadata.js +5 -5
- package/dist/modules/datasource/metadata.js.map +1 -1
- package/dist/modules/datasource/npm/get.js +2 -2
- package/dist/modules/datasource/npm/get.js.map +1 -1
- package/dist/modules/datasource/npm/npmrc.js +7 -7
- package/dist/modules/datasource/npm/npmrc.js.map +1 -1
- package/dist/modules/datasource/nuget/v3.js +2 -2
- package/dist/modules/datasource/nuget/v3.js.map +1 -1
- package/dist/modules/datasource/packagist/index.js +2 -2
- package/dist/modules/datasource/packagist/index.js.map +1 -1
- package/dist/modules/datasource/packagist/schema.js +3 -4
- package/dist/modules/datasource/packagist/schema.js.map +1 -1
- package/dist/modules/datasource/pypi/index.js +2 -2
- package/dist/modules/datasource/pypi/index.js.map +1 -1
- package/dist/modules/datasource/repology/index.js +3 -3
- package/dist/modules/datasource/repology/index.js.map +1 -1
- package/dist/modules/datasource/rubygems/schema.js +5 -6
- package/dist/modules/datasource/rubygems/schema.js.map +1 -1
- package/dist/modules/datasource/util.js +2 -3
- package/dist/modules/datasource/util.js.map +1 -1
- package/dist/modules/manager/argocd/extract.js +3 -4
- package/dist/modules/manager/argocd/extract.js.map +1 -1
- package/dist/modules/manager/asdf/extract.js +2 -3
- package/dist/modules/manager/asdf/extract.js.map +1 -1
- package/dist/modules/manager/bazel/artifacts.js +2 -2
- package/dist/modules/manager/bazel/artifacts.js.map +1 -1
- package/dist/modules/manager/bazel/common.js +4 -5
- package/dist/modules/manager/bazel/common.js.map +1 -1
- package/dist/modules/manager/bazel/rules/http.js +3 -4
- package/dist/modules/manager/bazel/rules/http.js.map +1 -1
- package/dist/modules/manager/bazel/rules/maven.js +2 -3
- package/dist/modules/manager/bazel/rules/maven.js.map +1 -1
- package/dist/modules/manager/bazel-module/parser/starlark.js +2 -3
- package/dist/modules/manager/bazel-module/parser/starlark.js.map +1 -1
- package/dist/modules/manager/bazel-module/rules.js +3 -3
- package/dist/modules/manager/bazel-module/rules.js.map +1 -1
- package/dist/modules/manager/bitrise/utils.js +3 -4
- package/dist/modules/manager/bitrise/utils.js.map +1 -1
- package/dist/modules/manager/buildpacks/extract.js +2 -3
- package/dist/modules/manager/buildpacks/extract.js.map +1 -1
- package/dist/modules/manager/bun/artifacts.js +2 -2
- package/dist/modules/manager/bun/artifacts.js.map +1 -1
- package/dist/modules/manager/bun/extract.js +2 -3
- package/dist/modules/manager/bun/extract.js.map +1 -1
- package/dist/modules/manager/bundler/artifacts.js +3 -3
- package/dist/modules/manager/bundler/artifacts.js.map +1 -1
- package/dist/modules/manager/bundler/extract.js +5 -6
- package/dist/modules/manager/bundler/extract.js.map +1 -1
- package/dist/modules/manager/cargo/extract.js +3 -4
- package/dist/modules/manager/cargo/extract.js.map +1 -1
- package/dist/modules/manager/composer/artifacts.js +3 -3
- package/dist/modules/manager/composer/artifacts.js.map +1 -1
- package/dist/modules/manager/composer/utils.js +3 -4
- package/dist/modules/manager/composer/utils.js.map +1 -1
- package/dist/modules/manager/conan/extract.js +2 -3
- package/dist/modules/manager/conan/extract.js.map +1 -1
- package/dist/modules/manager/copier/utils.js +3 -4
- package/dist/modules/manager/copier/utils.js.map +1 -1
- package/dist/modules/manager/crow/extract.js +2 -3
- package/dist/modules/manager/crow/extract.js.map +1 -1
- package/dist/modules/manager/custom/jsonata/index.js +2 -3
- package/dist/modules/manager/custom/jsonata/index.js.map +1 -1
- package/dist/modules/manager/custom/jsonata/utils.js +3 -3
- package/dist/modules/manager/custom/jsonata/utils.js.map +1 -1
- package/dist/modules/manager/custom/regex/index.js +2 -3
- package/dist/modules/manager/custom/regex/index.js.map +1 -1
- package/dist/modules/manager/custom/regex/strategies.js +4 -5
- package/dist/modules/manager/custom/regex/strategies.js.map +1 -1
- package/dist/modules/manager/custom/regex/utils.js +2 -2
- package/dist/modules/manager/custom/regex/utils.js.map +1 -1
- package/dist/modules/manager/custom/utils.js +6 -7
- package/dist/modules/manager/custom/utils.js.map +1 -1
- package/dist/modules/manager/deps-edn/extract.js +13 -14
- package/dist/modules/manager/deps-edn/extract.js.map +1 -1
- package/dist/modules/manager/deps-edn/parser.js +2 -2
- package/dist/modules/manager/deps-edn/parser.js.map +1 -1
- package/dist/modules/manager/devbox/artifacts.js +2 -2
- package/dist/modules/manager/devbox/artifacts.js.map +1 -1
- package/dist/modules/manager/docker-compose/extract.js +3 -4
- package/dist/modules/manager/docker-compose/extract.js.map +1 -1
- package/dist/modules/manager/docker-compose/schema.js +2 -3
- package/dist/modules/manager/docker-compose/schema.js.map +1 -1
- package/dist/modules/manager/dockerfile/extract.js +5 -5
- package/dist/modules/manager/dockerfile/extract.js.map +1 -1
- package/dist/modules/manager/fingerprint.generated.js +5 -5
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/fleet/extract.js +2 -3
- package/dist/modules/manager/fleet/extract.js.map +1 -1
- package/dist/modules/manager/flux/extract.js +2 -3
- package/dist/modules/manager/flux/extract.js.map +1 -1
- package/dist/modules/manager/glasskube/extract.js +2 -3
- package/dist/modules/manager/glasskube/extract.js.map +1 -1
- package/dist/modules/manager/gleam/artifacts.js +3 -4
- package/dist/modules/manager/gleam/artifacts.js.map +1 -1
- package/dist/modules/manager/gomod/artifacts.js +2 -2
- package/dist/modules/manager/gomod/artifacts.js.map +1 -1
- package/dist/modules/manager/gradle/artifacts.js +2 -2
- package/dist/modules/manager/gradle/artifacts.js.map +1 -1
- package/dist/modules/manager/gradle/extract/catalog.js +5 -5
- package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
- package/dist/modules/manager/gradle-wrapper/artifacts.js +2 -2
- package/dist/modules/manager/gradle-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/helm-requirements/extract.js +2 -3
- package/dist/modules/manager/helm-requirements/extract.js.map +1 -1
- package/dist/modules/manager/helmfile/artifacts.js +2 -3
- package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
- package/dist/modules/manager/helmfile/extract.js +4 -5
- package/dist/modules/manager/helmfile/extract.js.map +1 -1
- package/dist/modules/manager/helmsman/extract.js +4 -5
- package/dist/modules/manager/helmsman/extract.js.map +1 -1
- package/dist/modules/manager/helmv3/artifacts.js +4 -4
- package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
- package/dist/modules/manager/helmv3/extract.js +4 -5
- package/dist/modules/manager/helmv3/extract.js.map +1 -1
- package/dist/modules/manager/helmv3/oci.js +3 -4
- package/dist/modules/manager/helmv3/oci.js.map +1 -1
- package/dist/modules/manager/jenkins/extract.js +3 -3
- package/dist/modules/manager/jenkins/extract.js.map +1 -1
- package/dist/modules/manager/kotlin-script/extract.js +3 -4
- package/dist/modules/manager/kotlin-script/extract.js.map +1 -1
- package/dist/modules/manager/kubernetes/extract.js +4 -4
- package/dist/modules/manager/kubernetes/extract.js.map +1 -1
- package/dist/modules/manager/kustomize/artifacts.js +8 -8
- package/dist/modules/manager/kustomize/artifacts.js.map +1 -1
- package/dist/modules/manager/kustomize/extract.js +8 -8
- package/dist/modules/manager/kustomize/extract.js.map +1 -1
- package/dist/modules/manager/maven/extract.js +4 -4
- package/dist/modules/manager/maven/extract.js.map +1 -1
- package/dist/modules/manager/maven/update.js +2 -2
- package/dist/modules/manager/maven/update.js.map +1 -1
- package/dist/modules/manager/maven-wrapper/artifacts.js +2 -2
- package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/mise/backends.js +9 -10
- package/dist/modules/manager/mise/backends.js.map +1 -1
- package/dist/modules/manager/mise/extract.js +7 -8
- package/dist/modules/manager/mise/extract.js.map +1 -1
- package/dist/modules/manager/mix/artifacts.js +3 -3
- package/dist/modules/manager/mix/artifacts.js.map +1 -1
- package/dist/modules/manager/nix/artifacts.js +2 -2
- package/dist/modules/manager/nix/artifacts.js.map +1 -1
- package/dist/modules/manager/npm/detect.js +2 -2
- package/dist/modules/manager/npm/detect.js.map +1 -1
- package/dist/modules/manager/npm/extract/common/dependency.js +2 -2
- package/dist/modules/manager/npm/extract/common/dependency.js.map +1 -1
- package/dist/modules/manager/npm/extract/common/overrides.js +3 -4
- package/dist/modules/manager/npm/extract/common/overrides.js.map +1 -1
- package/dist/modules/manager/npm/extract/common/package-file.js +8 -9
- package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
- package/dist/modules/manager/npm/extract/index.js +10 -10
- package/dist/modules/manager/npm/extract/index.js.map +1 -1
- package/dist/modules/manager/npm/extract/pnpm.js +7 -7
- package/dist/modules/manager/npm/extract/pnpm.js.map +1 -1
- package/dist/modules/manager/npm/extract/post/locked-versions.js +3 -3
- package/dist/modules/manager/npm/extract/post/locked-versions.js.map +1 -1
- package/dist/modules/manager/npm/extract/post/monorepo.js +3 -4
- package/dist/modules/manager/npm/extract/post/monorepo.js.map +1 -1
- package/dist/modules/manager/npm/extract/yarn.js +2 -3
- package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
- package/dist/modules/manager/npm/extract/yarnrc.js +2 -3
- package/dist/modules/manager/npm/extract/yarnrc.js.map +1 -1
- package/dist/modules/manager/npm/post-update/index.js +6 -6
- package/dist/modules/manager/npm/post-update/index.js.map +1 -1
- package/dist/modules/manager/npm/post-update/npm.js +4 -4
- package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/pnpm.js +3 -3
- package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/rules.js +2 -2
- package/dist/modules/manager/npm/post-update/rules.js.map +1 -1
- package/dist/modules/manager/npm/post-update/utils.js +2 -2
- package/dist/modules/manager/npm/post-update/utils.js.map +1 -1
- package/dist/modules/manager/npm/post-update/yarn.js +3 -3
- package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
- package/dist/modules/manager/npm/update/dependency/index.js +2 -3
- package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
- package/dist/modules/manager/npm/update/dependency/pnpm.js +2 -3
- package/dist/modules/manager/npm/update/dependency/pnpm.js.map +1 -1
- package/dist/modules/manager/npm/update/dependency/yarn.js +3 -4
- package/dist/modules/manager/npm/update/dependency/yarn.js.map +1 -1
- package/dist/modules/manager/nuget/config-formatter.js +2 -2
- package/dist/modules/manager/nuget/config-formatter.js.map +1 -1
- package/dist/modules/manager/nuget/extract.js +4 -4
- package/dist/modules/manager/nuget/extract.js.map +1 -1
- package/dist/modules/manager/nuget/package-tree.js +2 -2
- package/dist/modules/manager/nuget/package-tree.js.map +1 -1
- package/dist/modules/manager/ocb/extract.js +2 -3
- package/dist/modules/manager/ocb/extract.js.map +1 -1
- package/dist/modules/manager/osgi/extract.js +4 -4
- package/dist/modules/manager/osgi/extract.js.map +1 -1
- package/dist/modules/manager/pep621/artifacts.js +3 -4
- package/dist/modules/manager/pep621/artifacts.js.map +1 -1
- package/dist/modules/manager/pep621/processors/uv.js +2 -3
- package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
- package/dist/modules/manager/pep621/utils.js +8 -10
- package/dist/modules/manager/pep621/utils.js.map +1 -1
- package/dist/modules/manager/pep723/schema.js +2 -3
- package/dist/modules/manager/pep723/schema.js.map +1 -1
- package/dist/modules/manager/pip-compile/common.js +3 -3
- package/dist/modules/manager/pip-compile/common.js.map +1 -1
- package/dist/modules/manager/pip_requirements/artifacts.js +2 -3
- package/dist/modules/manager/pip_requirements/artifacts.js.map +1 -1
- package/dist/modules/manager/pip_requirements/extract.js +2 -3
- package/dist/modules/manager/pip_requirements/extract.js.map +1 -1
- package/dist/modules/manager/pipenv/artifacts.js +3 -4
- package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
- package/dist/modules/manager/pipenv/extract.js +6 -7
- package/dist/modules/manager/pipenv/extract.js.map +1 -1
- package/dist/modules/manager/pixi/artifacts.js +2 -3
- package/dist/modules/manager/pixi/artifacts.js.map +1 -1
- package/dist/modules/manager/pixi/extract.js +2 -3
- package/dist/modules/manager/pixi/extract.js.map +1 -1
- package/dist/modules/manager/poetry/artifacts.js +4 -5
- package/dist/modules/manager/poetry/artifacts.js.map +1 -1
- package/dist/modules/manager/poetry/extract.js +2 -3
- package/dist/modules/manager/poetry/extract.js.map +1 -1
- package/dist/modules/manager/pre-commit/extract.js +4 -5
- package/dist/modules/manager/pre-commit/extract.js.map +1 -1
- package/dist/modules/manager/pub/artifacts.js +3 -4
- package/dist/modules/manager/pub/artifacts.js.map +1 -1
- package/dist/modules/manager/pub/extract.js +8 -11
- package/dist/modules/manager/pub/extract.js.map +1 -1
- package/dist/modules/manager/renovate-config-presets/extract.js +4 -5
- package/dist/modules/manager/renovate-config-presets/extract.js.map +1 -1
- package/dist/modules/manager/tekton/extract.js +9 -10
- package/dist/modules/manager/tekton/extract.js.map +1 -1
- package/dist/modules/manager/terraform/base.js +2 -3
- package/dist/modules/manager/terraform/base.js.map +1 -1
- package/dist/modules/manager/terraform/extract.js +2 -2
- package/dist/modules/manager/terraform/extract.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/others/modules.js +3 -4
- package/dist/modules/manager/terraform/extractors/others/modules.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/others/providers.js +3 -4
- package/dist/modules/manager/terraform/extractors/others/providers.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js +7 -8
- package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/resources/helm-release.js +5 -6
- package/dist/modules/manager/terraform/extractors/resources/helm-release.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/resources/terraform-workspace.js +3 -4
- package/dist/modules/manager/terraform/extractors/resources/terraform-workspace.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/terraform-block/required-provider.js +4 -5
- package/dist/modules/manager/terraform/extractors/terraform-block/required-provider.js.map +1 -1
- package/dist/modules/manager/terraform/extractors/terraform-block/terraform-version.js +3 -3
- package/dist/modules/manager/terraform/extractors/terraform-block/terraform-version.js.map +1 -1
- package/dist/modules/manager/terraform/lockfile/index.js +2 -2
- package/dist/modules/manager/terraform/lockfile/index.js.map +1 -1
- package/dist/modules/manager/terraform/lockfile/util.js +2 -3
- package/dist/modules/manager/terraform/lockfile/util.js.map +1 -1
- package/dist/modules/manager/terraform/util.js +2 -3
- package/dist/modules/manager/terraform/util.js.map +1 -1
- package/dist/modules/manager/tflint-plugin/plugins.js +2 -3
- package/dist/modules/manager/tflint-plugin/plugins.js.map +1 -1
- package/dist/modules/manager/travis/extract.js +5 -6
- package/dist/modules/manager/travis/extract.js.map +1 -1
- package/dist/modules/manager/woodpecker/extract.js +2 -3
- package/dist/modules/manager/woodpecker/extract.js.map +1 -1
- package/dist/modules/platform/azure/index.js +2 -2
- package/dist/modules/platform/azure/index.js.map +1 -1
- package/dist/modules/platform/bitbucket/index.js +5 -5
- package/dist/modules/platform/bitbucket/index.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/pr-cache.js +2 -2
- package/dist/modules/platform/bitbucket-server/pr-cache.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/utils.js +2 -2
- package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
- package/dist/modules/platform/codecommit/codecommit-client.js +2 -2
- package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
- package/dist/modules/platform/forgejo/index.js +5 -5
- package/dist/modules/platform/forgejo/index.js.map +1 -1
- package/dist/modules/platform/forgejo/utils.js +2 -2
- package/dist/modules/platform/forgejo/utils.js.map +1 -1
- package/dist/modules/platform/gitea/index.js +5 -5
- package/dist/modules/platform/gitea/index.js.map +1 -1
- package/dist/modules/platform/gitea/utils.js +2 -2
- package/dist/modules/platform/gitea/utils.js.map +1 -1
- package/dist/modules/platform/github/common.js +4 -5
- package/dist/modules/platform/github/common.js.map +1 -1
- package/dist/modules/platform/github/index.js +5 -5
- package/dist/modules/platform/github/index.js.map +1 -1
- package/dist/modules/platform/github/pr.js +2 -3
- package/dist/modules/platform/github/pr.js.map +1 -1
- package/dist/modules/platform/gitlab/http.js +2 -3
- package/dist/modules/platform/gitlab/http.js.map +1 -1
- package/dist/modules/platform/gitlab/index.js +3 -3
- package/dist/modules/platform/gitlab/index.js.map +1 -1
- package/dist/modules/platform/gitlab/utils.js +3 -3
- package/dist/modules/platform/gitlab/utils.js.map +1 -1
- package/dist/modules/platform/pr-body.js +2 -3
- package/dist/modules/platform/pr-body.js.map +1 -1
- package/dist/modules/versioning/composer/index.js +2 -3
- package/dist/modules/versioning/composer/index.js.map +1 -1
- package/dist/modules/versioning/generic.js +5 -6
- package/dist/modules/versioning/generic.js.map +1 -1
- package/dist/modules/versioning/gradle/compare.js +3 -4
- package/dist/modules/versioning/gradle/compare.js.map +1 -1
- package/dist/modules/versioning/nixpkgs/index.js +6 -7
- package/dist/modules/versioning/nixpkgs/index.js.map +1 -1
- package/dist/modules/versioning/npm/range.js +2 -2
- package/dist/modules/versioning/npm/range.js.map +1 -1
- package/dist/modules/versioning/rpm/index.js +4 -5
- package/dist/modules/versioning/rpm/index.js.map +1 -1
- package/dist/modules/versioning/schema.js +2 -2
- package/dist/modules/versioning/schema.js.map +1 -1
- package/dist/modules/versioning/semver-coerced/index.js +3 -3
- package/dist/modules/versioning/semver-coerced/index.js.map +1 -1
- package/dist/modules/versioning/semver-partial/index.js +4 -4
- package/dist/modules/versioning/semver-partial/index.js.map +1 -1
- package/dist/proxy.js +3 -4
- package/dist/proxy.js.map +1 -1
- package/dist/util/array.js +4 -5
- package/dist/util/array.js.map +1 -1
- package/dist/util/assign-keys.js +2 -3
- package/dist/util/assign-keys.js.map +1 -1
- package/dist/util/cache/package/decorator.js +6 -6
- package/dist/util/cache/package/decorator.js.map +1 -1
- package/dist/util/cache/package/ttl.js +4 -5
- package/dist/util/cache/package/ttl.js.map +1 -1
- package/dist/util/cache/repository/impl/base.js +3 -4
- package/dist/util/cache/repository/impl/base.js.map +1 -1
- package/dist/util/cache/repository/impl/s3.js +2 -3
- package/dist/util/cache/repository/impl/s3.js.map +1 -1
- package/dist/util/exec/common.js +2 -3
- package/dist/util/exec/common.js.map +1 -1
- package/dist/util/exec/containerbase.js +2 -2
- package/dist/util/exec/containerbase.js.map +1 -1
- package/dist/util/exec/docker/index.js +5 -5
- package/dist/util/exec/docker/index.js.map +1 -1
- package/dist/util/exec/index.js +2 -2
- package/dist/util/exec/index.js.map +1 -1
- package/dist/util/exec/utils.js +3 -4
- package/dist/util/exec/utils.js.map +1 -1
- package/dist/util/filter-map.js +2 -3
- package/dist/util/filter-map.js.map +1 -1
- package/dist/util/fs/index.js +3 -3
- package/dist/util/fs/index.js.map +1 -1
- package/dist/util/git/auth.js +2 -3
- package/dist/util/git/auth.js.map +1 -1
- package/dist/util/git/config.js +3 -4
- package/dist/util/git/config.js.map +1 -1
- package/dist/util/git/index.js +4 -4
- package/dist/util/git/index.js.map +1 -1
- package/dist/util/git/private-key.js +2 -2
- package/dist/util/git/private-key.js.map +1 -1
- package/dist/util/host-rules.js +6 -6
- package/dist/util/host-rules.js.map +1 -1
- package/dist/util/http/auth.js +3 -4
- package/dist/util/http/auth.js.map +1 -1
- package/dist/util/http/bitbucket-server.js +2 -3
- package/dist/util/http/bitbucket-server.js.map +1 -1
- package/dist/util/http/bitbucket.js +3 -4
- package/dist/util/http/bitbucket.js.map +1 -1
- package/dist/util/http/cache/package-http-cache-provider.js +2 -2
- package/dist/util/http/cache/package-http-cache-provider.js.map +1 -1
- package/dist/util/http/forgejo.js +3 -4
- package/dist/util/http/forgejo.js.map +1 -1
- package/dist/util/http/gitea.js +3 -4
- package/dist/util/http/gitea.js.map +1 -1
- package/dist/util/http/github.js +10 -10
- package/dist/util/http/github.js.map +1 -1
- package/dist/util/http/gitlab.js +4 -5
- package/dist/util/http/gitlab.js.map +1 -1
- package/dist/util/http/host-rules.js +10 -10
- package/dist/util/http/host-rules.js.map +1 -1
- package/dist/util/http/http.js +5 -5
- package/dist/util/http/http.js.map +1 -1
- package/dist/util/http/rate-limits.js +3 -3
- package/dist/util/http/rate-limits.js.map +1 -1
- package/dist/util/interpolator.js +8 -9
- package/dist/util/interpolator.js.map +1 -1
- package/dist/util/merge-confidence/index.js +5 -5
- package/dist/util/merge-confidence/index.js.map +1 -1
- package/dist/util/number.js +2 -3
- package/dist/util/number.js.map +1 -1
- package/dist/util/package-rules/base-branches.js +3 -4
- package/dist/util/package-rules/base-branches.js.map +1 -1
- package/dist/util/package-rules/categories.js +3 -4
- package/dist/util/package-rules/categories.js.map +1 -1
- package/dist/util/package-rules/current-age.js +3 -4
- package/dist/util/package-rules/current-age.js.map +1 -1
- package/dist/util/package-rules/current-value.js +2 -3
- package/dist/util/package-rules/current-value.js.map +1 -1
- package/dist/util/package-rules/current-version.js +5 -5
- package/dist/util/package-rules/current-version.js.map +1 -1
- package/dist/util/package-rules/datasources.js +3 -4
- package/dist/util/package-rules/datasources.js.map +1 -1
- package/dist/util/package-rules/dep-names.js +3 -4
- package/dist/util/package-rules/dep-names.js.map +1 -1
- package/dist/util/package-rules/dep-types.js +2 -3
- package/dist/util/package-rules/dep-types.js.map +1 -1
- package/dist/util/package-rules/files.js +4 -5
- package/dist/util/package-rules/files.js.map +1 -1
- package/dist/util/package-rules/index.js +6 -6
- package/dist/util/package-rules/index.js.map +1 -1
- package/dist/util/package-rules/managers.js +3 -4
- package/dist/util/package-rules/managers.js.map +1 -1
- package/dist/util/package-rules/merge-confidence.js +5 -6
- package/dist/util/package-rules/merge-confidence.js.map +1 -1
- package/dist/util/package-rules/new-value.js +2 -3
- package/dist/util/package-rules/new-value.js.map +1 -1
- package/dist/util/package-rules/package-names.js +2 -3
- package/dist/util/package-rules/package-names.js.map +1 -1
- package/dist/util/package-rules/repositories.js +3 -4
- package/dist/util/package-rules/repositories.js.map +1 -1
- package/dist/util/package-rules/sourceurls.js +2 -3
- package/dist/util/package-rules/sourceurls.js.map +1 -1
- package/dist/util/package-rules/update-types.js +2 -3
- package/dist/util/package-rules/update-types.js.map +1 -1
- package/dist/util/pretty-time.js +4 -4
- package/dist/util/pretty-time.js.map +1 -1
- package/dist/util/regex.js +2 -3
- package/dist/util/regex.js.map +1 -1
- package/dist/util/s3.js +2 -3
- package/dist/util/s3.js.map +1 -1
- package/dist/util/sanitize.js +2 -3
- package/dist/util/sanitize.js.map +1 -1
- package/dist/util/string-match.js +2 -3
- package/dist/util/string-match.js.map +1 -1
- package/dist/util/template/index.js +6 -6
- package/dist/util/template/index.js.map +1 -1
- package/dist/util/url.js +5 -5
- package/dist/util/url.js.map +1 -1
- package/dist/workers/global/autodiscover.js +3 -4
- package/dist/workers/global/autodiscover.js.map +1 -1
- package/dist/workers/global/config/parse/additional-config-file.js +4 -4
- package/dist/workers/global/config/parse/additional-config-file.js.map +1 -1
- package/dist/workers/global/config/parse/coersions.js +2 -2
- package/dist/workers/global/config/parse/coersions.js.map +1 -1
- package/dist/workers/global/config/parse/env.js +2 -2
- package/dist/workers/global/config/parse/env.js.map +1 -1
- package/dist/workers/global/config/parse/file.js +5 -5
- package/dist/workers/global/config/parse/file.js.map +1 -1
- package/dist/workers/global/config/parse/index.js +6 -7
- package/dist/workers/global/config/parse/index.js.map +1 -1
- package/dist/workers/global/config/parse/util.js +2 -2
- package/dist/workers/global/config/parse/util.js.map +1 -1
- package/dist/workers/global/index.js +5 -5
- package/dist/workers/global/index.js.map +1 -1
- package/dist/workers/global/limits.js +6 -7
- package/dist/workers/global/limits.js.map +1 -1
- package/dist/workers/repository/config-migration/branch/index.js +2 -3
- package/dist/workers/repository/config-migration/branch/index.js.map +1 -1
- package/dist/workers/repository/config-migration/branch/migrated-data.js +2 -2
- package/dist/workers/repository/config-migration/branch/migrated-data.js.map +1 -1
- package/dist/workers/repository/config-migration/pr/index.js +3 -3
- package/dist/workers/repository/config-migration/pr/index.js.map +1 -1
- package/dist/workers/repository/dependency-dashboard.js +10 -10
- package/dist/workers/repository/dependency-dashboard.js.map +1 -1
- package/dist/workers/repository/error.js +6 -1
- package/dist/workers/repository/error.js.map +1 -1
- package/dist/workers/repository/extract/index.js +2 -3
- package/dist/workers/repository/extract/index.js.map +1 -1
- package/dist/workers/repository/extract/manager-files.js +2 -3
- package/dist/workers/repository/extract/manager-files.js.map +1 -1
- package/dist/workers/repository/extract/supersedes.js +4 -5
- package/dist/workers/repository/extract/supersedes.js.map +1 -1
- package/dist/workers/repository/finalize/prune.js +2 -3
- package/dist/workers/repository/finalize/prune.js.map +1 -1
- package/dist/workers/repository/init/inherited.js +5 -5
- package/dist/workers/repository/init/inherited.js.map +1 -1
- package/dist/workers/repository/init/merge.js +13 -13
- package/dist/workers/repository/init/merge.js.map +1 -1
- package/dist/workers/repository/model/commit-message.js +2 -3
- package/dist/workers/repository/model/commit-message.js.map +1 -1
- package/dist/workers/repository/onboarding/branch/index.js +2 -3
- package/dist/workers/repository/onboarding/branch/index.js.map +1 -1
- package/dist/workers/repository/onboarding/branch/onboarding-branch-cache.js +5 -6
- package/dist/workers/repository/onboarding/branch/onboarding-branch-cache.js.map +1 -1
- package/dist/workers/repository/onboarding/pr/config-description.js +2 -5
- package/dist/workers/repository/onboarding/pr/config-description.js.map +1 -1
- package/dist/workers/repository/onboarding/pr/index.js +3 -3
- package/dist/workers/repository/onboarding/pr/index.js.map +1 -1
- package/dist/workers/repository/package-files.js +8 -9
- package/dist/workers/repository/package-files.js.map +1 -1
- package/dist/workers/repository/process/extract-update.js +2 -2
- package/dist/workers/repository/process/extract-update.js.map +1 -1
- package/dist/workers/repository/process/fetch.js +3 -3
- package/dist/workers/repository/process/fetch.js.map +1 -1
- package/dist/workers/repository/process/lookup/current.js +2 -3
- package/dist/workers/repository/process/lookup/current.js.map +1 -1
- package/dist/workers/repository/process/lookup/filter-checks.js +4 -5
- package/dist/workers/repository/process/lookup/filter-checks.js.map +1 -1
- package/dist/workers/repository/process/lookup/generate.js +2 -3
- package/dist/workers/repository/process/lookup/generate.js.map +1 -1
- package/dist/workers/repository/process/lookup/index.js +15 -16
- package/dist/workers/repository/process/lookup/index.js.map +1 -1
- package/dist/workers/repository/process/lookup/utils.js +7 -7
- package/dist/workers/repository/process/lookup/utils.js.map +1 -1
- package/dist/workers/repository/process/vulnerabilities.js +11 -11
- package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
- package/dist/workers/repository/process/write.js +2 -3
- package/dist/workers/repository/process/write.js.map +1 -1
- package/dist/workers/repository/reconfigure/comment.js +2 -5
- package/dist/workers/repository/reconfigure/comment.js.map +1 -1
- package/dist/workers/repository/reconfigure/utils.js +2 -3
- package/dist/workers/repository/reconfigure/utils.js.map +1 -1
- package/dist/workers/repository/reconfigure/validate.js +2 -3
- package/dist/workers/repository/reconfigure/validate.js.map +1 -1
- package/dist/workers/repository/update/branch/auto-replace.js +4 -5
- package/dist/workers/repository/update/branch/auto-replace.js.map +1 -1
- package/dist/workers/repository/update/branch/commit.js +3 -4
- package/dist/workers/repository/update/branch/commit.js.map +1 -1
- package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +12 -5
- package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
- package/dist/workers/repository/update/branch/get-updated.js +8 -9
- package/dist/workers/repository/update/branch/get-updated.js.map +1 -1
- package/dist/workers/repository/update/branch/index.js +3 -3
- package/dist/workers/repository/update/branch/index.js.map +1 -1
- package/dist/workers/repository/update/branch/schedule.js +2 -2
- package/dist/workers/repository/update/branch/schedule.js.map +1 -1
- package/dist/workers/repository/update/pr/body/notes.js +2 -2
- package/dist/workers/repository/update/pr/body/notes.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +2 -2
- package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/index.js +3 -3
- package/dist/workers/repository/update/pr/changelog/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/release-notes.js +4 -4
- package/dist/workers/repository/update/pr/changelog/release-notes.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/source.js +8 -8
- package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
- package/dist/workers/repository/update/pr/code-owners.js +2 -2
- package/dist/workers/repository/update/pr/code-owners.js.map +1 -1
- package/dist/workers/repository/update/pr/index.js +7 -8
- package/dist/workers/repository/update/pr/index.js.map +1 -1
- package/dist/workers/repository/update/pr/labels.js +4 -4
- package/dist/workers/repository/update/pr/labels.js.map +1 -1
- package/dist/workers/repository/update/pr/participants.js +4 -5
- package/dist/workers/repository/update/pr/participants.js.map +1 -1
- package/dist/workers/repository/updates/generate.js +4 -4
- package/dist/workers/repository/updates/generate.js.map +1 -1
- package/package.json +3 -3
- package/renovate-schema.json +7 -2
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dependencyPattern = exports.extrasPattern = exports.packagePattern = void 0;
|
|
4
4
|
exports.extractPackageFile = extractPackageFile;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
5
|
// based on https://www.python.org/dev/peps/pep-0508/#names
|
|
7
6
|
const pep440_1 = require("@renovatebot/pep440");
|
|
8
|
-
const is_1 =
|
|
7
|
+
const is_1 = require("@sindresorhus/is");
|
|
9
8
|
const logger_1 = require("../../../logger");
|
|
10
9
|
const ignore_1 = require("../../../util/ignore");
|
|
11
10
|
const regex_1 = require("../../../util/regex");
|
|
@@ -81,7 +80,7 @@ function extractPackageFile(content) {
|
|
|
81
80
|
}
|
|
82
81
|
return dep;
|
|
83
82
|
})
|
|
84
|
-
.filter(is_1.
|
|
83
|
+
.filter(is_1.isTruthy);
|
|
85
84
|
const res = (0, common_2.extractPackageFileFlags)(content);
|
|
86
85
|
res.deps = deps;
|
|
87
86
|
if (!res.deps.length &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip_requirements/extract.ts"],"names":[],"mappings":";;;AA4BA,gDAgFC
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip_requirements/extract.ts"],"names":[],"mappings":";;;AA4BA,gDAgFC;AA5GD,2DAA2D;AAC3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["// based on https://www.python.org/dev/peps/pep-0508/#names\nimport { RANGE_PATTERN } from '@renovatebot/pep440';\nimport { isTruthy } from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport { isSkipComment } from '../../../util/ignore';\nimport { newlineRegex, regEx } from '../../../util/regex';\nimport { GitTagsDatasource } from '../../datasource/git-tags';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { normalizePythonDepName } from '../../datasource/pypi/common';\nimport type { PackageDependency, PackageFileContent } from '../types';\nimport { extractPackageFileFlags } from './common';\nimport type { PipRequirementsManagerData } from './types';\n\nexport const packagePattern =\n '[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]';\nexport const extrasPattern = '(?:\\\\s*\\\\[[^\\\\]]+\\\\])?';\nconst packageGitRegex = regEx(\n /(?<source>(?:git\\+)(?<protocol>git|ssh|https):\\/\\/(?<gitUrl>(?:(?<user>[^@]+)@)?(?<hostname>[\\w.-]+)(?<delimiter>\\/)(?<scmPath>.*\\/(?<depName>[\\w/-]+))(\\.git)?(?:@(?<version>.*))))/,\n);\n\nconst rangePattern: string = RANGE_PATTERN;\nconst specifierPartPattern = `\\\\s*${rangePattern.replace(\n regEx(/\\?<\\w+>/g),\n '?:',\n)}`;\nconst specifierPattern = `${specifierPartPattern}(?:\\\\s*,${specifierPartPattern})*`;\nexport const dependencyPattern = `(${packagePattern})(${extrasPattern})(${specifierPattern})`;\n\nexport function extractPackageFile(\n content: string,\n): PackageFileContent<PipRequirementsManagerData> | null {\n logger.trace('pip_requirements.extractPackageFile()');\n\n const pkgRegex = regEx(`^(${packagePattern})$`);\n const pkgValRegex = regEx(`^${dependencyPattern}$`);\n const deps = content\n .split(newlineRegex)\n .map((rawline) => {\n let dep: PackageDependency = {};\n const [line, comment] = rawline.split('#').map((part) => part.trim());\n if (isSkipComment(comment)) {\n dep.skipReason = 'ignored';\n }\n const [lineNoEnvMarkers] = line.split(';').map((part) => part.trim());\n const lineNoHashes = lineNoEnvMarkers.split(' \\\\')[0];\n const packageMatches =\n pkgValRegex.exec(lineNoHashes) ?? pkgRegex.exec(lineNoHashes);\n const gitPackageMatches = packageGitRegex.exec(lineNoHashes);\n if (!packageMatches && !gitPackageMatches) {\n return null;\n }\n if (gitPackageMatches?.groups) {\n const currentVersion = gitPackageMatches.groups.version;\n const depName = gitPackageMatches.groups.depName;\n let packageName: string;\n if (gitPackageMatches.groups.protocol === 'https') {\n packageName = 'https://'\n .concat(gitPackageMatches.groups.gitUrl)\n .replace(`@${currentVersion}`, '');\n } else {\n // we need to replace the / with a :\n const scmPath = gitPackageMatches.groups.scmPath;\n const delimiter = gitPackageMatches.groups.delimiter;\n packageName = gitPackageMatches.groups.gitUrl\n .replace(`${delimiter}${scmPath}`, `:${scmPath}`)\n .replace(`@${currentVersion}`, '');\n }\n dep = {\n ...dep,\n depName,\n currentValue: currentVersion,\n currentVersion,\n packageName,\n datasource: GitTagsDatasource.id,\n };\n return dep;\n }\n\n // validated above\n const [, depName, , currVal] = packageMatches!;\n const currentValue = currVal?.trim();\n dep = {\n ...dep,\n depName,\n packageName: normalizePythonDepName(depName),\n currentValue,\n datasource: PypiDatasource.id,\n };\n if (currentValue?.startsWith('==')) {\n dep.currentVersion = currentValue.replace(/^==\\s*/, '');\n }\n return dep;\n })\n .filter(isTruthy);\n\n const res = extractPackageFileFlags(content);\n res.deps = deps;\n\n if (\n !res.deps.length &&\n !res.registryUrls?.length &&\n !res.additionalRegistryUrls?.length &&\n !res.managerData?.requirementsFiles?.length &&\n !res.managerData?.constraintsFiles?.length\n ) {\n return null;\n }\n return res;\n}\n"]}
|
|
@@ -4,9 +4,8 @@ exports.getMatchingHostRule = getMatchingHostRule;
|
|
|
4
4
|
exports.extractEnvironmentVariableName = extractEnvironmentVariableName;
|
|
5
5
|
exports.addExtraEnvVariable = addExtraEnvVariable;
|
|
6
6
|
exports.updateArtifacts = updateArtifacts;
|
|
7
|
-
const tslib_1 = require("tslib");
|
|
8
7
|
const detect_tools_1 = require("@renovatebot/detect-tools");
|
|
9
|
-
const is_1 =
|
|
8
|
+
const is_1 = require("@sindresorhus/is");
|
|
10
9
|
const error_messages_1 = require("../../../constants/error-messages");
|
|
11
10
|
const logger_1 = require("../../../logger");
|
|
12
11
|
const exec_1 = require("../../../util/exec");
|
|
@@ -32,8 +31,8 @@ async function findPipfileSourceUrlsWithCredentials(pipfileContent, pipfileName)
|
|
|
32
31
|
const pipfile = await (0, extract_1.extractPackageFile)(pipfileContent, pipfileName);
|
|
33
32
|
return (pipfile?.registryUrls
|
|
34
33
|
?.map(url_1.parseUrl)
|
|
35
|
-
.filter(is_1.
|
|
36
|
-
.filter((url) => is_1.
|
|
34
|
+
.filter(is_1.isUrlInstance)
|
|
35
|
+
.filter((url) => (0, is_1.isNonEmptyStringAndNotWhitespace)(url.username)) ?? []);
|
|
37
36
|
}
|
|
38
37
|
/**
|
|
39
38
|
* This will extract the actual variable name from an environment-placeholder:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pipenv/artifacts.ts"],"names":[],"mappings":";;AAwBA,kDAUC;AAoBD,wEAKC;AAED,kDAkBC;AA6CD,0CA8EC;;AA1MD,4DAAmE;AACnE,kEAAkC;AAClC,sEAAoE;AACpE,4CAAyC;AAEzC,6CAA0C;AAE1C,yCAO0B;AAC1B,gDAAwD;AACxD,2CAAkD;AAClD,yDAAgD;AAChD,+CAA4C;AAC5C,2CAA6C;AAC7C,gDAAuD;AAEvD,uCAA+C;AAE/C,SAAgB,mBAAmB,CAAC,GAAW;IAC7C,MAAM,SAAS,GAAG,IAAA,cAAQ,EAAC,GAAG,CAAC,CAAC;IAChC,IAAI,SAAS,EAAE,CAAC;QACd,SAAS,CAAC,QAAQ,GAAG,EAAE,CAAC;QACxB,SAAS,CAAC,QAAQ,GAAG,EAAE,CAAC;QACxB,MAAM,qBAAqB,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;QAEn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C,MAAM,IAAA,WAAI,EAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAa,GAAE,CAAC;QACrC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YAC7C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAC/C,OAAO;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,MAAM,IAAA,kBAAa,EAAC,YAAY,EAAE,MAAM,CAAC;iBACpD;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,qBAAqB;QACrB,IAAI,GAAG,CAAC,OAAO,KAAK,gCAAe,EAAE,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,+BAA+B,CAAC,CAAC;QACvD,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,GAAG,CAAC,OAAO;iBACpB;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { pipenv as pipenvDetect } from '@renovatebot/detect-tools';\nimport is from '@sindresorhus/is';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions, ExtraEnv, Opt } from '../../../util/exec/types';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getParentDir,\n localPathExists,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport { ensureLocalPath } from '../../../util/fs/util';\nimport { getRepoStatus } from '../../../util/git';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { parseUrl } from '../../../util/url';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { extractPackageFile } from './extract';\n\nexport function getMatchingHostRule(url: string): HostRule | null {\n const parsedUrl = parseUrl(url);\n if (parsedUrl) {\n parsedUrl.username = '';\n parsedUrl.password = '';\n const urlWithoutCredentials = parsedUrl.toString();\n\n return find({ hostType: PypiDatasource.id, url: urlWithoutCredentials });\n }\n return null;\n}\n\nasync function findPipfileSourceUrlsWithCredentials(\n pipfileContent: string,\n pipfileName: string,\n): Promise<URL[]> {\n const pipfile = await extractPackageFile(pipfileContent, pipfileName);\n\n return (\n pipfile?.registryUrls\n ?.map(parseUrl)\n .filter(is.urlInstance)\n .filter((url) => is.nonEmptyStringAndNotWhitespace(url.username)) ?? []\n );\n}\n\n/**\n * This will extract the actual variable name from an environment-placeholder:\n * ${USERNAME:-defaultvalue} will yield 'USERNAME'\n */\nexport function extractEnvironmentVariableName(\n credential: string,\n): string | null {\n const match = regEx('([a-z0-9_]+)', 'i').exec(decodeURI(credential));\n return match?.length ? match[0] : null;\n}\n\nexport function addExtraEnvVariable(\n extraEnv: ExtraEnv<unknown>,\n environmentVariableName: string,\n environmentValue: string,\n): void {\n logger.trace(\n `Adding ${environmentVariableName} environment variable for pipenv`,\n );\n if (\n extraEnv[environmentVariableName] &&\n extraEnv[environmentVariableName] !== environmentValue\n ) {\n logger.warn(\n { envVar: environmentVariableName },\n 'Possible misconfiguration, environment variable already set to a different value',\n );\n }\n extraEnv[environmentVariableName] = environmentValue;\n}\n\n/**\n * Pipenv allows configuring source-urls for remote repositories with placeholders for credentials, i.e. http://$USER:$PASS@myprivate.repo\n * if a matching host rule exists for that repository, we need to set the corresponding variables.\n * Simply substituting them in the URL is not an option as it would impact the hash for the resulting Pipfile.lock\n *\n */\nasync function addCredentialsForSourceUrls(\n newPipfileContent: string,\n pipfileName: string,\n extraEnv: ExtraEnv<unknown>,\n): Promise<void> {\n const sourceUrls = await findPipfileSourceUrlsWithCredentials(\n newPipfileContent,\n pipfileName,\n );\n for (const parsedSourceUrl of sourceUrls) {\n logger.trace(`Trying to add credentials for ${parsedSourceUrl.toString()}`);\n const matchingHostRule = getMatchingHostRule(parsedSourceUrl.toString());\n if (matchingHostRule) {\n const usernameVariableName = extractEnvironmentVariableName(\n parsedSourceUrl.username,\n );\n if (matchingHostRule.username && usernameVariableName) {\n addExtraEnvVariable(\n extraEnv,\n usernameVariableName,\n matchingHostRule.username,\n );\n }\n const passwordVariableName = extractEnvironmentVariableName(\n parsedSourceUrl.password,\n );\n if (matchingHostRule.password && passwordVariableName) {\n addExtraEnvVariable(\n extraEnv,\n passwordVariableName,\n matchingHostRule.password,\n );\n }\n }\n }\n}\n\nexport async function updateArtifacts({\n packageFileName: pipfileName,\n newPackageFileContent: newPipfileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pipenv.updateArtifacts(${pipfileName})`);\n\n const lockFileName = pipfileName + '.lock';\n if (!(await localPathExists(lockFileName))) {\n logger.debug('No Pipfile.lock found');\n return null;\n }\n try {\n await writeLocalFile(pipfileName, newPipfileContent);\n if (config.isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n }\n const cmd = 'pipenv lock';\n const pipfileDir = getParentDir(ensureLocalPath(pipfileName));\n const tagConstraint =\n config.constraints?.python ??\n (await pipenvDetect.getPythonConstraint(pipfileDir));\n const pipenvConstraint =\n config.constraints?.pipenv ??\n (await pipenvDetect.getPipenvConstraint(pipfileDir));\n const extraEnv: Opt<ExtraEnv> = {\n PIPENV_CACHE_DIR: await ensureCacheDir('pipenv'),\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n WORKON_HOME: await ensureCacheDir('virtualenvs'),\n };\n const execOptions: ExecOptions = {\n cwdFile: pipfileName,\n docker: {},\n toolConstraints: [\n {\n toolName: 'python',\n constraint: tagConstraint,\n },\n {\n toolName: 'pipenv',\n constraint: pipenvConstraint,\n },\n ],\n };\n await addCredentialsForSourceUrls(newPipfileContent, pipfileName, extraEnv);\n execOptions.extraEnv = extraEnv;\n\n logger.trace({ cmd }, 'pipenv lock command');\n await exec(cmd, execOptions);\n const status = await getRepoStatus();\n if (!status?.modified.includes(lockFileName)) {\n return null;\n }\n logger.debug('Returning updated Pipfile.lock');\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: await readLocalFile(lockFileName, 'utf8'),\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, 'Failed to update Pipfile.lock');\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: err.message,\n },\n },\n ];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pipenv/artifacts.ts"],"names":[],"mappings":";;AA2BA,kDAUC;AAoBD,wEAKC;AAED,kDAkBC;AA6CD,0CA8EC;AA7MD,4DAAmE;AACnE,yCAG0B;AAC1B,sEAAoE;AACpE,4CAAyC;AAEzC,6CAA0C;AAE1C,yCAO0B;AAC1B,gDAAwD;AACxD,2CAAkD;AAClD,yDAAgD;AAChD,+CAA4C;AAC5C,2CAA6C;AAC7C,gDAAuD;AAEvD,uCAA+C;AAE/C,SAAgB,mBAAmB,CAAC,GAAW;IAC7C,MAAM,SAAS,GAAG,IAAA,cAAQ,EAAC,GAAG,CAAC,CAAC;IAChC,IAAI,SAAS,EAAE,CAAC;QACd,SAAS,CAAC,QAAQ,GAAG,EAAE,CAAC;QACxB,SAAS,CAAC,QAAQ,GAAG,EAAE,CAAC;QACxB,MAAM,qBAAqB,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;QAEnD,OAAO,IAAA,iBAAI,EAAC,EAAE,QAAQ,EAAE,qBAAc,CAAC,EAAE,EAAE,GAAG,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AA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AC,EAAE,CAAC;YAC7C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAC/C,OAAO;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,MAAM,IAAA,kBAAa,EAAC,YAAY,EAAE,MAAM,CAAC;iBACpD;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,qBAAqB;QACrB,IAAI,GAAG,CAAC,OAAO,KAAK,gCAAe,EAAE,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,+BAA+B,CAAC,CAAC;QACvD,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,GAAG,CAAC,OAAO;iBACpB;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { pipenv as pipenvDetect } from '@renovatebot/detect-tools';\nimport {\n isNonEmptyStringAndNotWhitespace,\n isUrlInstance,\n} from '@sindresorhus/is';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions, ExtraEnv, Opt } from '../../../util/exec/types';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getParentDir,\n localPathExists,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport { ensureLocalPath } from '../../../util/fs/util';\nimport { getRepoStatus } from '../../../util/git';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { parseUrl } from '../../../util/url';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { extractPackageFile } from './extract';\n\nexport function getMatchingHostRule(url: string): HostRule | null {\n const parsedUrl = parseUrl(url);\n if (parsedUrl) {\n parsedUrl.username = '';\n parsedUrl.password = '';\n const urlWithoutCredentials = parsedUrl.toString();\n\n return find({ hostType: PypiDatasource.id, url: urlWithoutCredentials });\n }\n return null;\n}\n\nasync function findPipfileSourceUrlsWithCredentials(\n pipfileContent: string,\n pipfileName: string,\n): Promise<URL[]> {\n const pipfile = await extractPackageFile(pipfileContent, pipfileName);\n\n return (\n pipfile?.registryUrls\n ?.map(parseUrl)\n .filter(isUrlInstance)\n .filter((url) => isNonEmptyStringAndNotWhitespace(url.username)) ?? []\n );\n}\n\n/**\n * This will extract the actual variable name from an environment-placeholder:\n * ${USERNAME:-defaultvalue} will yield 'USERNAME'\n */\nexport function extractEnvironmentVariableName(\n credential: string,\n): string | null {\n const match = regEx('([a-z0-9_]+)', 'i').exec(decodeURI(credential));\n return match?.length ? match[0] : null;\n}\n\nexport function addExtraEnvVariable(\n extraEnv: ExtraEnv<unknown>,\n environmentVariableName: string,\n environmentValue: string,\n): void {\n logger.trace(\n `Adding ${environmentVariableName} environment variable for pipenv`,\n );\n if (\n extraEnv[environmentVariableName] &&\n extraEnv[environmentVariableName] !== environmentValue\n ) {\n logger.warn(\n { envVar: environmentVariableName },\n 'Possible misconfiguration, environment variable already set to a different value',\n );\n }\n extraEnv[environmentVariableName] = environmentValue;\n}\n\n/**\n * Pipenv allows configuring source-urls for remote repositories with placeholders for credentials, i.e. http://$USER:$PASS@myprivate.repo\n * if a matching host rule exists for that repository, we need to set the corresponding variables.\n * Simply substituting them in the URL is not an option as it would impact the hash for the resulting Pipfile.lock\n *\n */\nasync function addCredentialsForSourceUrls(\n newPipfileContent: string,\n pipfileName: string,\n extraEnv: ExtraEnv<unknown>,\n): Promise<void> {\n const sourceUrls = await findPipfileSourceUrlsWithCredentials(\n newPipfileContent,\n pipfileName,\n );\n for (const parsedSourceUrl of sourceUrls) {\n logger.trace(`Trying to add credentials for ${parsedSourceUrl.toString()}`);\n const matchingHostRule = getMatchingHostRule(parsedSourceUrl.toString());\n if (matchingHostRule) {\n const usernameVariableName = extractEnvironmentVariableName(\n parsedSourceUrl.username,\n );\n if (matchingHostRule.username && usernameVariableName) {\n addExtraEnvVariable(\n extraEnv,\n usernameVariableName,\n matchingHostRule.username,\n );\n }\n const passwordVariableName = extractEnvironmentVariableName(\n parsedSourceUrl.password,\n );\n if (matchingHostRule.password && passwordVariableName) {\n addExtraEnvVariable(\n extraEnv,\n passwordVariableName,\n matchingHostRule.password,\n );\n }\n }\n }\n}\n\nexport async function updateArtifacts({\n packageFileName: pipfileName,\n newPackageFileContent: newPipfileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pipenv.updateArtifacts(${pipfileName})`);\n\n const lockFileName = pipfileName + '.lock';\n if (!(await localPathExists(lockFileName))) {\n logger.debug('No Pipfile.lock found');\n return null;\n }\n try {\n await writeLocalFile(pipfileName, newPipfileContent);\n if (config.isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n }\n const cmd = 'pipenv lock';\n const pipfileDir = getParentDir(ensureLocalPath(pipfileName));\n const tagConstraint =\n config.constraints?.python ??\n (await pipenvDetect.getPythonConstraint(pipfileDir));\n const pipenvConstraint =\n config.constraints?.pipenv ??\n (await pipenvDetect.getPipenvConstraint(pipfileDir));\n const extraEnv: Opt<ExtraEnv> = {\n PIPENV_CACHE_DIR: await ensureCacheDir('pipenv'),\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n WORKON_HOME: await ensureCacheDir('virtualenvs'),\n };\n const execOptions: ExecOptions = {\n cwdFile: pipfileName,\n docker: {},\n toolConstraints: [\n {\n toolName: 'python',\n constraint: tagConstraint,\n },\n {\n toolName: 'pipenv',\n constraint: pipenvConstraint,\n },\n ],\n };\n await addCredentialsForSourceUrls(newPipfileContent, pipfileName, extraEnv);\n execOptions.extraEnv = extraEnv;\n\n logger.trace({ cmd }, 'pipenv lock command');\n await exec(cmd, execOptions);\n const status = await getRepoStatus();\n if (!status?.modified.includes(lockFileName)) {\n return null;\n }\n logger.debug('Returning updated Pipfile.lock');\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: await readLocalFile(lockFileName, 'utf8'),\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, 'Failed to update Pipfile.lock');\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: err.message,\n },\n },\n ];\n }\n}\n"]}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extrasPattern = exports.packagePattern = void 0;
|
|
4
4
|
exports.extractPackageFile = extractPackageFile;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
5
|
const detect_tools_1 = require("@renovatebot/detect-tools");
|
|
7
6
|
const pep440_1 = require("@renovatebot/pep440");
|
|
8
|
-
const is_1 =
|
|
7
|
+
const is_1 = require("@sindresorhus/is");
|
|
9
8
|
const logger_1 = require("../../../logger");
|
|
10
9
|
const fs_1 = require("../../../util/fs");
|
|
11
10
|
const util_1 = require("../../../util/fs/util");
|
|
@@ -29,7 +28,7 @@ function extractFromSection(sectionName, pipfileSection, sources) {
|
|
|
29
28
|
let currentValue;
|
|
30
29
|
let nestedVersion = false;
|
|
31
30
|
let skipReason;
|
|
32
|
-
if (is_1.
|
|
31
|
+
if ((0, is_1.isObject)(requirements)) {
|
|
33
32
|
if (requirements.git) {
|
|
34
33
|
skipReason = 'git-dependency';
|
|
35
34
|
}
|
|
@@ -91,7 +90,7 @@ function extractFromSection(sectionName, pipfileSection, sources) {
|
|
|
91
90
|
// TODO #22198
|
|
92
91
|
dep.managerData.nestedVersion = nestedVersion;
|
|
93
92
|
}
|
|
94
|
-
if (sources && is_1.
|
|
93
|
+
if (sources && (0, is_1.isObject)(requirements) && requirements.index) {
|
|
95
94
|
const source = sources.find((item) => item.name === requirements.index);
|
|
96
95
|
if (source) {
|
|
97
96
|
dep.registryUrls = [source.url];
|
|
@@ -103,9 +102,9 @@ function extractFromSection(sectionName, pipfileSection, sources) {
|
|
|
103
102
|
return deps;
|
|
104
103
|
}
|
|
105
104
|
function isPipRequirements(section) {
|
|
106
|
-
return (!is_1.
|
|
107
|
-
is_1.
|
|
108
|
-
!Object.values(section).some((dep) => !is_1.
|
|
105
|
+
return (!(0, is_1.isArray)(section) &&
|
|
106
|
+
(0, is_1.isObject)(section) &&
|
|
107
|
+
!Object.values(section).some((dep) => !(0, is_1.isObject)(dep) && !(0, is_1.isString)(dep)));
|
|
109
108
|
}
|
|
110
109
|
async function extractPackageFile(content, packageFile) {
|
|
111
110
|
logger_1.logger.trace(`pipenv.extractPackageFile(${packageFile})`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pipenv/extract.ts"],"names":[],"mappings":";;;AA4HA,gDA6DC;;AAzLD,4DAAmE;AACnE,gDAAoD;AACpD,kEAAkC;AAClC,4CAAyC;AAEzC,yCAAiE;AACjE,gDAAwD;AACxD,+CAA4C;AAC5C,6CAAwD;AACxD,gDAAuD;AACvD,yDAAsE;AAItE,2DAA2D;AAC9C,QAAA,cAAc,GAAG,uCAAuC,CAAC;AACzD,QAAA,aAAa,GAAG,wBAAwB,CAAC;AACtD,MAAM,YAAY,GAAG,IAAA,aAAK,EAAC,KAAK,sBAAc,KAAK,qBAAa,IAAI,EAAE,GAAG,CAAC,CAAC;AAE3E,MAAM,YAAY,GAAW,sBAAa,CAAC;AAE3C,MAAM,oBAAoB,GAAG,OAAO,YAAY,CAAC,OAAO,CACtD,IAAA,aAAK,EAAC,UAAU,CAAC,EACjB,IAAI,CACL,MAAM,CAAC;AACR,MAAM,gBAAgB,GAAG,GAAG,oBAAoB,OAAO,oBAAoB,IAAI,CAAC;AAChF,MAAM,cAAc,GAAG,IAAA,aAAK,EAAC,IAAI,gBAAgB,GAAG,CAAC,CAAC;AACtD,S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C;AACb,CAAC","sourcesContent":["import { pipenv as pipenvDetect } from '@renovatebot/detect-tools';\nimport { RANGE_PATTERN } from '@renovatebot/pep440';\nimport is from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport type { SkipReason } from '../../../types';\nimport { getParentDir, localPathExists } from '../../../util/fs';\nimport { ensureLocalPath } from '../../../util/fs/util';\nimport { regEx } from '../../../util/regex';\nimport { parse as parseToml } from '../../../util/toml';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { normalizePythonDepName } from '../../datasource/pypi/common';\nimport type { PackageDependency, PackageFileContent } from '../types';\nimport type { PipFile, PipRequirement, PipSource } from './types';\n\n// based on https://www.python.org/dev/peps/pep-0508/#names\nexport const packagePattern = '[A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9]';\nexport const extrasPattern = '(?:\\\\s*\\\\[[^\\\\]]+\\\\])*';\nconst packageRegex = regEx(`^(${packagePattern})(${extrasPattern})$`, 'i');\n\nconst rangePattern: string = RANGE_PATTERN;\n\nconst specifierPartPattern = `\\\\s*${rangePattern.replace(\n regEx(/\\?<\\w+>/g),\n '?:',\n)}\\\\s*`;\nconst specifierPattern = `${specifierPartPattern}(?:,${specifierPartPattern})*`;\nconst specifierRegex = regEx(`^${specifierPattern}$`);\nfunction extractFromSection(\n sectionName: string,\n pipfileSection: Record<string, PipRequirement>,\n sources?: PipSource[],\n): PackageDependency[] {\n const deps = Object.entries(pipfileSection)\n .map((x) => {\n const [packageNameString, requirements] = x;\n let depName = packageNameString;\n\n let currentValue: string | undefined;\n let nestedVersion = false;\n let skipReason: SkipReason | undefined;\n if (is.object(requirements)) {\n if (requirements.git) {\n skipReason = 'git-dependency';\n } else if (requirements.file) {\n skipReason = 'file-dependency';\n } else if (requirements.path) {\n skipReason = 'local-dependency';\n } else if (requirements.version) {\n currentValue = requirements.version;\n nestedVersion = true;\n } else {\n skipReason = 'unspecified-version';\n }\n } else {\n currentValue = requirements;\n }\n if (currentValue === '*') {\n skipReason = 'unspecified-version';\n }\n if (!skipReason) {\n const packageMatches = packageRegex.exec(packageNameString);\n if (packageMatches) {\n depName = packageMatches[1];\n } else {\n logger.debug(\n `Skipping dependency with malformed package name \"${packageNameString}\".`,\n );\n skipReason = 'invalid-name';\n }\n // validated above\n const specifierMatches = specifierRegex.exec(currentValue!);\n if (!specifierMatches) {\n logger.debug(\n `Skipping dependency with malformed version specifier \"${currentValue!}\".`,\n );\n skipReason = 'invalid-version';\n }\n }\n const dep: PackageDependency = {\n depType: sectionName,\n depName,\n packageName: normalizePythonDepName(depName),\n managerData: {},\n };\n if (currentValue) {\n dep.currentValue = currentValue;\n }\n if (skipReason) {\n dep.skipReason = skipReason;\n } else {\n dep.datasource = PypiDatasource.id;\n }\n if (!skipReason && currentValue?.startsWith('==')) {\n dep.currentVersion = currentValue.replace(regEx(/^==\\s*/), '');\n }\n if (nestedVersion) {\n // TODO #22198\n dep.managerData!.nestedVersion = nestedVersion;\n }\n if (sources && is.object(requirements) && requirements.index) {\n const source = sources.find((item) => item.name === requirements.index);\n if (source) {\n dep.registryUrls = [source.url];\n }\n }\n return dep;\n })\n .filter(Boolean);\n return deps;\n}\n\nfunction isPipRequirements(\n section?:\n | Record<string, PipRequirement>\n | Record<string, string>\n | PipSource[],\n): section is Record<string, PipRequirement> {\n return (\n !is.array(section) &&\n is.object(section) &&\n !Object.values(section).some((dep) => !is.object(dep) && !is.string(dep))\n );\n}\n\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n): Promise<PackageFileContent | null> {\n logger.trace(`pipenv.extractPackageFile(${packageFile})`);\n\n let pipfile: PipFile;\n try {\n // TODO: fix type (#9610)\n pipfile = parseToml(content) as any;\n } catch (err) {\n logger.debug({ err, packageFile }, 'Error parsing Pipfile');\n return null;\n }\n const res: PackageFileContent = { deps: [] };\n\n const sources = pipfile?.source;\n\n if (sources) {\n res.registryUrls = sources.map((source) => source.url);\n }\n\n res.deps = Object.entries(pipfile)\n .map(([category, section]) => {\n if (\n category === 'source' ||\n category === 'requires' ||\n !isPipRequirements(section)\n ) {\n return [];\n }\n\n return extractFromSection(category, section, sources);\n })\n .flat();\n\n if (!res.deps.length) {\n return null;\n }\n\n const extractedConstraints: Record<string, any> = {};\n\n const pipfileDir = getParentDir(ensureLocalPath(packageFile));\n\n const pythonConstraint = await pipenvDetect.getPythonConstraint(pipfileDir);\n if (pythonConstraint) {\n extractedConstraints.python = pythonConstraint;\n }\n\n const pipenvConstraint = await pipenvDetect.getPipenvConstraint(pipfileDir);\n if (pipenvConstraint) {\n extractedConstraints.pipenv = pipenvConstraint;\n }\n\n const lockFileName = `${packageFile}.lock`;\n if (await localPathExists(lockFileName)) {\n res.lockFiles = [lockFileName];\n }\n\n res.extractedConstraints = extractedConstraints;\n return res;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pipenv/extract.ts"],"names":[],"mappings":";;;AA4HA,gDA6DC;AAzLD,4DAAmE;AACnE,gDAAoD;AACpD,yCAA+D;AAC/D,4CAAyC;AAEzC,yCAAiE;AACjE,gDAAwD;AACxD,+CAA4C;AAC5C,6CAAwD;AACxD,gDAAuD;AACvD,yDAAsE;AAItE,2DAA2D;AAC9C,QAAA,cAAc,GAAG,uCAAuC,CAAC;AACzD,QAAA,aAAa,GAAG,wBAAwB,CAAC;AACtD,MAAM,YAAY,GAAG,IAAA,aAAK,EAAC,KAAK,sBAAc,KAAK,qBAAa,IAAI,EAAE,GAAG,CAAC,CAAC;AAE3E,MAAM,YAAY,GAAW,sBAAa,CAAC;AAE3C,MAAM,oBAAoB,GAAG,OAAO,YAAY,CAAC,OAAO,CACtD,IAAA,aAAK,EAAC,UAAU,CAAC,EACjB,IAAI,CACL,MAAM,CAAC;AACR,MAAM,gBAAgB,GAAG,GAAG,oBAAoB,OAAO,oBAAoB,IAAI,CAAC;AAChF,MAAM,cAAc,GAAG,IAAA,aAAK,EAAC,IAAI,gBAAgB,GAAG,CAAC,CAAC;AACtD,SAAS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vDetect } from '@renovatebot/detect-tools';\nimport { RANGE_PATTERN } from '@renovatebot/pep440';\nimport { isArray, isObject, isString } from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport type { SkipReason } from '../../../types';\nimport { getParentDir, localPathExists } from '../../../util/fs';\nimport { ensureLocalPath } from '../../../util/fs/util';\nimport { regEx } from '../../../util/regex';\nimport { parse as parseToml } from '../../../util/toml';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { normalizePythonDepName } from '../../datasource/pypi/common';\nimport type { PackageDependency, PackageFileContent } from '../types';\nimport type { PipFile, PipRequirement, PipSource } from './types';\n\n// based on https://www.python.org/dev/peps/pep-0508/#names\nexport const packagePattern = '[A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9]';\nexport const extrasPattern = '(?:\\\\s*\\\\[[^\\\\]]+\\\\])*';\nconst packageRegex = regEx(`^(${packagePattern})(${extrasPattern})$`, 'i');\n\nconst rangePattern: string = RANGE_PATTERN;\n\nconst specifierPartPattern = `\\\\s*${rangePattern.replace(\n regEx(/\\?<\\w+>/g),\n '?:',\n)}\\\\s*`;\nconst specifierPattern = `${specifierPartPattern}(?:,${specifierPartPattern})*`;\nconst specifierRegex = regEx(`^${specifierPattern}$`);\nfunction extractFromSection(\n sectionName: string,\n pipfileSection: Record<string, PipRequirement>,\n sources?: PipSource[],\n): PackageDependency[] {\n const deps = Object.entries(pipfileSection)\n .map((x) => {\n const [packageNameString, requirements] = x;\n let depName = packageNameString;\n\n let currentValue: string | undefined;\n let nestedVersion = false;\n let skipReason: SkipReason | undefined;\n if (isObject(requirements)) {\n if (requirements.git) {\n skipReason = 'git-dependency';\n } else if (requirements.file) {\n skipReason = 'file-dependency';\n } else if (requirements.path) {\n skipReason = 'local-dependency';\n } else if (requirements.version) {\n currentValue = requirements.version;\n nestedVersion = true;\n } else {\n skipReason = 'unspecified-version';\n }\n } else {\n currentValue = requirements;\n }\n if (currentValue === '*') {\n skipReason = 'unspecified-version';\n }\n if (!skipReason) {\n const packageMatches = packageRegex.exec(packageNameString);\n if (packageMatches) {\n depName = packageMatches[1];\n } else {\n logger.debug(\n `Skipping dependency with malformed package name \"${packageNameString}\".`,\n );\n skipReason = 'invalid-name';\n }\n // validated above\n const specifierMatches = specifierRegex.exec(currentValue!);\n if (!specifierMatches) {\n logger.debug(\n `Skipping dependency with malformed version specifier \"${currentValue!}\".`,\n );\n skipReason = 'invalid-version';\n }\n }\n const dep: PackageDependency = {\n depType: sectionName,\n depName,\n packageName: normalizePythonDepName(depName),\n managerData: {},\n };\n if (currentValue) {\n dep.currentValue = currentValue;\n }\n if (skipReason) {\n dep.skipReason = skipReason;\n } else {\n dep.datasource = PypiDatasource.id;\n }\n if (!skipReason && currentValue?.startsWith('==')) {\n dep.currentVersion = currentValue.replace(regEx(/^==\\s*/), '');\n }\n if (nestedVersion) {\n // TODO #22198\n dep.managerData!.nestedVersion = nestedVersion;\n }\n if (sources && isObject(requirements) && requirements.index) {\n const source = sources.find((item) => item.name === requirements.index);\n if (source) {\n dep.registryUrls = [source.url];\n }\n }\n return dep;\n })\n .filter(Boolean);\n return deps;\n}\n\nfunction isPipRequirements(\n section?:\n | Record<string, PipRequirement>\n | Record<string, string>\n | PipSource[],\n): section is Record<string, PipRequirement> {\n return (\n !isArray(section) &&\n isObject(section) &&\n !Object.values(section).some((dep) => !isObject(dep) && !isString(dep))\n );\n}\n\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n): Promise<PackageFileContent | null> {\n logger.trace(`pipenv.extractPackageFile(${packageFile})`);\n\n let pipfile: PipFile;\n try {\n // TODO: fix type (#9610)\n pipfile = parseToml(content) as any;\n } catch (err) {\n logger.debug({ err, packageFile }, 'Error parsing Pipfile');\n return null;\n }\n const res: PackageFileContent = { deps: [] };\n\n const sources = pipfile?.source;\n\n if (sources) {\n res.registryUrls = sources.map((source) => source.url);\n }\n\n res.deps = Object.entries(pipfile)\n .map(([category, section]) => {\n if (\n category === 'source' ||\n category === 'requires' ||\n !isPipRequirements(section)\n ) {\n return [];\n }\n\n return extractFromSection(category, section, sources);\n })\n .flat();\n\n if (!res.deps.length) {\n return null;\n }\n\n const extractedConstraints: Record<string, any> = {};\n\n const pipfileDir = getParentDir(ensureLocalPath(packageFile));\n\n const pythonConstraint = await pipenvDetect.getPythonConstraint(pipfileDir);\n if (pythonConstraint) {\n extractedConstraints.python = pythonConstraint;\n }\n\n const pipenvConstraint = await pipenvDetect.getPipenvConstraint(pipfileDir);\n if (pipenvConstraint) {\n extractedConstraints.pipenv = pipenvConstraint;\n }\n\n const lockFileName = `${packageFile}.lock`;\n if (await localPathExists(lockFileName)) {\n res.lockFiles = [lockFileName];\n }\n\n res.extractedConstraints = extractedConstraints;\n return res;\n}\n"]}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.commandLock = void 0;
|
|
4
4
|
exports.updateArtifacts = updateArtifacts;
|
|
5
|
-
const
|
|
6
|
-
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
|
|
5
|
+
const is_1 = require("@sindresorhus/is");
|
|
7
6
|
const error_messages_1 = require("../../../constants/error-messages");
|
|
8
7
|
const logger_1 = require("../../../logger");
|
|
9
8
|
const exec_1 = require("../../../util/exec");
|
|
@@ -13,7 +12,7 @@ exports.commandLock = 'pixi lock --no-progress --color=never --quiet';
|
|
|
13
12
|
async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileContent, config, }) {
|
|
14
13
|
logger_1.logger.debug(`pixi.updateArtifacts(${packageFileName})`);
|
|
15
14
|
const { isLockFileMaintenance } = config;
|
|
16
|
-
if (!is_1.
|
|
15
|
+
if (!(0, is_1.isNonEmptyArray)(updatedDeps) && !isLockFileMaintenance) {
|
|
17
16
|
logger_1.logger.debug('No updated pixi deps - returning null');
|
|
18
17
|
return null;
|
|
19
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/artifacts.ts"],"names":[],"mappings":";;;AAiBA,0CA8EC
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/artifacts.ts"],"names":[],"mappings":";;;AAiBA,0CA8EC;AA/FD,yCAAmD;AACnD,sEAAoE;AACpE,4CAAyC;AACzC,6CAA0C;AAE1C,yCAM0B;AAE1B,uCAA8C;AAEjC,QAAA,WAAW,GAAG,+CAA+C,CAAC;AAEpE,KAAK,UAAU,eAAe,CAAC,EACpC,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,MAAM,GACS;IACf,eAAM,CAAC,KAAK,CAAC,wBAAwB,eAAe,GAAG,CAAC,CAAC;IACzD,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;IAEzC,IAAI,CAAC,IAAA,oBAAe,EAAC,WAAW,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC5D,eAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,YAAY,GAAG,IAAA,uBAAkB,EAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IACtE,MAAM,uBAAuB,GAAG,MAAM,IAAA,kBAAa,EAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAC1E,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC7B,eAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,eAAM,CAAC,KAAK,CAAC,YAAY,YAAY,EAAE,CAAC,CAAC;IAEzC,MAAM,GAAG,GAAG,CAAC,mBAAW,CAAC,CAAC;IAE1B,MAAM,UAAU,GAAG,IAAA,2BAAiB,EAAC,qBAAqB,EAAE,eAAe,CAAC,CAAC;IAE7E,MAAM,UAAU,GACd,MAAM,CAAC,WAAW,EAAE,IAAI,IAAI,UAAU,EAAE,OAAO,CAAC,eAAe,CAAC,CAA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GAAG,EAAE;iBACjB;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { isNonEmptyArray } from '@sindresorhus/is';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { getUserPixiConfig } from './extract';\n\nexport const commandLock = 'pixi lock --no-progress --color=never --quiet';\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pixi.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (!isNonEmptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated pixi deps - returning null');\n return null;\n }\n\n const lockFileName = getSiblingFileName(packageFileName, 'pixi.lock');\n const existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n logger.debug(`No lock file found`);\n return null;\n }\n logger.trace(`Updating ${lockFileName}`);\n\n const cmd = [commandLock];\n\n const pixiConfig = getUserPixiConfig(newPackageFileContent, packageFileName);\n\n const constraint =\n config.constraints?.pixi ?? pixiConfig?.project['requires-pixi'];\n\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n if (isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n }\n\n // https://pixi.sh/latest/features/environment/#caching-packages\n const PIXI_CACHE_DIR = await ensureCacheDir('pixi');\n const extraEnv = {\n PIXI_CACHE_DIR,\n RATTLER_CACHE_DIR: PIXI_CACHE_DIR,\n };\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n extraEnv,\n docker: {},\n toolConstraints: [{ toolName: 'pixi', constraint }],\n };\n await exec(cmd, execOptions);\n const newPixiLockContent = await readLocalFile(lockFileName, 'utf8');\n if (existingLockFileContent === newPixiLockContent) {\n logger.debug(`${lockFileName} is unchanged`);\n return null;\n }\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newPixiLockContent,\n },\n },\n ];\n } catch (err) {\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n\n logger.debug({ err }, `Failed to update ${lockFileName} file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: `${err}`,\n },\n },\n ];\n }\n}\n"]}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUserPixiConfig = getUserPixiConfig;
|
|
4
4
|
exports.extractPackageFile = extractPackageFile;
|
|
5
|
-
const
|
|
6
|
-
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
|
|
5
|
+
const is_1 = require("@sindresorhus/is");
|
|
7
6
|
const zod_1 = require("zod");
|
|
8
7
|
const logger_1 = require("../../../logger");
|
|
9
8
|
const array_1 = require("../../../util/array");
|
|
@@ -111,7 +110,7 @@ function channelToRegistryUrl(channel) {
|
|
|
111
110
|
function orderChannels(channels = []) {
|
|
112
111
|
return channels
|
|
113
112
|
.map((channel, index) => {
|
|
114
|
-
if (is_1.
|
|
113
|
+
if ((0, is_1.isString)(channel)) {
|
|
115
114
|
return { channel, priority: 0, index };
|
|
116
115
|
}
|
|
117
116
|
return { ...channel, index: 0 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/extract.ts"],"names":[],"mappings":";;AAuBA,8CAqCC;AAED,gDAsDC
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/extract.ts"],"names":[],"mappings":";;AAuBA,8CAqCC;AAED,gDAsDC;AApHD,yCAA4C;AAC5C,6BAAwB;AAExB,4CAAyC;AACzC,+CAAkD;AAClD,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IAAA,yBAAmB,EAAC,IAAA,kBAAY,EAAC,2BAAuB,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,aAAa,CAAC,WAAqB,EAAE;IAC5C,OAAO,QAAQ;SACZ,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACtB,IAAI,IAAA,aAAQ,EAAC,OAAO,CAAC,EAAE,CAAC;YACtB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;QACzC,CAAC;QAED,OAAO,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAClC,CAAC,CAAC;SACD,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACjB,8CAA8C;QAC9C,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC9B,OAAO,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC;QACjC,CAAC;QAED,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IAC3B,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import { isString } from '@sindresorhus/is';\nimport { z } from 'zod';\n\nimport { logger } from '../../../logger';\nimport { coerceArray } from '../../../util/array';\nimport { getSiblingFileName, localPathExists } from '../../../util/fs';\nimport { Result } from '../../../util/result';\nimport {\n ensureTrailingSlash,\n isHttpUrl,\n joinUrlParts,\n} from '../../../util/url';\nimport type { RegistryStrategy } from '../../datasource';\nimport { defaultRegistryUrl as defaultCondaRegistryApi } from '../../datasource/conda/common';\nimport type { PackageFileContent } from '../types';\nimport {\n type Channels,\n type PixiConfig,\n PixiFile,\n type PixiPackageDependency,\n PixiPyProject,\n} from './schema';\n\nexport function getUserPixiConfig(\n content: string,\n packageFile: string,\n): null | PixiConfig {\n if (\n packageFile === 'pyproject.toml' ||\n packageFile.endsWith('/pyproject.toml')\n ) {\n const { val, err } = Result.parse(content, PixiPyProject).unwrap();\n if (err) {\n logger.debug({ packageFile, err }, `error parsing ${packageFile}`);\n return null;\n }\n\n return val.tool?.pixi ?? null;\n }\n\n if (packageFile === 'pixi.toml' || packageFile.endsWith('/pixi.toml')) {\n const { val, err } = Result.parse(content, PixiFile).unwrap();\n if (err) {\n logger.debug({ packageFile, err }, `error parsing ${packageFile}`);\n return null;\n }\n\n return val;\n }\n\n const { val, err } = Result.parse(\n content,\n z.union([PixiFile, PixiPyProject.transform((p) => p.tool?.pixi)]),\n ).unwrap();\n\n if (err) {\n logger.debug({ packageFile, err }, `error parsing ${packageFile}`);\n return null;\n }\n return val ?? null;\n}\n\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n): Promise<PackageFileContent | null> {\n logger.trace(`pixi.extractPackageFile(${packageFile})`);\n\n const val = getUserPixiConfig(content, packageFile);\n if (!val) {\n return null;\n }\n\n const lockfileName = getSiblingFileName(packageFile, 'pixi.lock');\n const lockFiles: string[] = [];\n if (await localPathExists(lockfileName)) {\n lockFiles.push(lockfileName);\n }\n\n const project = val.project;\n\n const channelPriority = project['channel-priority'];\n\n let registryStrategy: RegistryStrategy | undefined;\n\n if (channelPriority === 'disabled') {\n registryStrategy = 'merge';\n }\n\n // resolve channels and build registry urls for each channel with order\n const conda: PixiPackageDependency[] = [];\n\n for (const item of val.conda) {\n conda.push(\n addRegistryUrls({\n ...item,\n channels: project.channels,\n registryStrategy,\n }),\n );\n }\n\n for (const item of val.feature.conda) {\n conda.push(\n addRegistryUrls({\n ...item,\n registryStrategy,\n channels: [...coerceArray(item.channels), ...project.channels],\n }),\n );\n }\n\n return {\n lockFiles,\n deps: [conda, val.pypi, val.feature.pypi].flat(),\n };\n}\n\nfunction addRegistryUrls(item: PixiPackageDependency): PixiPackageDependency {\n const channels = orderChannels(item.channels);\n\n if (item.channel) {\n return {\n ...item,\n channels,\n registryUrls: [channelToRegistryUrl(item.channel)],\n };\n }\n\n if (channels.length === 0) {\n return {\n ...item,\n channels,\n skipStage: 'extract',\n skipReason: 'unknown-registry',\n };\n }\n\n const registryUrls: string[] = [];\n for (const channel of channels) {\n registryUrls.push(channelToRegistryUrl(channel));\n }\n\n return {\n ...item,\n channels,\n registryUrls,\n };\n}\n\nfunction channelToRegistryUrl(channel: string): string {\n if (isHttpUrl(channel)) {\n return ensureTrailingSlash(channel);\n }\n\n return ensureTrailingSlash(joinUrlParts(defaultCondaRegistryApi, channel));\n}\n\nfunction orderChannels(channels: Channels = []): string[] {\n return channels\n .map((channel, index) => {\n if (isString(channel)) {\n return { channel, priority: 0, index };\n }\n\n return { ...channel, index: 0 };\n })\n .toSorted((a, b) => {\n // first based on priority then based on index\n if (a.priority !== b.priority) {\n return b.priority - a.priority;\n }\n\n return a.index - b.index;\n })\n .map((c) => c.channel);\n}\n"]}
|
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getPythonConstraint = getPythonConstraint;
|
|
4
4
|
exports.getPoetryRequirement = getPoetryRequirement;
|
|
5
5
|
exports.updateArtifacts = updateArtifacts;
|
|
6
|
-
const
|
|
7
|
-
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
|
|
6
|
+
const is_1 = require("@sindresorhus/is");
|
|
8
7
|
const shlex_1 = require("shlex");
|
|
9
8
|
const error_messages_1 = require("../../../constants/error-messages");
|
|
10
9
|
const logger_1 = require("../../../logger");
|
|
@@ -79,7 +78,7 @@ function getPoetrySources(content, fileName) {
|
|
|
79
78
|
}
|
|
80
79
|
async function getMatchingHostRule(url) {
|
|
81
80
|
const scopedMatch = (0, host_rules_1.find)({ hostType: pypi_1.PypiDatasource.id, url });
|
|
82
|
-
const hostRule = is_1.
|
|
81
|
+
const hostRule = (0, is_1.isNonEmptyObject)(scopedMatch) ? scopedMatch : (0, host_rules_1.find)({ url });
|
|
83
82
|
if (hostRule && Object.keys(hostRule).length !== 0) {
|
|
84
83
|
return hostRule;
|
|
85
84
|
}
|
|
@@ -119,7 +118,7 @@ async function getSourceCredentialVars(pyprojectContent, packageFileName) {
|
|
|
119
118
|
async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileContent, config, }) {
|
|
120
119
|
logger_1.logger.debug(`poetry.updateArtifacts(${packageFileName})`);
|
|
121
120
|
const { isLockFileMaintenance } = config;
|
|
122
|
-
if (!is_1.
|
|
121
|
+
if (!(0, is_1.isNonEmptyArray)(updatedDeps) && !isLockFileMaintenance) {
|
|
123
122
|
logger_1.logger.debug('No updated poetry deps - returning null');
|
|
124
123
|
return null;
|
|
125
124
|
}
|
|
@@ -146,7 +145,7 @@ async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileCon
|
|
|
146
145
|
else {
|
|
147
146
|
cmd.push(`poetry update --lock --no-interaction ${updatedDeps
|
|
148
147
|
.map((dep) => dep.depName)
|
|
149
|
-
.filter(is_1.
|
|
148
|
+
.filter(is_1.isString)
|
|
150
149
|
.map((dep) => (0, shlex_1.quote)(dep))
|
|
151
150
|
.join(' ')}`);
|
|
152
151
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/poetry/artifacts.ts"],"names":[],"mappings":";;AA0BA,kDA4BC;AAED,oDAsCC;AAyED,0CAgGC;;AAvQD,kEAAkC;AAClC,iCAA8B;AAC9B,sEAAoE;AACpE,4CAAyC;AAEzC,6CAA0C;AAE1C,yCAM0B;AAC1B,iDAAoE;AACpE,yDAAgD;AAChD,+CAA4C;AAC5C,iDAA8C;AAC9C,6CAAgF;AAChF,2CAA6C;AAC7C,gDAAuD;AACvD,gDAA8D;AAE9D,qCAAqD;AAGrD,SAAgB,mBAAmB,CACjC,gBAAwB,EACxB,uBAA+B;IAE/B,gFAAgF;IAChF,MAAM,yBAAyB,GAAG,eAAM,CAAC,KAAK,CAC5C,IAAA,c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KAAK,gCAAe,EAAE,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,oBAAoB,YAAY,OAAO,CAAC,CAAC;QAC/D,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;iBACvD;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport { getGitEnvironmentVariables } from '../../../util/git/auth';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { Result } from '../../../util/result';\nimport { massage as massageToml, parse as parseToml } from '../../../util/toml';\nimport { parseUrl } from '../../../util/url';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { getGoogleAuthHostRule } from '../../datasource/util';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { Lockfile, PoetryPyProject } from './schema';\nimport type { PoetryFile, PoetrySource } from './types';\n\nexport function getPythonConstraint(\n pyProjectContent: string,\n existingLockFileContent: string,\n): string | null {\n // Read Python version from `pyproject.toml` first as it could have been updated\n const pyprojectPythonConstraint = Result.parse(\n massageToml(pyProjectContent),\n PoetryPyProject.transform(\n ({ packageFileContent }) =>\n packageFileContent.deps.find((dep) => dep.depName === 'python')\n ?.currentValue,\n ),\n ).unwrapOrNull();\n if (pyprojectPythonConstraint) {\n logger.debug('Using python version from pyproject.toml');\n return pyprojectPythonConstraint;\n }\n\n const lockfilePythonConstraint = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ pythonVersions }) => pythonVersions),\n ).unwrapOrNull();\n if (lockfilePythonConstraint) {\n logger.debug('Using python version from poetry.lock');\n return lockfilePythonConstraint;\n }\n\n return null;\n}\n\nexport function getPoetryRequirement(\n pyProjectContent: string,\n existingLockFileContent: string,\n): undefined | string | null {\n // Read Poetry version from first line of poetry.lock\n const firstLine = existingLockFileContent.split('\\n')[0];\n const poetryVersionMatch = regEx(/by Poetry ([\\d\\\\.]+)/).exec(firstLine);\n if (poetryVersionMatch?.[1]) {\n const poetryVersion = poetryVersionMatch[1];\n logger.debug(\n `Using poetry version ${poetryVersion} from poetry.lock header`,\n );\n return poetryVersion;\n }\n\n const { val: lockfilePoetryConstraint } = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ poetryConstraint }) => poetryConstraint),\n ).unwrap();\n if (lockfilePoetryConstraint) {\n logger.debug(\n `Using poetry version ${lockfilePoetryConstraint} from poetry.lock metadata`,\n );\n return lockfilePoetryConstraint;\n }\n\n const { val: pyprojectPoetryConstraint } = Result.parse(\n massageToml(pyProjectContent),\n PoetryPyProject.transform(({ poetryRequirement }) => poetryRequirement),\n ).unwrap();\n if (pyprojectPoetryConstraint) {\n logger.debug(\n `Using poetry version ${pyprojectPoetryConstraint} from pyproject.toml`,\n );\n return pyprojectPoetryConstraint;\n }\n\n return null;\n}\n\nfunction getPoetrySources(content: string, fileName: string): PoetrySource[] {\n let pyprojectFile: PoetryFile;\n try {\n pyprojectFile = parseToml(massageToml(content)) as PoetryFile;\n } catch (err) {\n logger.debug({ err }, 'Error parsing pyproject.toml file');\n return [];\n }\n if (!pyprojectFile.tool?.poetry) {\n logger.debug(`${fileName} contains no poetry section`);\n return [];\n }\n\n const sources = pyprojectFile.tool?.poetry?.source ?? [];\n const sourceArray: PoetrySource[] = [];\n for (const source of sources) {\n if (source.name && source.url) {\n sourceArray.push({ name: source.name, url: source.url });\n }\n }\n return sourceArray;\n}\n\nasync function getMatchingHostRule(url: string | undefined): Promise<HostRule> {\n const scopedMatch = find({ hostType: PypiDatasource.id, url });\n const hostRule = is.nonEmptyObject(scopedMatch) ? scopedMatch : find({ url });\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n\n const parsedUrl = parseUrl(url);\n if (!parsedUrl) {\n logger.once.debug(`Failed to parse URL ${url}`);\n return {};\n }\n\n if (parsedUrl.hostname.endsWith('.pkg.dev')) {\n const hostRule = await getGoogleAuthHostRule();\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n logger.once.debug(`Could not get Google access token (url=${url})`);\n }\n\n return {};\n}\n\nasync function getSourceCredentialVars(\n pyprojectContent: string,\n packageFileName: string,\n): Promise<NodeJS.ProcessEnv> {\n const poetrySources = getPoetrySources(pyprojectContent, packageFileName);\n const envVars: NodeJS.ProcessEnv = {};\n\n for (const source of poetrySources) {\n const matchingHostRule = await getMatchingHostRule(source.url);\n const formattedSourceName = source.name\n .replace(regEx(/(\\.|-)+/g), '_')\n .toUpperCase();\n if (matchingHostRule.username) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_USERNAME`] =\n matchingHostRule.username;\n }\n if (matchingHostRule.password) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_PASSWORD`] =\n matchingHostRule.password;\n }\n }\n return envVars;\n}\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`poetry.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (!is.nonEmptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated poetry deps - returning null');\n return null;\n }\n // Try poetry.lock first\n let lockFileName = getSiblingFileName(packageFileName, 'poetry.lock');\n let existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n // Try pyproject.lock next\n lockFileName = getSiblingFileName(packageFileName, 'pyproject.lock');\n existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n logger.debug(`No lock file found`);\n return null;\n }\n }\n logger.debug(`Updating ${lockFileName}`);\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n const cmd: string[] = [];\n if (isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n cmd.push('poetry update --lock --no-interaction');\n } else {\n cmd.push(\n `poetry update --lock --no-interaction ${updatedDeps\n .map((dep) => dep.depName)\n .filter(is.string)\n .map((dep) => quote(dep))\n .join(' ')}`,\n );\n }\n const pythonConstraint =\n config?.constraints?.python ??\n getPythonConstraint(newPackageFileContent, existingLockFileContent);\n const poetryConstraint =\n config.constraints?.poetry ??\n getPoetryRequirement(newPackageFileContent, existingLockFileContent);\n const extraEnv = {\n ...(await getSourceCredentialVars(\n newPackageFileContent,\n packageFileName,\n )),\n ...getGitEnvironmentVariables(['poetry']),\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n };\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n extraEnv,\n docker: {},\n toolConstraints: [\n { toolName: 'python', constraint: pythonConstraint },\n { toolName: 'poetry', constraint: poetryConstraint },\n ],\n };\n await exec(cmd, execOptions);\n const newPoetryLockContent = await readLocalFile(lockFileName, 'utf8');\n if (existingLockFileContent === newPoetryLockContent) {\n logger.debug(`${lockFileName} is unchanged`);\n return null;\n }\n logger.debug(`Returning updated ${lockFileName}`);\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newPoetryLockContent,\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, `Failed to update ${lockFileName} file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: `${String(err.stdout)}\\n${String(err.stderr)}`,\n },\n },\n ];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"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C;QACvE,IAAI,uBAAuB,KAAK,oBAAoB,EAAE,CAAC;YACrD,eAAM,CAAC,KAAK,CAAC,GAAG,YAAY,eAAe,CAAC,CAAC;YAC7C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,qBAAqB,YAAY,EAAE,CAAC,CAAC;QAClD,OAAO;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,oBAAoB;iBAC/B;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,qBAAqB;QACrB,IAAI,GAAG,CAAC,OAAO,KAAK,gCAAe,EAAE,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,oBAAoB,YAAY,OAAO,CAAC,CAAC;QAC/D,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;iBACvD;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { isNonEmptyArray, isNonEmptyObject, isString } from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport { getGitEnvironmentVariables } from '../../../util/git/auth';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { Result } from '../../../util/result';\nimport { massage as massageToml, parse as parseToml } from '../../../util/toml';\nimport { parseUrl } from '../../../util/url';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { getGoogleAuthHostRule } from '../../datasource/util';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { Lockfile, PoetryPyProject } from './schema';\nimport type { PoetryFile, PoetrySource } from './types';\n\nexport function getPythonConstraint(\n pyProjectContent: string,\n existingLockFileContent: string,\n): string | null {\n // Read Python version from `pyproject.toml` first as it could have been updated\n const pyprojectPythonConstraint = Result.parse(\n massageToml(pyProjectContent),\n PoetryPyProject.transform(\n ({ packageFileContent }) =>\n packageFileContent.deps.find((dep) => dep.depName === 'python')\n ?.currentValue,\n ),\n ).unwrapOrNull();\n if (pyprojectPythonConstraint) {\n logger.debug('Using python version from pyproject.toml');\n return pyprojectPythonConstraint;\n }\n\n const lockfilePythonConstraint = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ pythonVersions }) => pythonVersions),\n ).unwrapOrNull();\n if (lockfilePythonConstraint) {\n logger.debug('Using python version from poetry.lock');\n return lockfilePythonConstraint;\n }\n\n return null;\n}\n\nexport function getPoetryRequirement(\n pyProjectContent: string,\n existingLockFileContent: string,\n): undefined | string | null {\n // Read Poetry version from first line of poetry.lock\n const firstLine = existingLockFileContent.split('\\n')[0];\n const poetryVersionMatch = regEx(/by Poetry ([\\d\\\\.]+)/).exec(firstLine);\n if (poetryVersionMatch?.[1]) {\n const poetryVersion = poetryVersionMatch[1];\n logger.debug(\n `Using poetry version ${poetryVersion} from poetry.lock header`,\n );\n return poetryVersion;\n }\n\n const { val: lockfilePoetryConstraint } = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ poetryConstraint }) => poetryConstraint),\n ).unwrap();\n if (lockfilePoetryConstraint) {\n logger.debug(\n `Using poetry version ${lockfilePoetryConstraint} from poetry.lock metadata`,\n );\n return lockfilePoetryConstraint;\n }\n\n const { val: pyprojectPoetryConstraint } = Result.parse(\n massageToml(pyProjectContent),\n PoetryPyProject.transform(({ poetryRequirement }) => poetryRequirement),\n ).unwrap();\n if (pyprojectPoetryConstraint) {\n logger.debug(\n `Using poetry version ${pyprojectPoetryConstraint} from pyproject.toml`,\n );\n return pyprojectPoetryConstraint;\n }\n\n return null;\n}\n\nfunction getPoetrySources(content: string, fileName: string): PoetrySource[] {\n let pyprojectFile: PoetryFile;\n try {\n pyprojectFile = parseToml(massageToml(content)) as PoetryFile;\n } catch (err) {\n logger.debug({ err }, 'Error parsing pyproject.toml file');\n return [];\n }\n if (!pyprojectFile.tool?.poetry) {\n logger.debug(`${fileName} contains no poetry section`);\n return [];\n }\n\n const sources = pyprojectFile.tool?.poetry?.source ?? [];\n const sourceArray: PoetrySource[] = [];\n for (const source of sources) {\n if (source.name && source.url) {\n sourceArray.push({ name: source.name, url: source.url });\n }\n }\n return sourceArray;\n}\n\nasync function getMatchingHostRule(url: string | undefined): Promise<HostRule> {\n const scopedMatch = find({ hostType: PypiDatasource.id, url });\n const hostRule = isNonEmptyObject(scopedMatch) ? scopedMatch : find({ url });\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n\n const parsedUrl = parseUrl(url);\n if (!parsedUrl) {\n logger.once.debug(`Failed to parse URL ${url}`);\n return {};\n }\n\n if (parsedUrl.hostname.endsWith('.pkg.dev')) {\n const hostRule = await getGoogleAuthHostRule();\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n logger.once.debug(`Could not get Google access token (url=${url})`);\n }\n\n return {};\n}\n\nasync function getSourceCredentialVars(\n pyprojectContent: string,\n packageFileName: string,\n): Promise<NodeJS.ProcessEnv> {\n const poetrySources = getPoetrySources(pyprojectContent, packageFileName);\n const envVars: NodeJS.ProcessEnv = {};\n\n for (const source of poetrySources) {\n const matchingHostRule = await getMatchingHostRule(source.url);\n const formattedSourceName = source.name\n .replace(regEx(/(\\.|-)+/g), '_')\n .toUpperCase();\n if (matchingHostRule.username) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_USERNAME`] =\n matchingHostRule.username;\n }\n if (matchingHostRule.password) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_PASSWORD`] =\n matchingHostRule.password;\n }\n }\n return envVars;\n}\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`poetry.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (!isNonEmptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated poetry deps - returning null');\n return null;\n }\n // Try poetry.lock first\n let lockFileName = getSiblingFileName(packageFileName, 'poetry.lock');\n let existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n // Try pyproject.lock next\n lockFileName = getSiblingFileName(packageFileName, 'pyproject.lock');\n existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n logger.debug(`No lock file found`);\n return null;\n }\n }\n logger.debug(`Updating ${lockFileName}`);\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n const cmd: string[] = [];\n if (isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n cmd.push('poetry update --lock --no-interaction');\n } else {\n cmd.push(\n `poetry update --lock --no-interaction ${updatedDeps\n .map((dep) => dep.depName)\n .filter(isString)\n .map((dep) => quote(dep))\n .join(' ')}`,\n );\n }\n const pythonConstraint =\n config?.constraints?.python ??\n getPythonConstraint(newPackageFileContent, existingLockFileContent);\n const poetryConstraint =\n config.constraints?.poetry ??\n getPoetryRequirement(newPackageFileContent, existingLockFileContent);\n const extraEnv = {\n ...(await getSourceCredentialVars(\n newPackageFileContent,\n packageFileName,\n )),\n ...getGitEnvironmentVariables(['poetry']),\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n };\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n extraEnv,\n docker: {},\n toolConstraints: [\n { toolName: 'python', constraint: pythonConstraint },\n { toolName: 'poetry', constraint: poetryConstraint },\n ],\n };\n await exec(cmd, execOptions);\n const newPoetryLockContent = await readLocalFile(lockFileName, 'utf8');\n if (existingLockFileContent === newPoetryLockContent) {\n logger.debug(`${lockFileName} is unchanged`);\n return null;\n }\n logger.debug(`Returning updated ${lockFileName}`);\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newPoetryLockContent,\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, `Failed to update ${lockFileName} file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: `${String(err.stdout)}\\n${String(err.stderr)}`,\n },\n },\n ];\n }\n}\n"]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractPackageFile = extractPackageFile;
|
|
4
|
-
const
|
|
5
|
-
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
|
|
4
|
+
const is_1 = require("@sindresorhus/is");
|
|
6
5
|
const logger_1 = require("../../../logger");
|
|
7
6
|
const filter_map_1 = require("../../../util/filter-map");
|
|
8
7
|
const fs_1 = require("../../../util/fs");
|
|
@@ -46,7 +45,7 @@ async function extractPackageFile(content, packageFile) {
|
|
|
46
45
|
return null;
|
|
47
46
|
}
|
|
48
47
|
const extractedConstraints = {};
|
|
49
|
-
if (is_1.
|
|
48
|
+
if ((0, is_1.isNonEmptyString)(pythonVersion)) {
|
|
50
49
|
extractedConstraints.python = pythonVersion;
|
|
51
50
|
}
|
|
52
51
|
res.extractedConstraints = extractedConstraints;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/poetry/extract.ts"],"names":[],"mappings":";;AAcA,gDAsEC
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/poetry/extract.ts"],"names":[],"mappings":";;AAcA,gDAsEC;AApFD,y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;AACb,CAAC","sourcesContent":["import { isNonEmptyString } from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport { filterMap } from '../../../util/filter-map';\nimport {\n getSiblingFileName,\n localPathExists,\n readLocalFile,\n} from '../../../util/fs';\nimport { Result } from '../../../util/result';\nimport { massage as massageToml } from '../../../util/toml';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases';\nimport type { PackageFileContent } from '../types';\nimport { Lockfile, PoetryPyProject } from './schema';\n\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n): Promise<PackageFileContent | null> {\n logger.trace(`poetry.extractPackageFile(${packageFile})`);\n const { val: res, err } = Result.parse(\n massageToml(content),\n PoetryPyProject.transform(({ packageFileContent }) => packageFileContent),\n ).unwrap();\n if (err) {\n logger.debug({ packageFile, err }, `Poetry: error parsing pyproject.toml`);\n return null;\n }\n\n const lockfileName = getSiblingFileName(packageFile, 'poetry.lock');\n const lockContents = (await readLocalFile(lockfileName, 'utf8'))!;\n const lockfileMapping = Result.parse(\n lockContents,\n Lockfile.transform(({ lock }) => lock),\n ).unwrapOr({});\n\n let pythonVersion: string | undefined;\n filterMap(res.deps, (dep) => {\n if (dep.depName === 'python') {\n if (dep.currentValue) {\n pythonVersion = dep.currentValue;\n }\n return {\n ...dep,\n // We use containerbase python as source, as there are a lot docker tags which can cause\n // issues with poetry versioning.\n packageName: 'containerbase/python-prebuild',\n datasource: GithubReleasesDatasource.id,\n commitMessageTopic: 'Python',\n registryUrls: null,\n };\n }\n\n const packageName = dep.packageName ?? dep.depName;\n if (packageName && packageName in lockfileMapping) {\n dep.lockedVersion = lockfileMapping[packageName];\n }\n\n return dep;\n });\n\n if (!res.deps.length) {\n return null;\n }\n\n const extractedConstraints: Record<string, any> = {};\n\n if (isNonEmptyString(pythonVersion)) {\n extractedConstraints.python = pythonVersion;\n }\n res.extractedConstraints = extractedConstraints;\n\n // Try poetry.lock first\n let lockFile = getSiblingFileName(packageFile, 'poetry.lock');\n // istanbul ignore next\n if (await localPathExists(lockFile)) {\n res.lockFiles = [lockFile];\n } else {\n // Try pyproject.lock next\n lockFile = getSiblingFileName(packageFile, 'pyproject.lock');\n if (await localPathExists(lockFile)) {\n res.lockFiles = [lockFile];\n }\n }\n return res;\n}\n"]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractPackageFile = extractPackageFile;
|
|
4
|
-
const
|
|
5
|
-
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
|
|
4
|
+
const is_1 = require("@sindresorhus/is");
|
|
6
5
|
const logger_1 = require("../../../logger");
|
|
7
6
|
const common_1 = require("../../../util/common");
|
|
8
7
|
const host_rules_1 = require("../../../util/host-rules");
|
|
@@ -41,7 +40,7 @@ function determineDatasource(repository, hostname) {
|
|
|
41
40
|
}
|
|
42
41
|
const hostUrl = 'https://' + hostname;
|
|
43
42
|
const res = (0, host_rules_1.find)({ url: hostUrl });
|
|
44
|
-
if (is_1.
|
|
43
|
+
if ((0, is_1.isEmptyObject)(res)) {
|
|
45
44
|
// 1 check, to possibly prevent 3 failures in combined query of hostType & url.
|
|
46
45
|
logger_1.logger.debug({ repository, hostUrl }, 'Provided hostname does not match any hostRules. Ignoring');
|
|
47
46
|
return { skipReason: 'unknown-registry', registryUrls: [hostname] };
|
|
@@ -50,7 +49,7 @@ function determineDatasource(repository, hostname) {
|
|
|
50
49
|
['github', github_tags_1.GithubTagsDatasource.id],
|
|
51
50
|
['gitlab', gitlab_tags_1.GitlabTagsDatasource.id],
|
|
52
51
|
]) {
|
|
53
|
-
if (is_1.
|
|
52
|
+
if ((0, is_1.isNonEmptyObject)((0, host_rules_1.find)({ hostType, url: hostUrl }))) {
|
|
54
53
|
logger_1.logger.debug({ repository, hostUrl, hostType }, `Provided hostname matches a ${hostType} hostrule.`);
|
|
55
54
|
return { datasource: sourceId, registryUrls: [hostname] };
|
|
56
55
|
}
|
|
@@ -163,7 +162,7 @@ function extractPackageFile(content, packageFile) {
|
|
|
163
162
|
logger_1.logger.debug({ filename: packageFile, err }, 'Failed to parse pre-commit config YAML');
|
|
164
163
|
return null;
|
|
165
164
|
}
|
|
166
|
-
if (!is_1.
|
|
165
|
+
if (!(0, is_1.isPlainObject)(parsedContent)) {
|
|
167
166
|
logger_1.logger.debug({ packageFile }, `Parsing of pre-commit config YAML returned invalid result`);
|
|
168
167
|
return null;
|
|
169
168
|
}
|