renovate 40.0.0-next.3 → 40.0.0-next.30
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/legacy.js +0 -1
- package/dist/config/decrypt/legacy.js.map +1 -1
- package/dist/config/decrypt.d.ts +3 -1
- package/dist/config/decrypt.js +56 -13
- package/dist/config/decrypt.js.map +1 -1
- package/dist/config/migrate-validate.js +3 -2
- package/dist/config/migrate-validate.js.map +1 -1
- package/dist/config/migration.js +2 -1
- package/dist/config/migration.js.map +1 -1
- package/dist/config/migrations/custom/rebase-stale-prs-migration.js +1 -1
- package/dist/config/migrations/custom/rebase-stale-prs-migration.js.map +1 -1
- package/dist/config/options/index.js +4 -3
- package/dist/config/options/index.js.map +1 -1
- package/dist/config/parse.js +2 -2
- package/dist/config/parse.js.map +1 -1
- package/dist/config/presets/gitea/index.js +0 -1
- package/dist/config/presets/gitea/index.js.map +1 -1
- package/dist/config/presets/github/index.js +0 -1
- package/dist/config/presets/github/index.js.map +1 -1
- package/dist/config/presets/gitlab/index.js +1 -1
- package/dist/config/presets/gitlab/index.js.map +1 -1
- package/dist/config/presets/http/index.js +1 -2
- package/dist/config/presets/http/index.js.map +1 -1
- package/dist/config/presets/index.js +0 -7
- package/dist/config/presets/index.js.map +1 -1
- package/dist/config/presets/internal/custom-managers.js +3 -4
- package/dist/config/presets/internal/custom-managers.js.map +1 -1
- package/dist/config/presets/internal/group.js +30 -1
- package/dist/config/presets/internal/group.js.map +1 -1
- package/dist/config/presets/internal/index.js +1 -3
- package/dist/config/presets/internal/index.js.map +1 -1
- package/dist/config/presets/internal/workarounds.js +1 -0
- package/dist/config/presets/internal/workarounds.js.map +1 -1
- package/dist/config/presets/parse.js +2 -1
- package/dist/config/presets/parse.js.map +1 -1
- package/dist/config/schema.d.ts +2 -2
- package/dist/config/types.d.ts +4 -1
- package/dist/config/types.js.map +1 -1
- package/dist/config/validation.js +3 -5
- package/dist/config/validation.js.map +1 -1
- package/dist/config-validator.js +0 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/constants/category.js +0 -1
- package/dist/constants/category.js.map +1 -1
- package/dist/data/monorepo.json +5 -1
- package/dist/data/source-urls.json +1 -0
- package/dist/instrumentation/index.js +17 -13
- package/dist/instrumentation/index.js.map +1 -1
- package/dist/instrumentation/utils.js +1 -1
- package/dist/instrumentation/utils.js.map +1 -1
- package/dist/logger/cmd-serializer.js +0 -1
- package/dist/logger/cmd-serializer.js.map +1 -1
- package/dist/logger/config-serializer.js +0 -1
- package/dist/logger/config-serializer.js.map +1 -1
- package/dist/logger/index.js +1 -4
- package/dist/logger/index.js.map +1 -1
- package/dist/logger/once.js +4 -2
- package/dist/logger/once.js.map +1 -1
- package/dist/logger/pretty-stdout.js +0 -1
- package/dist/logger/pretty-stdout.js.map +1 -1
- package/dist/logger/renovate-logger.js +1 -1
- package/dist/logger/renovate-logger.js.map +1 -1
- package/dist/logger/utils.js +6 -11
- package/dist/logger/utils.js.map +1 -1
- package/dist/modules/datasource/api.js +2 -0
- package/dist/modules/datasource/api.js.map +1 -1
- package/dist/modules/datasource/artifactory/index.js +1 -2
- package/dist/modules/datasource/artifactory/index.js.map +1 -1
- package/dist/modules/datasource/aws-eks-addon/index.d.ts +11 -0
- package/dist/modules/datasource/aws-eks-addon/index.js +75 -0
- package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -0
- package/dist/modules/datasource/aws-eks-addon/schema.d.ts +40 -0
- package/dist/modules/datasource/aws-eks-addon/schema.js +31 -0
- package/dist/modules/datasource/aws-eks-addon/schema.js.map +1 -0
- package/dist/modules/datasource/aws-machine-image/index.js +6 -5
- package/dist/modules/datasource/aws-machine-image/index.js.map +1 -1
- package/dist/modules/datasource/azure-pipelines-tasks/index.js +11 -1
- package/dist/modules/datasource/azure-pipelines-tasks/index.js.map +1 -1
- package/dist/modules/datasource/azure-pipelines-tasks/schema.d.ts +16 -0
- package/dist/modules/datasource/azure-pipelines-tasks/schema.js +2 -0
- package/dist/modules/datasource/azure-pipelines-tasks/schema.js.map +1 -1
- package/dist/modules/datasource/bazel/index.js +0 -1
- package/dist/modules/datasource/bazel/index.js.map +1 -1
- package/dist/modules/datasource/bitrise/index.js +1 -1
- package/dist/modules/datasource/bitrise/index.js.map +1 -1
- package/dist/modules/datasource/cdnjs/schema.d.ts +2 -2
- package/dist/modules/datasource/conda/index.js +18 -1
- package/dist/modules/datasource/conda/index.js.map +1 -1
- package/dist/modules/datasource/conda/prefix-dev.d.ts +3 -0
- package/dist/modules/datasource/conda/prefix-dev.js +83 -0
- package/dist/modules/datasource/conda/prefix-dev.js.map +1 -0
- package/dist/modules/datasource/conda/schema/prefix-dev.d.ts +189 -0
- package/dist/modules/datasource/conda/schema/prefix-dev.js +31 -0
- package/dist/modules/datasource/conda/schema/prefix-dev.js.map +1 -0
- package/dist/modules/datasource/conda/types.d.ts +1 -20
- package/dist/modules/datasource/conda/types.js.map +1 -1
- package/dist/modules/datasource/cpan/index.js +1 -1
- package/dist/modules/datasource/cpan/index.js.map +1 -1
- package/dist/modules/datasource/crate/index.js +3 -3
- package/dist/modules/datasource/crate/index.js.map +1 -1
- package/dist/modules/datasource/custom/formats/html.js +1 -1
- package/dist/modules/datasource/custom/formats/html.js.map +1 -1
- package/dist/modules/datasource/custom/formats/yaml.js +1 -1
- package/dist/modules/datasource/custom/formats/yaml.js.map +1 -1
- package/dist/modules/datasource/custom/index.js +4 -2
- package/dist/modules/datasource/custom/index.js.map +1 -1
- package/dist/modules/datasource/custom/schema.d.ts +22 -22
- package/dist/modules/datasource/custom/utils.js +1 -0
- package/dist/modules/datasource/custom/utils.js.map +1 -1
- package/dist/modules/datasource/dart/index.js +1 -1
- package/dist/modules/datasource/dart/index.js.map +1 -1
- package/dist/modules/datasource/dart-version/index.js +1 -1
- package/dist/modules/datasource/dart-version/index.js.map +1 -1
- package/dist/modules/datasource/datasource.js +0 -1
- package/dist/modules/datasource/datasource.js.map +1 -1
- package/dist/modules/datasource/deb/index.js +2 -2
- package/dist/modules/datasource/deb/index.js.map +1 -1
- package/dist/modules/datasource/deno/index.js +1 -1
- package/dist/modules/datasource/deno/index.js.map +1 -1
- package/dist/modules/datasource/deno/schema.d.ts +1 -1
- package/dist/modules/datasource/devbox/index.js +0 -1
- package/dist/modules/datasource/devbox/index.js.map +1 -1
- package/dist/modules/datasource/docker/common.js +5 -2
- package/dist/modules/datasource/docker/common.js.map +1 -1
- package/dist/modules/datasource/docker/index.js +10 -8
- package/dist/modules/datasource/docker/index.js.map +1 -1
- package/dist/modules/datasource/docker/schema.d.ts +5 -5
- package/dist/modules/datasource/docker/schema.js +2 -1
- package/dist/modules/datasource/docker/schema.js.map +1 -1
- package/dist/modules/datasource/flutter-version/index.js +1 -1
- package/dist/modules/datasource/flutter-version/index.js.map +1 -1
- package/dist/modules/datasource/galaxy/schema.d.ts +1 -1
- package/dist/modules/datasource/galaxy-collection/schema.d.ts +8 -8
- package/dist/modules/datasource/git-refs/index.js +1 -1
- package/dist/modules/datasource/git-refs/index.js.map +1 -1
- package/dist/modules/datasource/gitea-releases/schema.d.ts +2 -2
- package/dist/modules/datasource/gitea-tags/schema.d.ts +4 -4
- 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/gitlab-packages/index.js +1 -1
- package/dist/modules/datasource/gitlab-packages/index.js.map +1 -1
- package/dist/modules/datasource/gitlab-releases/index.js +1 -3
- package/dist/modules/datasource/gitlab-releases/index.js.map +1 -1
- package/dist/modules/datasource/go/base.js +1 -1
- package/dist/modules/datasource/go/base.js.map +1 -1
- package/dist/modules/datasource/go/index.js +1 -1
- package/dist/modules/datasource/go/index.js.map +1 -1
- package/dist/modules/datasource/go/releases-direct.js +7 -4
- package/dist/modules/datasource/go/releases-direct.js.map +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
- package/dist/modules/datasource/golang-version/index.js +2 -2
- package/dist/modules/datasource/golang-version/index.js.map +1 -1
- package/dist/modules/datasource/gradle-version/index.js +1 -1
- package/dist/modules/datasource/gradle-version/index.js.map +1 -1
- package/dist/modules/datasource/helm/index.js +1 -1
- package/dist/modules/datasource/helm/index.js.map +1 -1
- package/dist/modules/datasource/hex/index.js +1 -1
- package/dist/modules/datasource/hex/index.js.map +1 -1
- package/dist/modules/datasource/hex/schema.d.ts +11 -11
- package/dist/modules/datasource/hexpm-bob/index.js +1 -1
- package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
- package/dist/modules/datasource/index.js +4 -4
- package/dist/modules/datasource/index.js.map +1 -1
- package/dist/modules/datasource/java-version/index.js +0 -1
- package/dist/modules/datasource/java-version/index.js.map +1 -1
- package/dist/modules/datasource/jenkins-plugins/index.js +1 -1
- package/dist/modules/datasource/jenkins-plugins/index.js.map +1 -1
- package/dist/modules/datasource/maven/index.js +35 -27
- package/dist/modules/datasource/maven/index.js.map +1 -1
- package/dist/modules/datasource/maven/types.d.ts +3 -6
- package/dist/modules/datasource/maven/types.js.map +1 -1
- package/dist/modules/datasource/maven/util.d.ts +4 -5
- package/dist/modules/datasource/maven/util.js +94 -157
- package/dist/modules/datasource/maven/util.js.map +1 -1
- package/dist/modules/datasource/node-version/index.js +1 -1
- package/dist/modules/datasource/node-version/index.js.map +1 -1
- package/dist/modules/datasource/npm/index.js +1 -1
- package/dist/modules/datasource/npm/index.js.map +1 -1
- package/dist/modules/datasource/npm/npmrc.js +1 -1
- package/dist/modules/datasource/npm/npmrc.js.map +1 -1
- package/dist/modules/datasource/nuget/index.js +1 -1
- package/dist/modules/datasource/nuget/index.js.map +1 -1
- package/dist/modules/datasource/nuget/v2.js +1 -1
- package/dist/modules/datasource/nuget/v2.js.map +1 -1
- package/dist/modules/datasource/nuget/v3.js +6 -6
- package/dist/modules/datasource/nuget/v3.js.map +1 -1
- package/dist/modules/datasource/orb/index.js +1 -1
- package/dist/modules/datasource/orb/index.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.d.ts +25 -25
- package/dist/modules/datasource/pod/index.js +2 -2
- package/dist/modules/datasource/pod/index.js.map +1 -1
- package/dist/modules/datasource/postprocess-release.js +1 -1
- package/dist/modules/datasource/postprocess-release.js.map +1 -1
- package/dist/modules/datasource/pypi/index.js +1 -1
- package/dist/modules/datasource/pypi/index.js.map +1 -1
- package/dist/modules/datasource/python-version/index.js +1 -1
- package/dist/modules/datasource/python-version/index.js.map +1 -1
- package/dist/modules/datasource/repology/index.js +1 -1
- package/dist/modules/datasource/repology/index.js.map +1 -1
- package/dist/modules/datasource/ruby-version/index.js +1 -1
- package/dist/modules/datasource/ruby-version/index.js.map +1 -1
- package/dist/modules/datasource/rubygems/index.js +2 -2
- package/dist/modules/datasource/rubygems/index.js.map +1 -1
- package/dist/modules/datasource/rubygems/versions-endpoint-cache.js +2 -2
- package/dist/modules/datasource/rubygems/versions-endpoint-cache.js.map +1 -1
- package/dist/modules/datasource/sbt-package/index.js +1 -1
- package/dist/modules/datasource/sbt-package/index.js.map +1 -1
- package/dist/modules/datasource/sbt-plugin/index.js +1 -1
- package/dist/modules/datasource/sbt-plugin/index.js.map +1 -1
- package/dist/modules/datasource/schema.d.ts +4 -4
- package/dist/modules/datasource/terraform-module/index.js +1 -1
- package/dist/modules/datasource/terraform-module/index.js.map +1 -1
- package/dist/modules/datasource/terraform-provider/index.js +2 -3
- package/dist/modules/datasource/terraform-provider/index.js.map +1 -1
- package/dist/modules/datasource/types.d.ts +1 -0
- package/dist/modules/datasource/types.js.map +1 -1
- package/dist/modules/datasource/unity3d/index.d.ts +4 -1
- package/dist/modules/datasource/unity3d/index.js +36 -42
- package/dist/modules/datasource/unity3d/index.js.map +1 -1
- package/dist/modules/datasource/unity3d/schema.d.ts +47 -0
- package/dist/modules/datasource/unity3d/schema.js +17 -0
- package/dist/modules/datasource/unity3d/schema.js.map +1 -0
- package/dist/modules/manager/api.js +2 -0
- package/dist/modules/manager/api.js.map +1 -1
- package/dist/modules/manager/argocd/extract.js +1 -1
- package/dist/modules/manager/argocd/extract.js.map +1 -1
- package/dist/modules/manager/argocd/schema.d.ts +10 -10
- package/dist/modules/manager/asdf/upgradeable-tooling.js +94 -0
- package/dist/modules/manager/asdf/upgradeable-tooling.js.map +1 -1
- package/dist/modules/manager/azure-pipelines/schema.d.ts +32 -32
- package/dist/modules/manager/batect/schema.d.ts +4 -4
- package/dist/modules/manager/batect-wrapper/artifacts.js +1 -1
- package/dist/modules/manager/batect-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/bazel/rules/docker.d.ts +6 -6
- package/dist/modules/manager/bazel/rules/git.d.ts +10 -10
- package/dist/modules/manager/bazel/rules/git.js +9 -2
- package/dist/modules/manager/bazel/rules/git.js.map +1 -1
- package/dist/modules/manager/bazel/rules/go.d.ts +5 -5
- package/dist/modules/manager/bazel/rules/maven.d.ts +7 -7
- package/dist/modules/manager/bazel/rules/oci.d.ts +6 -6
- package/dist/modules/manager/bazel-module/parser/fragments.d.ts +40 -40
- package/dist/modules/manager/bazel-module/parser/maven.d.ts +40 -40
- package/dist/modules/manager/bazel-module/parser/oci.d.ts +17 -17
- package/dist/modules/manager/bazel-module/rules.d.ts +40 -40
- package/dist/modules/manager/bun/artifacts.js +0 -1
- package/dist/modules/manager/bun/artifacts.js.map +1 -1
- package/dist/modules/manager/bundler/artifacts.js +0 -1
- package/dist/modules/manager/bundler/artifacts.js.map +1 -1
- package/dist/modules/manager/bundler/extract.js +2 -1
- package/dist/modules/manager/bundler/extract.js.map +1 -1
- package/dist/modules/manager/cake/index.js +4 -2
- package/dist/modules/manager/cake/index.js.map +1 -1
- package/dist/modules/manager/cargo/artifacts.js +5 -7
- package/dist/modules/manager/cargo/artifacts.js.map +1 -1
- package/dist/modules/manager/cargo/schema.d.ts +114 -114
- package/dist/modules/manager/cocoapods/artifacts.js +1 -2
- package/dist/modules/manager/cocoapods/artifacts.js.map +1 -1
- package/dist/modules/manager/composer/artifacts.js +1 -2
- package/dist/modules/manager/composer/artifacts.js.map +1 -1
- package/dist/modules/manager/composer/schema.d.ts +26 -26
- package/dist/modules/manager/composer/schema.js +1 -1
- package/dist/modules/manager/composer/schema.js.map +1 -1
- package/dist/modules/manager/composer/utils.d.ts +1 -0
- package/dist/modules/manager/composer/utils.js +18 -6
- package/dist/modules/manager/composer/utils.js.map +1 -1
- package/dist/modules/manager/copier/artifacts.js +0 -1
- package/dist/modules/manager/copier/artifacts.js.map +1 -1
- package/dist/modules/manager/crossplane/schema.d.ts +2 -2
- package/dist/modules/manager/custom/jsonata/index.js +4 -0
- package/dist/modules/manager/custom/jsonata/index.js.map +1 -1
- package/dist/modules/manager/custom/jsonata/schema.d.ts +21 -21
- package/dist/modules/manager/custom/regex/index.js +2 -0
- package/dist/modules/manager/custom/regex/index.js.map +1 -1
- package/dist/modules/manager/deps-edn/extract.js +2 -1
- package/dist/modules/manager/deps-edn/extract.js.map +1 -1
- package/dist/modules/manager/devbox/artifacts.d.ts +1 -1
- package/dist/modules/manager/devbox/artifacts.js +28 -11
- package/dist/modules/manager/devbox/artifacts.js.map +1 -1
- package/dist/modules/manager/devbox/schema.js +1 -1
- package/dist/modules/manager/devbox/schema.js.map +1 -1
- package/dist/modules/manager/devcontainer/extract.js +43 -1
- package/dist/modules/manager/devcontainer/extract.js.map +1 -1
- package/dist/modules/manager/devcontainer/index.js +11 -1
- package/dist/modules/manager/devcontainer/index.js.map +1 -1
- package/dist/modules/manager/devcontainer/schema.d.ts +7 -3
- package/dist/modules/manager/devcontainer/schema.js +3 -1
- package/dist/modules/manager/devcontainer/schema.js.map +1 -1
- package/dist/modules/manager/docker-compose/schema.d.ts +6 -6
- package/dist/modules/manager/fingerprint.generated.js +86 -85
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/flux/artifacts.js +0 -1
- package/dist/modules/manager/flux/artifacts.js.map +1 -1
- package/dist/modules/manager/flux/extract.js +27 -24
- package/dist/modules/manager/flux/extract.js.map +1 -1
- package/dist/modules/manager/flux/schema.d.ts +94 -94
- package/dist/modules/manager/github-actions/extract.js +60 -39
- package/dist/modules/manager/github-actions/extract.js.map +1 -1
- package/dist/modules/manager/github-actions/schema.d.ts +66 -0
- package/dist/modules/manager/github-actions/schema.js +38 -0
- package/dist/modules/manager/github-actions/schema.js.map +1 -0
- package/dist/modules/manager/gitlabci/extract.d.ts +1 -5
- package/dist/modules/manager/gitlabci/extract.js +27 -126
- package/dist/modules/manager/gitlabci/extract.js.map +1 -1
- package/dist/modules/manager/gitlabci/schema.d.ts +55 -0
- package/dist/modules/manager/gitlabci/schema.js +63 -0
- package/dist/modules/manager/gitlabci/schema.js.map +1 -0
- package/dist/modules/manager/gitlabci-include/extract.js +6 -54
- package/dist/modules/manager/gitlabci-include/extract.js.map +1 -1
- package/dist/modules/manager/gitlabci-include/schema.d.ts +13 -0
- package/dist/modules/manager/gitlabci-include/schema.js +46 -0
- package/dist/modules/manager/gitlabci-include/schema.js.map +1 -0
- package/dist/modules/manager/glasskube/schema.d.ts +8 -8
- package/dist/modules/manager/gomod/artifacts.js +24 -10
- package/dist/modules/manager/gomod/artifacts.js.map +1 -1
- package/dist/modules/manager/gomod/extract.js +23 -0
- package/dist/modules/manager/gomod/extract.js.map +1 -1
- package/dist/modules/manager/gomod/line-parser.js +16 -0
- package/dist/modules/manager/gomod/line-parser.js.map +1 -1
- package/dist/modules/manager/gomod/update.js +2 -2
- package/dist/modules/manager/gomod/update.js.map +1 -1
- package/dist/modules/manager/gradle/artifacts.js +0 -1
- package/dist/modules/manager/gradle/artifacts.js.map +1 -1
- package/dist/modules/manager/gradle/extract/catalog.js +1 -1
- package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
- package/dist/modules/manager/gradle/parser/assignments.js +2 -2
- package/dist/modules/manager/gradle/parser/assignments.js.map +1 -1
- package/dist/modules/manager/gradle/parser/handlers.d.ts +1 -2
- package/dist/modules/manager/gradle/parser/handlers.js +10 -25
- package/dist/modules/manager/gradle/parser/handlers.js.map +1 -1
- package/dist/modules/manager/gradle/parser/registry-urls.js +11 -3
- package/dist/modules/manager/gradle/parser/registry-urls.js.map +1 -1
- package/dist/modules/manager/gradle-wrapper/artifacts.js +1 -2
- package/dist/modules/manager/gradle-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/helmfile/artifacts.js +0 -1
- package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
- package/dist/modules/manager/helmfile/extract.js +4 -0
- package/dist/modules/manager/helmfile/extract.js.map +1 -1
- package/dist/modules/manager/helmfile/schema.d.ts +9 -9
- package/dist/modules/manager/helmv3/artifacts.js +0 -1
- package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
- package/dist/modules/manager/helmv3/utils.js +3 -1
- package/dist/modules/manager/helmv3/utils.js.map +1 -1
- package/dist/modules/manager/hermit/artifacts.js +0 -1
- package/dist/modules/manager/hermit/artifacts.js.map +1 -1
- package/dist/modules/manager/homebrew/extract.js +0 -1
- package/dist/modules/manager/homebrew/extract.js.map +1 -1
- package/dist/modules/manager/jsonnet-bundler/artifacts.js +0 -1
- package/dist/modules/manager/jsonnet-bundler/artifacts.js.map +1 -1
- package/dist/modules/manager/kustomize/artifacts.d.ts +2 -0
- package/dist/modules/manager/kustomize/artifacts.js +154 -0
- package/dist/modules/manager/kustomize/artifacts.js.map +1 -0
- package/dist/modules/manager/kustomize/common.d.ts +3 -0
- package/dist/modules/manager/kustomize/common.js +22 -0
- package/dist/modules/manager/kustomize/common.js.map +1 -0
- package/dist/modules/manager/kustomize/index.d.ts +1 -0
- package/dist/modules/manager/kustomize/index.js +3 -1
- package/dist/modules/manager/kustomize/index.js.map +1 -1
- package/dist/modules/manager/kustomize/types.d.ts +4 -0
- package/dist/modules/manager/kustomize/types.js.map +1 -1
- package/dist/modules/manager/maven/extract.js +3 -1
- package/dist/modules/manager/maven/extract.js.map +1 -1
- package/dist/modules/manager/maven-wrapper/artifacts.js +0 -1
- package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/mise/extract.js +1 -1
- package/dist/modules/manager/mise/extract.js.map +1 -1
- package/dist/modules/manager/mix/artifacts.js +64 -14
- package/dist/modules/manager/mix/artifacts.js.map +1 -1
- package/dist/modules/manager/mix/index.d.ts +1 -0
- package/dist/modules/manager/mix/index.js +2 -1
- package/dist/modules/manager/mix/index.js.map +1 -1
- package/dist/modules/manager/nix/artifacts.js +0 -1
- package/dist/modules/manager/nix/artifacts.js.map +1 -1
- package/dist/modules/manager/nix/extract.js +1 -1
- package/dist/modules/manager/nix/extract.js.map +1 -1
- package/dist/modules/manager/nix/schema.d.ts +18 -18
- package/dist/modules/manager/npm/artifacts.js +0 -1
- package/dist/modules/manager/npm/artifacts.js.map +1 -1
- package/dist/modules/manager/npm/extract/yarn.js +2 -2
- package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
- package/dist/modules/manager/npm/post-update/npm.js +0 -1
- package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/pnpm.js +13 -2
- package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/rules.js +11 -1
- package/dist/modules/manager/npm/post-update/rules.js.map +1 -1
- package/dist/modules/manager/npm/post-update/yarn.js +0 -1
- package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
- package/dist/modules/manager/npm/schema.d.ts +13 -13
- package/dist/modules/manager/npm/update/dependency/index.js +1 -1
- package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
- package/dist/modules/manager/nuget/artifacts.js +1 -2
- package/dist/modules/manager/nuget/artifacts.js.map +1 -1
- package/dist/modules/manager/nuget/package-tree.js +4 -0
- package/dist/modules/manager/nuget/package-tree.js.map +1 -1
- package/dist/modules/manager/nuget/schema.d.ts +8 -8
- package/dist/modules/manager/nuget/util.js +4 -1
- package/dist/modules/manager/nuget/util.js.map +1 -1
- package/dist/modules/manager/ocb/schema.d.ts +6 -6
- package/dist/modules/manager/pep621/processors/pdm.js +0 -1
- package/dist/modules/manager/pep621/processors/pdm.js.map +1 -1
- package/dist/modules/manager/pep621/processors/uv.js +0 -1
- package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
- package/dist/modules/manager/pep621/schema.d.ts +59 -54
- package/dist/modules/manager/pep621/schema.js +2 -0
- package/dist/modules/manager/pep621/schema.js.map +1 -1
- package/dist/modules/manager/pep621/utils.js +1 -1
- package/dist/modules/manager/pep621/utils.js.map +1 -1
- package/dist/modules/manager/pip-compile/common.js +0 -1
- package/dist/modules/manager/pip-compile/common.js.map +1 -1
- package/dist/modules/manager/pip_requirements/artifacts.js +0 -1
- package/dist/modules/manager/pip_requirements/artifacts.js.map +1 -1
- package/dist/modules/manager/pipenv/artifacts.js +0 -1
- package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
- package/dist/modules/manager/pixi/artifacts.d.ts +3 -0
- package/dist/modules/manager/pixi/artifacts.js +84 -0
- package/dist/modules/manager/pixi/artifacts.js.map +1 -0
- package/dist/modules/manager/pixi/extract.d.ts +2 -0
- package/dist/modules/manager/pixi/extract.js +53 -0
- package/dist/modules/manager/pixi/extract.js.map +1 -0
- package/dist/modules/manager/pixi/index.d.ts +11 -0
- package/dist/modules/manager/pixi/index.js +22 -0
- package/dist/modules/manager/pixi/index.js.map +1 -0
- package/dist/modules/manager/pixi/lockfile.d.ts +6 -0
- package/dist/modules/manager/pixi/lockfile.js +25 -0
- package/dist/modules/manager/pixi/lockfile.js.map +1 -0
- package/dist/modules/manager/pixi/schema.d.ts +14 -0
- package/dist/modules/manager/pixi/schema.js +14 -0
- package/dist/modules/manager/pixi/schema.js.map +1 -0
- package/dist/modules/manager/poetry/artifacts.js +3 -4
- package/dist/modules/manager/poetry/artifacts.js.map +1 -1
- package/dist/modules/manager/poetry/extract.js +2 -1
- package/dist/modules/manager/poetry/extract.js.map +1 -1
- package/dist/modules/manager/poetry/schema.d.ts +48 -48
- package/dist/modules/manager/pub/artifacts.js +0 -1
- package/dist/modules/manager/pub/artifacts.js.map +1 -1
- package/dist/modules/manager/pub/schema.d.ts +8 -8
- package/dist/modules/manager/scalafmt/extract.js +1 -1
- package/dist/modules/manager/scalafmt/extract.js.map +1 -1
- package/dist/modules/manager/sveltos/schema.d.ts +12 -12
- package/dist/modules/manager/terraform/lockfile/hash.d.ts +1 -1
- package/dist/modules/manager/types.d.ts +6 -2
- package/dist/modules/manager/types.js.map +1 -1
- package/dist/modules/manager/vendir/schema.d.ts +4 -4
- package/dist/modules/platform/api.d.ts +1 -1
- package/dist/modules/platform/azure/azure-helper.js +2 -2
- package/dist/modules/platform/azure/azure-helper.js.map +1 -1
- package/dist/modules/platform/azure/index.js +14 -14
- package/dist/modules/platform/azure/index.js.map +1 -1
- package/dist/modules/platform/bitbucket/comments.js +4 -4
- package/dist/modules/platform/bitbucket/comments.js.map +1 -1
- package/dist/modules/platform/bitbucket/index.d.ts +1 -0
- package/dist/modules/platform/bitbucket/index.js +54 -44
- package/dist/modules/platform/bitbucket/index.js.map +1 -1
- package/dist/modules/platform/bitbucket/schema.d.ts +11 -11
- package/dist/modules/platform/bitbucket/utils.js +3 -3
- package/dist/modules/platform/bitbucket/utils.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/index.d.ts +3 -3
- package/dist/modules/platform/bitbucket-server/index.js +81 -81
- package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/pr-cache.d.ts +23 -0
- package/dist/modules/platform/bitbucket-server/pr-cache.js +125 -0
- package/dist/modules/platform/bitbucket-server/pr-cache.js.map +1 -0
- package/dist/modules/platform/bitbucket-server/schema.d.ts +75 -0
- package/dist/modules/platform/bitbucket-server/schema.js +14 -1
- package/dist/modules/platform/bitbucket-server/schema.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/types.d.ts +8 -2
- package/dist/modules/platform/bitbucket-server/types.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/utils.d.ts +0 -2
- package/dist/modules/platform/bitbucket-server/utils.js +6 -52
- package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
- package/dist/modules/platform/codecommit/codecommit-client.js +6 -6
- package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
- package/dist/modules/platform/codecommit/index.js +24 -24
- package/dist/modules/platform/codecommit/index.js.map +1 -1
- package/dist/modules/platform/gerrit/client.js +13 -2
- package/dist/modules/platform/gerrit/client.js.map +1 -1
- package/dist/modules/platform/gerrit/utils.js +1 -1
- package/dist/modules/platform/gerrit/utils.js.map +1 -1
- package/dist/modules/platform/gitea/gitea-helper.d.ts +1 -0
- package/dist/modules/platform/gitea/gitea-helper.js +16 -0
- package/dist/modules/platform/gitea/gitea-helper.js.map +1 -1
- package/dist/modules/platform/gitea/index.d.ts +1 -0
- package/dist/modules/platform/gitea/index.js +26 -7
- package/dist/modules/platform/gitea/index.js.map +1 -1
- package/dist/modules/platform/gitea/schema.d.ts +8 -8
- package/dist/modules/platform/gitea/types.d.ts +1 -1
- package/dist/modules/platform/gitea/types.js.map +1 -1
- package/dist/modules/platform/github/common.d.ts +2 -0
- package/dist/modules/platform/github/common.js +16 -0
- package/dist/modules/platform/github/common.js.map +1 -1
- package/dist/modules/platform/github/index.d.ts +1 -1
- package/dist/modules/platform/github/index.js +87 -82
- package/dist/modules/platform/github/index.js.map +1 -1
- package/dist/modules/platform/github/issue.d.ts +12 -12
- package/dist/modules/platform/github/massage-markdown-links.js +2 -2
- package/dist/modules/platform/github/massage-markdown-links.js.map +1 -1
- package/dist/modules/platform/github/pr.js +3 -3
- package/dist/modules/platform/github/pr.js.map +1 -1
- package/dist/modules/platform/github/schema.d.ts +76 -76
- package/dist/modules/platform/github/schema.js +3 -1
- package/dist/modules/platform/github/schema.js.map +1 -1
- package/dist/modules/platform/gitlab/index.d.ts +1 -0
- package/dist/modules/platform/gitlab/index.js +70 -43
- package/dist/modules/platform/gitlab/index.js.map +1 -1
- package/dist/modules/platform/index.js +0 -1
- package/dist/modules/platform/index.js.map +1 -1
- package/dist/modules/platform/scm.d.ts +1 -1
- package/dist/modules/versioning/api.js +2 -0
- package/dist/modules/versioning/api.js.map +1 -1
- package/dist/modules/versioning/composer/index.js +10 -0
- package/dist/modules/versioning/composer/index.js.map +1 -1
- package/dist/modules/versioning/conda/index.d.ts +41 -0
- package/dist/modules/versioning/conda/index.js +178 -0
- package/dist/modules/versioning/conda/index.js.map +1 -0
- package/dist/modules/versioning/hashicorp/convertor.d.ts +2 -1
- package/dist/modules/versioning/hashicorp/convertor.js +13 -8
- package/dist/modules/versioning/hashicorp/convertor.js.map +1 -1
- package/dist/modules/versioning/hex/index.js +3 -3
- package/dist/modules/versioning/hex/index.js.map +1 -1
- package/dist/modules/versioning/npm/index.js +2 -1
- package/dist/modules/versioning/npm/index.js.map +1 -1
- package/dist/modules/versioning/schema.js +1 -1
- package/dist/modules/versioning/schema.js.map +1 -1
- package/dist/modules/versioning/types.d.ts +4 -0
- package/dist/modules/versioning/types.js.map +1 -1
- package/dist/proxy.js +2 -1
- package/dist/proxy.js.map +1 -1
- package/dist/renovate.js +2 -2
- package/dist/renovate.js.map +1 -1
- package/dist/util/cache/package/decorator.js +2 -2
- package/dist/util/cache/package/decorator.js.map +1 -1
- package/dist/util/cache/package/redis.js +0 -1
- package/dist/util/cache/package/redis.js.map +1 -1
- package/dist/util/cache/package/types.d.ts +1 -1
- package/dist/util/cache/package/types.js.map +1 -1
- package/dist/util/cache/repository/impl/base.d.ts +1 -1
- package/dist/util/cache/repository/schema.d.ts +4 -4
- package/dist/util/cache/repository/types.d.ts +3 -0
- package/dist/util/cache/repository/types.js.map +1 -1
- package/dist/util/env.d.ts +4 -0
- package/dist/util/env.js +22 -0
- package/dist/util/env.js.map +1 -0
- package/dist/util/exec/containerbase.js +18 -12
- package/dist/util/exec/containerbase.js.map +1 -1
- package/dist/util/exec/index.js +5 -2
- package/dist/util/exec/index.js.map +1 -1
- package/dist/util/exec/types.d.ts +0 -2
- package/dist/util/exec/types.js.map +1 -1
- package/dist/util/exec/utils.d.ts +1 -1
- package/dist/util/exec/utils.js +6 -5
- package/dist/util/exec/utils.js.map +1 -1
- package/dist/util/git/author.js +1 -1
- package/dist/util/git/author.js.map +1 -1
- package/dist/util/git/config.js +0 -1
- package/dist/util/git/config.js.map +1 -1
- package/dist/util/git/error.js +4 -2
- package/dist/util/git/error.js.map +1 -1
- package/dist/util/git/index.js +73 -46
- package/dist/util/git/index.js.map +1 -1
- package/dist/util/git/private-key.js +1 -1
- package/dist/util/git/private-key.js.map +1 -1
- package/dist/util/github/graphql/query-adapters/releases-query-adapter.d.ts +2 -2
- package/dist/util/github/graphql/query-adapters/tags-query-adapter.d.ts +2 -2
- package/dist/util/http/auth.js +0 -1
- package/dist/util/http/auth.js.map +1 -1
- package/dist/util/http/bitbucket-server.d.ts +5 -4
- package/dist/util/http/bitbucket-server.js +21 -20
- package/dist/util/http/bitbucket-server.js.map +1 -1
- package/dist/util/http/bitbucket.d.ts +6 -5
- package/dist/util/http/bitbucket.js +34 -31
- package/dist/util/http/bitbucket.js.map +1 -1
- package/dist/util/http/cache/abstract-http-cache-provider.js +2 -2
- package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
- package/dist/util/http/cache/memory-http-cache-provider.d.ts +10 -0
- package/dist/util/http/cache/memory-http-cache-provider.js +29 -0
- package/dist/util/http/cache/memory-http-cache-provider.js.map +1 -0
- package/dist/util/http/cache/schema.d.ts +2 -2
- package/dist/util/http/errors.d.ts +2 -0
- package/dist/util/http/errors.js +8 -0
- package/dist/util/http/errors.js.map +1 -0
- package/dist/util/http/gerrit.d.ts +6 -4
- package/dist/util/http/gerrit.js +11 -12
- package/dist/util/http/gerrit.js.map +1 -1
- package/dist/util/http/gitea.d.ts +5 -4
- package/dist/util/http/gitea.js +14 -13
- package/dist/util/http/gitea.js.map +1 -1
- package/dist/util/http/github.d.ts +14 -8
- package/dist/util/http/github.js +65 -60
- package/dist/util/http/github.js.map +1 -1
- package/dist/util/http/gitlab.d.ts +7 -5
- package/dist/util/http/gitlab.js +58 -46
- package/dist/util/http/gitlab.js.map +1 -1
- package/dist/util/http/got.d.ts +9 -0
- package/dist/util/http/got.js +54 -0
- package/dist/util/http/got.js.map +1 -0
- package/dist/util/http/host-rules.d.ts +2 -1
- package/dist/util/http/host-rules.js +5 -4
- package/dist/util/http/host-rules.js.map +1 -1
- package/dist/util/http/http.d.ts +93 -0
- package/dist/util/http/http.js +346 -0
- package/dist/util/http/http.js.map +1 -0
- package/dist/util/http/index.d.ts +6 -74
- package/dist/util/http/index.js +5 -359
- package/dist/util/http/index.js.map +1 -1
- package/dist/util/http/legacy.js +4 -1
- package/dist/util/http/legacy.js.map +1 -1
- package/dist/util/http/types.d.ts +9 -16
- package/dist/util/http/types.js.map +1 -1
- package/dist/util/stats.d.ts +10 -0
- package/dist/util/stats.js +45 -1
- package/dist/util/stats.js.map +1 -1
- package/dist/util/string.d.ts +15 -0
- package/dist/util/string.js +75 -0
- package/dist/util/string.js.map +1 -1
- package/dist/util/toml.d.ts +1 -0
- package/dist/util/toml.js +6 -0
- package/dist/util/toml.js.map +1 -1
- package/dist/util/url.js +3 -8
- package/dist/util/url.js.map +1 -1
- package/dist/util/yaml.js +2 -6
- package/dist/util/yaml.js.map +1 -1
- package/dist/workers/global/config/parse/env.js +3 -2
- package/dist/workers/global/config/parse/env.js.map +1 -1
- package/dist/workers/global/config/parse/file.js +19 -9
- package/dist/workers/global/config/parse/file.js.map +1 -1
- package/dist/workers/global/config/parse/host-rules-from-env.js +6 -2
- package/dist/workers/global/config/parse/host-rules-from-env.js.map +1 -1
- package/dist/workers/global/config/parse/index.js +5 -0
- package/dist/workers/global/config/parse/index.js.map +1 -1
- package/dist/workers/repository/cache.js +1 -2
- package/dist/workers/repository/cache.js.map +1 -1
- package/dist/workers/repository/config-migration/branch/migrated-data.js +2 -0
- package/dist/workers/repository/config-migration/branch/migrated-data.js.map +1 -1
- package/dist/workers/repository/index.js +1 -0
- package/dist/workers/repository/index.js.map +1 -1
- package/dist/workers/repository/init/merge.js +6 -3
- package/dist/workers/repository/init/merge.js.map +1 -1
- package/dist/workers/repository/onboarding/pr/config-description.js +3 -1
- package/dist/workers/repository/onboarding/pr/config-description.js.map +1 -1
- package/dist/workers/repository/process/extract-update.js +0 -1
- package/dist/workers/repository/process/extract-update.js.map +1 -1
- package/dist/workers/repository/process/fingerprint-fields.js +0 -1
- package/dist/workers/repository/process/fingerprint-fields.js.map +1 -1
- package/dist/workers/repository/process/libyear.js +2 -2
- package/dist/workers/repository/process/libyear.js.map +1 -1
- package/dist/workers/repository/process/lookup/index.js +13 -4
- package/dist/workers/repository/process/lookup/index.js.map +1 -1
- package/dist/workers/repository/process/vulnerabilities.js +1 -1
- package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
- package/dist/workers/repository/process/write.js +1 -8
- package/dist/workers/repository/process/write.js.map +1 -1
- package/dist/workers/repository/reconfigure/validate.js +1 -0
- package/dist/workers/repository/reconfigure/validate.js.map +1 -1
- package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +10 -1
- package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +1 -1
- package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/github/index.js +6 -3
- package/dist/workers/repository/update/pr/changelog/github/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/gitlab/index.js +1 -1
- package/dist/workers/repository/update/pr/changelog/gitlab/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/source.js +1 -0
- package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
- package/dist/workers/repository/updates/flatten.js +8 -4
- package/dist/workers/repository/updates/flatten.js.map +1 -1
- package/dist/workers/repository/updates/generate.js +1 -2
- package/dist/workers/repository/updates/generate.js.map +1 -1
- package/dist/workers/types.d.ts +1 -4
- package/dist/workers/types.js.map +1 -1
- package/package.json +69 -72
- package/renovate-schema.json +15 -1
- package/dist/modules/manager/github-actions/types.d.ts +0 -30
- package/dist/modules/manager/github-actions/types.js +0 -3
- package/dist/modules/manager/github-actions/types.js.map +0 -1
- package/dist/modules/manager/gitlabci/common.d.ts +0 -6
- package/dist/modules/manager/gitlabci/common.js +0 -30
- package/dist/modules/manager/gitlabci/common.js.map +0 -1
- package/dist/modules/manager/gitlabci/types.d.ts +0 -35
- package/dist/modules/manager/gitlabci/types.js +0 -3
- package/dist/modules/manager/gitlabci/types.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip-compile/common.ts"],"names":[],"mappings":";;;AAiBA,gEAkBC;AAED,oEAYC;AAED,wDAUC;AAED,4DAeC;AAED,wCA4BC;AAsDD,oDA+GC;AAOD,oDAqBC;AAoDD,kFA0BC;AAED,oCAeC;;AA5YD,kEAAkC;AAClC,iCAA8B;AAC9B,0DAA0B;AAC1B,4CAAyC;AACzC,+CAA2D;AAM3D,yCAAkD;AAClD,gDAAwD;AACxD,4EAAsD;AACtD,+CAA4C;AAI5C,SAAgB,0BAA0B,CACxC,MAA6B,EAC7B,sBAA0C;IAE1C,MAAM,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IACpC,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAE/B,IAAI,MAAM,EAAE,CAAC;QACX,eAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,sBAAsB,EAAE,CAAC;QAC3B,eAAM,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;QACrE,OAAO,KAAK,sBAAsB,EAAE,CAAC;IACvC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,4BAA4B,CAC1C,MAA6B;IAE7B,MAAM,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,M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CAAC,EAAE,CAAC;QAC1D,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { split } from 'shlex';\nimport upath from 'upath';\nimport { logger } from '../../../logger';\nimport { isNotNullOrUndefined } from '../../../util/array';\nimport type {\n ExecOptions,\n ExtraEnv,\n ToolConstraint,\n} from '../../../util/exec/types';\nimport { ensureCacheDir } from '../../../util/fs';\nimport { ensureLocalPath } from '../../../util/fs/util';\nimport * as hostRules from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport type { PackageFileContent, UpdateArtifactsConfig } from '../types';\nimport type { CommandType, PipCompileArgs, SupportedManagers } from './types';\n\nexport function getPythonVersionConstraint(\n config: UpdateArtifactsConfig,\n extractedPythonVersion: string | undefined,\n): string | undefined | null {\n const { constraints = {} } = config;\n const { python } = constraints;\n\n if (python) {\n logger.debug('Using python constraint from config');\n return python;\n }\n\n if (extractedPythonVersion) {\n logger.debug('Using python constraint extracted from the lock file');\n return `==${extractedPythonVersion}`;\n }\n\n return undefined;\n}\n\nexport function getPipToolsVersionConstraint(\n config: UpdateArtifactsConfig,\n): string {\n const { constraints = {} } = config;\n const { pipTools } = constraints;\n\n if (is.string(pipTools)) {\n logger.debug('Using pipTools constraint from config');\n return pipTools;\n }\n\n return '';\n}\n\nexport function getUvVersionConstraint(config: UpdateArtifactsConfig): string {\n const { constraints = {} } = config;\n const { uv } = constraints;\n\n if (is.string(uv)) {\n logger.debug('Using uv constraint from config');\n return uv;\n }\n\n return '';\n}\n\nexport function getToolVersionConstraint(\n config: UpdateArtifactsConfig,\n commandType: CommandType,\n): ToolConstraint {\n if (commandType === 'uv') {\n return {\n toolName: 'uv',\n constraint: getUvVersionConstraint(config),\n };\n }\n\n return {\n toolName: 'pip-tools',\n constraint: getPipToolsVersionConstraint(config),\n };\n}\n\nexport async function getExecOptions(\n config: UpdateArtifactsConfig,\n commandType: CommandType,\n cwd: string,\n extraEnv: ExtraEnv<string>,\n extractedPythonVersion: string | undefined,\n): Promise<ExecOptions> {\n const constraint = getPythonVersionConstraint(config, extractedPythonVersion);\n const execOptions: ExecOptions = {\n cwd: ensureLocalPath(cwd),\n docker: {},\n userConfiguredEnv: config.env,\n toolConstraints: [\n {\n toolName: 'python',\n constraint,\n },\n getToolVersionConstraint(config, commandType),\n ],\n extraEnv: {\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n PIP_NO_INPUT: 'true', // ensure pip doesn't block forever waiting for credentials on stdin\n PIP_KEYRING_PROVIDER: 'import',\n PYTHON_KEYRING_BACKEND: 'keyrings.envvars.keyring.EnvvarsKeyring',\n ...extraEnv,\n },\n };\n return execOptions;\n}\n\nexport const constraintLineRegex = regEx(\n /^(#.*?\\r?\\n)+# {4}(?<command>\\S*)(?<arguments> .*?)?\\r?\\n/,\n);\n\nexport const disallowedPipOptions = [\n '--no-header', // header is required by this manager\n];\nconst commonOptionsWithArguments = [\n '--output-file',\n '--extra',\n '--extra-index-url',\n];\nconst pipOptionsWithArguments = [\n '--resolver',\n '--constraint',\n ...commonOptionsWithArguments,\n];\nconst uvOptionsWithArguments = [\n '--constraints',\n '--python-version',\n ...commonOptionsWithArguments,\n];\nexport const optionsWithArguments = [\n ...pipOptionsWithArguments,\n ...uvOptionsWithArguments,\n];\nconst allowedCommonOptions = [\n '-v',\n '--generate-hashes',\n '--emit-index-url',\n '--index-url',\n];\nexport const allowedOptions: Record<CommandType, string[]> = {\n 'pip-compile': [\n '--all-extras',\n '--allow-unsafe',\n '--generate-hashes',\n '--no-emit-index-url',\n '--strip-extras',\n ...allowedCommonOptions,\n ...pipOptionsWithArguments,\n ],\n uv: [\n '--no-strip-extras',\n '--universal',\n ...allowedCommonOptions,\n ...uvOptionsWithArguments,\n ],\n custom: [],\n};\n\n// TODO(not7cd): test on all correct headers, even with CUSTOM_COMPILE_COMMAND\nexport function extractHeaderCommand(\n content: string,\n fileName: string,\n): PipCompileArgs {\n const compileCommand = constraintLineRegex.exec(content);\n if (compileCommand?.groups === undefined) {\n throw new Error(\n `Failed to extract command from header in ${fileName} ${content}`,\n );\n }\n logger.trace(\n `pip-compile: found header in ${fileName}: \\n${compileCommand[0]}`,\n );\n const command = compileCommand.groups.command;\n const argv = [command];\n let commandType: CommandType;\n if (command === 'pip-compile') {\n commandType = 'pip-compile';\n } else if (command === 'uv') {\n commandType = 'uv';\n } else {\n commandType = 'custom';\n }\n if (compileCommand.groups.arguments) {\n argv.push(...split(compileCommand.groups.arguments));\n }\n logger.debug(\n { fileName, argv, commandType },\n `pip-compile: extracted command from header`,\n );\n\n const result: PipCompileArgs = {\n argv,\n command,\n commandType,\n outputFile: '',\n sourceFiles: [],\n };\n for (const arg of argv.slice(1)) {\n if (commandType === 'uv' && ['pip', 'compile'].includes(arg)) {\n continue;\n }\n // TODO(not7cd): check for \"--option -- argument\" case\n if (!arg.startsWith('-')) {\n result.sourceFiles.push(arg);\n continue;\n }\n throwForDisallowedOption(arg);\n throwForNoEqualSignInOptionWithArgument(arg);\n throwForUnknownOption(commandType, arg);\n\n if (arg.includes('=')) {\n const [option, value] = arg.split('=');\n if (option === '--extra') {\n result.extra = result.extra ?? [];\n result.extra.push(value);\n } else if (option === '--extra-index-url') {\n result.extraIndexUrl = result.extraIndexUrl ?? [];\n result.extraIndexUrl.push(value);\n // TODO: add to secrets? next PR\n } else if (['--constraint', '--constraints'].includes(option)) {\n result.constraintsFiles = result.constraintsFiles ?? [];\n result.constraintsFiles.push(value);\n } else if (option === '--output-file') {\n if (result.outputFile) {\n throw new Error('Cannot use multiple --output-file options');\n }\n result.outputFile = upath.normalize(value);\n } else if (option === '--python-version') {\n result.pythonVersion = value;\n } else if (option === '--index-url') {\n if (result.indexUrl) {\n throw new Error('Cannot use multiple --index-url options');\n }\n result.indexUrl = value;\n // TODO: add to secrets? next PR\n } else {\n logger.debug({ option }, `pip-compile: option not handled`);\n }\n continue;\n }\n if (arg === '--no-emit-index-url') {\n result.noEmitIndexUrl = true;\n continue;\n }\n if (arg === '--emit-index-url') {\n result.emitIndexUrl = true;\n continue;\n }\n if (arg === '--all-extras') {\n result.allExtras = true;\n continue;\n }\n\n logger.debug({ option: arg }, `pip-compile: option not handled`);\n }\n logger.trace(\n {\n ...result,\n },\n 'Parsed pip-compile command from header',\n );\n if (result.noEmitIndexUrl && result.emitIndexUrl) {\n throw new Error('Cannot use both --no-emit-index-url and --emit-index-url');\n }\n if (result.sourceFiles.length === 0) {\n throw new Error(\n 'No source files detected in command, pass at least one package file explicitly',\n );\n }\n return result;\n}\n\nconst pythonVersionRegex = regEx(\n /^(#.*?\\r?\\n)*# This file is autogenerated by pip-compile with Python (?<pythonVersion>\\d+(\\.\\d+)*)\\s/,\n 'i',\n);\n\nexport function extractPythonVersion(\n content: string,\n fileName: string,\n): string | undefined {\n const match = pythonVersionRegex.exec(content);\n if (match?.groups === undefined) {\n logger.warn(\n { fileName, content },\n 'pip-compile: failed to extract Python version from header in file',\n );\n return undefined;\n }\n logger.trace(\n `pip-compile: found Python version header in ${fileName}: \\n${match[0]}`,\n );\n const { pythonVersion } = match.groups;\n logger.debug(\n { fileName, pythonVersion },\n `pip-compile: extracted Python version from header`,\n );\n return pythonVersion;\n}\n\nfunction throwForDisallowedOption(arg: string): void {\n if (disallowedPipOptions.includes(arg)) {\n throw new Error(`Option ${arg} not allowed for this manager`);\n }\n}\nfunction throwForNoEqualSignInOptionWithArgument(arg: string): void {\n if (optionsWithArguments.includes(arg)) {\n throw new Error(\n `Option ${arg} must have equal sign '=' separating it's argument`,\n );\n }\n}\nfunction throwForUnknownOption(commandType: CommandType, arg: string): void {\n if (arg.includes('=')) {\n const [option] = arg.split('=');\n if (allowedOptions[commandType].includes(option)) {\n return;\n }\n }\n if (allowedOptions[commandType].includes(arg)) {\n return;\n }\n throw new Error(`Option ${arg} not supported (yet)`);\n}\n\nfunction getRegistryCredEnvVars(\n url: URL,\n index: number,\n): Record<string, string> {\n const hostRule = hostRules.find({ url: url.href });\n logger.debug(hostRule, `Found host rule for url ${url.href}`);\n const ret: Record<string, string> = {};\n if (!!hostRule.username || !!hostRule.password) {\n ret[`KEYRING_SERVICE_NAME_${index}`] = url.hostname;\n ret[`KEYRING_SERVICE_USERNAME_${index}`] = hostRule.username ?? '';\n ret[`KEYRING_SERVICE_PASSWORD_${index}`] = hostRule.password ?? '';\n }\n return ret;\n}\n\nfunction cleanUrl(url: string): URL | null {\n try {\n // Strip everything but protocol, host, and port\n const urlObj = new URL(url);\n return new URL(urlObj.origin);\n } catch {\n return null;\n }\n}\n\nexport function getRegistryCredVarsFromPackageFiles(\n packageFiles: PackageFileContent[],\n): ExtraEnv<string> {\n const urls: string[] = [];\n for (const packageFile of packageFiles) {\n urls.push(\n ...(packageFile.registryUrls ?? []),\n ...(packageFile.additionalRegistryUrls ?? []),\n );\n }\n logger.debug(urls, 'Extracted registry URLs from package files');\n\n const uniqueHosts = new Set<URL>(\n urls.map(cleanUrl).filter(isNotNullOrUndefined),\n );\n\n let allCreds: ExtraEnv<string> = {};\n for (const [index, host] of [...uniqueHosts].entries()) {\n const hostCreds = getRegistryCredEnvVars(host, index);\n allCreds = {\n ...allCreds,\n ...hostCreds,\n };\n }\n\n return allCreds;\n}\n\nexport function matchManager(filename: string): SupportedManagers | 'unknown' {\n if (filename.endsWith('setup.py')) {\n return 'pip_setup';\n }\n if (filename.endsWith('setup.cfg')) {\n return 'setup-cfg';\n }\n if (filename.endsWith('pyproject.toml')) {\n return 'pep621';\n }\n // naive, could be improved, maybe use pip_requirements.fileMatch\n if (filename.endsWith('.in') || filename.endsWith('.txt')) {\n return 'pip_requirements';\n }\n return 'unknown';\n}\n"]}
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip-compile/common.ts"],"names":[],"mappings":";;;AAiBA,gEAkBC;AAED,oEAYC;AAED,wDAUC;AAED,4DAeC;AAED,wCA2BC;AAsDD,oDA+GC;AAOD,oDAqBC;AAoDD,kFA0BC;AAED,oCAeC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AE,EAAE,CAAC;QACvD,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACtD,QAAQ,GAAG;YACT,GAAG,QAAQ;YACX,GAAG,SAAS;SACb,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAgB,YAAY,CAAC,QAAgB;IAC3C,IAAI,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAClC,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACnC,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACxC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,iEAAiE;IACjE,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1D,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { split } from 'shlex';\nimport upath from 'upath';\nimport { logger } from '../../../logger';\nimport { isNotNullOrUndefined } from '../../../util/array';\nimport type {\n ExecOptions,\n ExtraEnv,\n ToolConstraint,\n} from '../../../util/exec/types';\nimport { ensureCacheDir } from '../../../util/fs';\nimport { ensureLocalPath } from '../../../util/fs/util';\nimport * as hostRules from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport type { PackageFileContent, UpdateArtifactsConfig } from '../types';\nimport type { CommandType, PipCompileArgs, SupportedManagers } from './types';\n\nexport function getPythonVersionConstraint(\n config: UpdateArtifactsConfig,\n extractedPythonVersion: string | undefined,\n): string | undefined | null {\n const { constraints = {} } = config;\n const { python } = constraints;\n\n if (python) {\n logger.debug('Using python constraint from config');\n return python;\n }\n\n if (extractedPythonVersion) {\n logger.debug('Using python constraint extracted from the lock file');\n return `==${extractedPythonVersion}`;\n }\n\n return undefined;\n}\n\nexport function getPipToolsVersionConstraint(\n config: UpdateArtifactsConfig,\n): string {\n const { constraints = {} } = config;\n const { pipTools } = constraints;\n\n if (is.string(pipTools)) {\n logger.debug('Using pipTools constraint from config');\n return pipTools;\n }\n\n return '';\n}\n\nexport function getUvVersionConstraint(config: UpdateArtifactsConfig): string {\n const { constraints = {} } = config;\n const { uv } = constraints;\n\n if (is.string(uv)) {\n logger.debug('Using uv constraint from config');\n return uv;\n }\n\n return '';\n}\n\nexport function getToolVersionConstraint(\n config: UpdateArtifactsConfig,\n commandType: CommandType,\n): ToolConstraint {\n if (commandType === 'uv') {\n return {\n toolName: 'uv',\n constraint: getUvVersionConstraint(config),\n };\n }\n\n return {\n toolName: 'pip-tools',\n constraint: getPipToolsVersionConstraint(config),\n };\n}\n\nexport async function getExecOptions(\n config: UpdateArtifactsConfig,\n commandType: CommandType,\n cwd: string,\n extraEnv: ExtraEnv<string>,\n extractedPythonVersion: string | undefined,\n): Promise<ExecOptions> {\n const constraint = getPythonVersionConstraint(config, extractedPythonVersion);\n const execOptions: ExecOptions = {\n cwd: ensureLocalPath(cwd),\n docker: {},\n toolConstraints: [\n {\n toolName: 'python',\n constraint,\n },\n getToolVersionConstraint(config, commandType),\n ],\n extraEnv: {\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n PIP_NO_INPUT: 'true', // ensure pip doesn't block forever waiting for credentials on stdin\n PIP_KEYRING_PROVIDER: 'import',\n PYTHON_KEYRING_BACKEND: 'keyrings.envvars.keyring.EnvvarsKeyring',\n ...extraEnv,\n },\n };\n return execOptions;\n}\n\nexport const constraintLineRegex = regEx(\n /^(#.*?\\r?\\n)+# {4}(?<command>\\S*)(?<arguments> .*?)?\\r?\\n/,\n);\n\nexport const disallowedPipOptions = [\n '--no-header', // header is required by this manager\n];\nconst commonOptionsWithArguments = [\n '--output-file',\n '--extra',\n '--extra-index-url',\n];\nconst pipOptionsWithArguments = [\n '--resolver',\n '--constraint',\n ...commonOptionsWithArguments,\n];\nconst uvOptionsWithArguments = [\n '--constraints',\n '--python-version',\n ...commonOptionsWithArguments,\n];\nexport const optionsWithArguments = [\n ...pipOptionsWithArguments,\n ...uvOptionsWithArguments,\n];\nconst allowedCommonOptions = [\n '-v',\n '--generate-hashes',\n '--emit-index-url',\n '--index-url',\n];\nexport const allowedOptions: Record<CommandType, string[]> = {\n 'pip-compile': [\n '--all-extras',\n '--allow-unsafe',\n '--generate-hashes',\n '--no-emit-index-url',\n '--strip-extras',\n ...allowedCommonOptions,\n ...pipOptionsWithArguments,\n ],\n uv: [\n '--no-strip-extras',\n '--universal',\n ...allowedCommonOptions,\n ...uvOptionsWithArguments,\n ],\n custom: [],\n};\n\n// TODO(not7cd): test on all correct headers, even with CUSTOM_COMPILE_COMMAND\nexport function extractHeaderCommand(\n content: string,\n fileName: string,\n): PipCompileArgs {\n const compileCommand = constraintLineRegex.exec(content);\n if (compileCommand?.groups === undefined) {\n throw new Error(\n `Failed to extract command from header in ${fileName} ${content}`,\n );\n }\n logger.trace(\n `pip-compile: found header in ${fileName}: \\n${compileCommand[0]}`,\n );\n const command = compileCommand.groups.command;\n const argv = [command];\n let commandType: CommandType;\n if (command === 'pip-compile') {\n commandType = 'pip-compile';\n } else if (command === 'uv') {\n commandType = 'uv';\n } else {\n commandType = 'custom';\n }\n if (compileCommand.groups.arguments) {\n argv.push(...split(compileCommand.groups.arguments));\n }\n logger.debug(\n { fileName, argv, commandType },\n `pip-compile: extracted command from header`,\n );\n\n const result: PipCompileArgs = {\n argv,\n command,\n commandType,\n outputFile: '',\n sourceFiles: [],\n };\n for (const arg of argv.slice(1)) {\n if (commandType === 'uv' && ['pip', 'compile'].includes(arg)) {\n continue;\n }\n // TODO(not7cd): check for \"--option -- argument\" case\n if (!arg.startsWith('-')) {\n result.sourceFiles.push(arg);\n continue;\n }\n throwForDisallowedOption(arg);\n throwForNoEqualSignInOptionWithArgument(arg);\n throwForUnknownOption(commandType, arg);\n\n if (arg.includes('=')) {\n const [option, value] = arg.split('=');\n if (option === '--extra') {\n result.extra = result.extra ?? [];\n result.extra.push(value);\n } else if (option === '--extra-index-url') {\n result.extraIndexUrl = result.extraIndexUrl ?? [];\n result.extraIndexUrl.push(value);\n // TODO: add to secrets? next PR\n } else if (['--constraint', '--constraints'].includes(option)) {\n result.constraintsFiles = result.constraintsFiles ?? [];\n result.constraintsFiles.push(value);\n } else if (option === '--output-file') {\n if (result.outputFile) {\n throw new Error('Cannot use multiple --output-file options');\n }\n result.outputFile = upath.normalize(value);\n } else if (option === '--python-version') {\n result.pythonVersion = value;\n } else if (option === '--index-url') {\n if (result.indexUrl) {\n throw new Error('Cannot use multiple --index-url options');\n }\n result.indexUrl = value;\n // TODO: add to secrets? next PR\n } else {\n logger.debug({ option }, `pip-compile: option not handled`);\n }\n continue;\n }\n if (arg === '--no-emit-index-url') {\n result.noEmitIndexUrl = true;\n continue;\n }\n if (arg === '--emit-index-url') {\n result.emitIndexUrl = true;\n continue;\n }\n if (arg === '--all-extras') {\n result.allExtras = true;\n continue;\n }\n\n logger.debug({ option: arg }, `pip-compile: option not handled`);\n }\n logger.trace(\n {\n ...result,\n },\n 'Parsed pip-compile command from header',\n );\n if (result.noEmitIndexUrl && result.emitIndexUrl) {\n throw new Error('Cannot use both --no-emit-index-url and --emit-index-url');\n }\n if (result.sourceFiles.length === 0) {\n throw new Error(\n 'No source files detected in command, pass at least one package file explicitly',\n );\n }\n return result;\n}\n\nconst pythonVersionRegex = regEx(\n /^(#.*?\\r?\\n)*# This file is autogenerated by pip-compile with Python (?<pythonVersion>\\d+(\\.\\d+)*)\\s/,\n 'i',\n);\n\nexport function extractPythonVersion(\n content: string,\n fileName: string,\n): string | undefined {\n const match = pythonVersionRegex.exec(content);\n if (match?.groups === undefined) {\n logger.warn(\n { fileName, content },\n 'pip-compile: failed to extract Python version from header in file',\n );\n return undefined;\n }\n logger.trace(\n `pip-compile: found Python version header in ${fileName}: \\n${match[0]}`,\n );\n const { pythonVersion } = match.groups;\n logger.debug(\n { fileName, pythonVersion },\n `pip-compile: extracted Python version from header`,\n );\n return pythonVersion;\n}\n\nfunction throwForDisallowedOption(arg: string): void {\n if (disallowedPipOptions.includes(arg)) {\n throw new Error(`Option ${arg} not allowed for this manager`);\n }\n}\nfunction throwForNoEqualSignInOptionWithArgument(arg: string): void {\n if (optionsWithArguments.includes(arg)) {\n throw new Error(\n `Option ${arg} must have equal sign '=' separating it's argument`,\n );\n }\n}\nfunction throwForUnknownOption(commandType: CommandType, arg: string): void {\n if (arg.includes('=')) {\n const [option] = arg.split('=');\n if (allowedOptions[commandType].includes(option)) {\n return;\n }\n }\n if (allowedOptions[commandType].includes(arg)) {\n return;\n }\n throw new Error(`Option ${arg} not supported (yet)`);\n}\n\nfunction getRegistryCredEnvVars(\n url: URL,\n index: number,\n): Record<string, string> {\n const hostRule = hostRules.find({ url: url.href });\n logger.debug(hostRule, `Found host rule for url ${url.href}`);\n const ret: Record<string, string> = {};\n if (!!hostRule.username || !!hostRule.password) {\n ret[`KEYRING_SERVICE_NAME_${index}`] = url.hostname;\n ret[`KEYRING_SERVICE_USERNAME_${index}`] = hostRule.username ?? '';\n ret[`KEYRING_SERVICE_PASSWORD_${index}`] = hostRule.password ?? '';\n }\n return ret;\n}\n\nfunction cleanUrl(url: string): URL | null {\n try {\n // Strip everything but protocol, host, and port\n const urlObj = new URL(url);\n return new URL(urlObj.origin);\n } catch {\n return null;\n }\n}\n\nexport function getRegistryCredVarsFromPackageFiles(\n packageFiles: PackageFileContent[],\n): ExtraEnv<string> {\n const urls: string[] = [];\n for (const packageFile of packageFiles) {\n urls.push(\n ...(packageFile.registryUrls ?? []),\n ...(packageFile.additionalRegistryUrls ?? []),\n );\n }\n logger.debug(urls, 'Extracted registry URLs from package files');\n\n const uniqueHosts = new Set<URL>(\n urls.map(cleanUrl).filter(isNotNullOrUndefined),\n );\n\n let allCreds: ExtraEnv<string> = {};\n for (const [index, host] of [...uniqueHosts].entries()) {\n const hostCreds = getRegistryCredEnvVars(host, index);\n allCreds = {\n ...allCreds,\n ...hostCreds,\n };\n }\n\n return allCreds;\n}\n\nexport function matchManager(filename: string): SupportedManagers | 'unknown' {\n if (filename.endsWith('setup.py')) {\n return 'pip_setup';\n }\n if (filename.endsWith('setup.cfg')) {\n return 'setup-cfg';\n }\n if (filename.endsWith('pyproject.toml')) {\n return 'pep621';\n }\n // naive, could be improved, maybe use pip_requirements.fileMatch\n if (filename.endsWith('.in') || filename.endsWith('.txt')) {\n return 'pip_requirements';\n }\n return 'unknown';\n}\n"]}
|
@@ -58,7 +58,6 @@ async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileCon
|
|
58
58
|
const execOptions = {
|
59
59
|
cwdFile: '.',
|
60
60
|
docker: {},
|
61
|
-
userConfiguredEnv: config.env,
|
62
61
|
toolConstraints: [
|
63
62
|
{ toolName: 'python', constraint: config.constraints?.python },
|
64
63
|
{ toolName: 'hashin', constraint: config.constraints?.hashin },
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip_requirements/artifacts.ts"],"names":[],"mappings":";;AAoCA,
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip_requirements/artifacts.ts"],"names":[],"mappings":";;AAoCA,0CA0EC;;AA9GD,kEAAkC;AAClC,iCAA8B;AAC9B,sEAAoE;AACpE,4CAAyC;AACzC,6CAA0C;AAE1C,yCAAiE;AACjE,+CAA0D;AAE1D,uCAA0C;AAE1C;;;;;;;;;;GAUG;AACH,SAAS,wBAAwB,CAAC,OAAe;IAC/C,MAAM,cAAc,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;IAE7C,8FAA8F;IAC9F,oEAAoE;IACpE,EAAE;IACF,uEAAuE;IACvE,8DAA8D;IAC9D,OAAO,IAAA,aAAK,EACV,yBAAy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port { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport { ensureCacheDir, readLocalFile } from '../../../util/fs';\nimport { escapeRegExp, regEx } from '../../../util/regex';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { extrasPattern } from './extract';\n\n/**\n * Create a RegExp that matches the first dependency pattern for\n * the named dependency that is followed by package hashes.\n *\n * The regular expression defines a single named group `depConstraint`\n * that holds the dependency constraint without the hash specifiers.\n * The substring matched by this named group will start with the dependency\n * name and end with a non-whitespace character.\n *\n * @param depName the name of the dependency\n */\nfunction dependencyAndHashPattern(depName: string): RegExp {\n const escapedDepName = escapeRegExp(depName);\n\n // extrasPattern covers any whitespace between the dep name and the optional extras specifier,\n // but it does not cover any whitespace in front of the equal signs.\n //\n // Use a non-greedy wildcard for the range pattern; otherwise, we would\n // include all but the last hash specifier into depConstraint.\n return regEx(\n `^\\\\s*(?<depConstraint>${escapedDepName}${extrasPattern}\\\\s*==.*?\\\\S)\\\\s+--hash=`,\n 'm',\n );\n}\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pip_requirements.updateArtifacts(${packageFileName})`);\n if (!is.nonEmptyArray(updatedDeps)) {\n logger.debug('No updated pip_requirements deps - returning null');\n return null;\n }\n try {\n const cmd: string[] = [];\n const rewrittenContent = newPackageFileContent.replace(regEx(/\\\\\\n/g), '');\n for (const dep of updatedDeps) {\n if (!dep.depName) {\n continue;\n }\n const depAndHashMatch = dependencyAndHashPattern(dep.depName).exec(\n rewrittenContent,\n );\n if (depAndHashMatch) {\n // If there's a match, then the regular expression guarantees\n // that the named subgroup deepConstraint did match as well.\n const depConstraint = depAndHashMatch.groups!.depConstraint;\n cmd.push(`hashin ${quote(depConstraint)} -r ${quote(packageFileName)}`);\n }\n }\n if (!cmd.length) {\n logger.debug('No hashin commands to run - returning');\n return null;\n }\n const execOptions: ExecOptions = {\n cwdFile: '.',\n docker: {},\n toolConstraints: [\n { toolName: 'python', constraint: config.constraints?.python },\n { toolName: 'hashin', constraint: config.constraints?.hashin },\n ],\n extraEnv: {\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n },\n };\n await exec(cmd, execOptions);\n const newContent = await readLocalFile(packageFileName, 'utf8');\n if (newContent === newPackageFileContent) {\n logger.debug(`${packageFileName} is unchanged`);\n return null;\n }\n logger.debug(`Returning updated ${packageFileName}`);\n return [\n {\n file: {\n type: 'addition',\n path: packageFileName,\n contents: newContent,\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 ${packageFileName} file`);\n return [\n {\n artifactError: {\n lockFile: packageFileName,\n stderr: `${String(err.stdout)}\\n${String(err.stderr)}`,\n },\n },\n ];\n }\n}\n"]}
|
@@ -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,0CA+EC;;AA3MD,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,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C,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,qBAAqB,CAAC,CAAC;QAC7C,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 userConfiguredEnv: config.env,\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":";;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;QAEnD,OAAO,IAAA,iBAAI,EAAC,EAAE,QAAQ,EAAE,qBAAc,CAAC,EAAE,E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M,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"]}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { UpdateArtifact, UpdateArtifactsResult } from '../types';
|
2
|
+
export declare const commandLock = "pixi lock --no-progress --color=never --quiet";
|
3
|
+
export declare function updateArtifacts({ packageFileName, updatedDeps, newPackageFileContent, config, }: UpdateArtifact): Promise<UpdateArtifactsResult[] | null>;
|
@@ -0,0 +1,84 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.commandLock = void 0;
|
4
|
+
exports.updateArtifacts = updateArtifacts;
|
5
|
+
const tslib_1 = require("tslib");
|
6
|
+
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
|
7
|
+
const error_messages_1 = require("../../../constants/error-messages");
|
8
|
+
const logger_1 = require("../../../logger");
|
9
|
+
const exec_1 = require("../../../util/exec");
|
10
|
+
const fs_1 = require("../../../util/fs");
|
11
|
+
const result_1 = require("../../../util/result");
|
12
|
+
const lockfile_1 = require("./lockfile");
|
13
|
+
const schema_1 = require("./schema");
|
14
|
+
exports.commandLock = 'pixi lock --no-progress --color=never --quiet';
|
15
|
+
async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileContent, config, }) {
|
16
|
+
logger_1.logger.debug(`pixi.updateArtifacts(${packageFileName})`);
|
17
|
+
const { isLockFileMaintenance } = config;
|
18
|
+
if (!is_1.default.nonEmptyArray(updatedDeps) && !isLockFileMaintenance) {
|
19
|
+
logger_1.logger.debug('No updated pixi deps - returning null');
|
20
|
+
return null;
|
21
|
+
}
|
22
|
+
const lockFileName = (0, fs_1.getSiblingFileName)(packageFileName, 'pixi.lock');
|
23
|
+
const existingLockFileContent = await (0, fs_1.readLocalFile)(lockFileName, 'utf8');
|
24
|
+
if (!existingLockFileContent) {
|
25
|
+
logger_1.logger.debug(`No lock file found`);
|
26
|
+
return null;
|
27
|
+
}
|
28
|
+
logger_1.logger.trace(`Updating ${lockFileName}`);
|
29
|
+
const cmd = [exports.commandLock];
|
30
|
+
const constraint = config.constraints?.pixi ?? getPixiConstraint(existingLockFileContent);
|
31
|
+
try {
|
32
|
+
await (0, fs_1.writeLocalFile)(packageFileName, newPackageFileContent);
|
33
|
+
if (isLockFileMaintenance) {
|
34
|
+
await (0, fs_1.deleteLocalFile)(lockFileName);
|
35
|
+
}
|
36
|
+
// https://pixi.sh/latest/features/environment/#caching-packages
|
37
|
+
const PIXI_CACHE_DIR = await (0, fs_1.ensureCacheDir)('pixi');
|
38
|
+
const extraEnv = {
|
39
|
+
PIXI_CACHE_DIR,
|
40
|
+
RATTLER_CACHE_DIR: PIXI_CACHE_DIR,
|
41
|
+
};
|
42
|
+
const execOptions = {
|
43
|
+
cwdFile: packageFileName,
|
44
|
+
extraEnv,
|
45
|
+
docker: {},
|
46
|
+
toolConstraints: [{ toolName: 'pixi', constraint }],
|
47
|
+
};
|
48
|
+
await (0, exec_1.exec)(cmd, execOptions);
|
49
|
+
const newPixiLockContent = await (0, fs_1.readLocalFile)(lockFileName, 'utf8');
|
50
|
+
if (existingLockFileContent === newPixiLockContent) {
|
51
|
+
logger_1.logger.debug(`${lockFileName} is unchanged`);
|
52
|
+
return null;
|
53
|
+
}
|
54
|
+
return [
|
55
|
+
{
|
56
|
+
file: {
|
57
|
+
type: 'addition',
|
58
|
+
path: lockFileName,
|
59
|
+
contents: newPixiLockContent,
|
60
|
+
},
|
61
|
+
},
|
62
|
+
];
|
63
|
+
}
|
64
|
+
catch (err) {
|
65
|
+
if (err.message === error_messages_1.TEMPORARY_ERROR) {
|
66
|
+
throw err;
|
67
|
+
}
|
68
|
+
logger_1.logger.debug({ err }, `Failed to update ${lockFileName} file`);
|
69
|
+
return [
|
70
|
+
{
|
71
|
+
artifactError: {
|
72
|
+
lockFile: lockFileName,
|
73
|
+
stderr: `${err}\n${String(err.stdout)}\n${String(err.stderr)}`,
|
74
|
+
},
|
75
|
+
},
|
76
|
+
];
|
77
|
+
}
|
78
|
+
}
|
79
|
+
function getPixiConstraint(existingLockFileContent) {
|
80
|
+
const { val } = result_1.Result.parse(existingLockFileContent, schema_1.LockfileYaml).unwrap();
|
81
|
+
const cfg = (0, lockfile_1.pickConfig)(val?.version);
|
82
|
+
return cfg?.range ?? undefined;
|
83
|
+
}
|
84
|
+
//# sourceMappingURL=artifacts.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/artifacts.ts"],"names":[],"mappings":";;;AAmBA,0CA4EC;;AA/FD,kEAAkC;AAClC,sEAAoE;AACpE,4CAAyC;AACzC,6CAA0C;AAE1C,yCAM0B;AAC1B,iDAA8C;AAE9C,yCAAwC;AACxC,qCAAwC;AAE3B,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,YAAE,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7D,eAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,YAAY,GAAG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AI,CAAC;QACd,CAAC;QACD,OAAO;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,kBAAkB;iBAC7B;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,CAAC,OAAO,KAAK,gCAAe,EAAE,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QAED,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,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;iBAC/D;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CACxB,uBAA+B;IAE/B,MAAM,EAAE,GAAG,EAAE,GAAG,eAAM,CAAC,KAAK,CAAC,uBAAuB,EAAE,qBAAY,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7E,MAAM,GAAG,GAAG,IAAA,qBAAU,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAErC,OAAO,GAAG,EAAE,KAAK,IAAI,SAAS,CAAC;AACjC,CAAC","sourcesContent":["import is 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 { Result } from '../../../util/result';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { pickConfig } from './lockfile';\nimport { LockfileYaml } from './schema';\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 (!is.nonEmptyArray(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 constraint =\n config.constraints?.pixi ?? getPixiConstraint(existingLockFileContent);\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${String(err.stdout)}\\n${String(err.stderr)}`,\n },\n },\n ];\n }\n}\n\nfunction getPixiConstraint(\n existingLockFileContent: string,\n): string | undefined {\n const { val } = Result.parse(existingLockFileContent, LockfileYaml).unwrap();\n const cfg = pickConfig(val?.version);\n\n return cfg?.range ?? undefined;\n}\n"]}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.extractPackageFile = extractPackageFile;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const logger_1 = require("../../../logger");
|
6
|
+
const fs_1 = require("../../../util/fs");
|
7
|
+
const result_1 = require("../../../util/result");
|
8
|
+
const schema_utils_1 = require("../../../util/schema-utils");
|
9
|
+
const schema_1 = require("../pep621/schema");
|
10
|
+
const schema_2 = require("./schema");
|
11
|
+
const PyProjectToml = schema_utils_1.Toml.pipe(schema_1.PyProjectSchema);
|
12
|
+
function getUserPixiConfig(content, packageFile) {
|
13
|
+
if (packageFile === 'pyproject.toml' ||
|
14
|
+
packageFile.endsWith('/pyproject.toml')) {
|
15
|
+
const { val, err } = result_1.Result.parse(content, PyProjectToml).unwrap();
|
16
|
+
if (err) {
|
17
|
+
logger_1.logger.debug({ packageFile, err }, `error parsing ${packageFile}`);
|
18
|
+
return null;
|
19
|
+
}
|
20
|
+
return val.tool?.pixi ?? null;
|
21
|
+
}
|
22
|
+
if (packageFile === 'pixi.toml' || packageFile.endsWith('/pixi.toml')) {
|
23
|
+
const { val, err } = result_1.Result.parse(content, schema_2.PixiToml).unwrap();
|
24
|
+
if (err) {
|
25
|
+
logger_1.logger.debug({ packageFile, err }, `error parsing ${packageFile}`);
|
26
|
+
return null;
|
27
|
+
}
|
28
|
+
return val;
|
29
|
+
}
|
30
|
+
const { val, err } = result_1.Result.parse(content, zod_1.z.union([schema_2.PixiToml, PyProjectToml.transform((p) => p.tool?.pixi)])).unwrap();
|
31
|
+
if (err) {
|
32
|
+
logger_1.logger.debug({ packageFile, err }, `error parsing ${packageFile}`);
|
33
|
+
return null;
|
34
|
+
}
|
35
|
+
return val ?? null;
|
36
|
+
}
|
37
|
+
async function extractPackageFile(content, packageFile) {
|
38
|
+
logger_1.logger.trace(`pixi.extractPackageFile(${packageFile})`);
|
39
|
+
const config = getUserPixiConfig(content, packageFile);
|
40
|
+
if (!config) {
|
41
|
+
return null;
|
42
|
+
}
|
43
|
+
const lockfileName = (0, fs_1.getSiblingFileName)(packageFile, 'pixi.lock');
|
44
|
+
const lockFiles = [];
|
45
|
+
if (await (0, fs_1.localPathExists)(lockfileName)) {
|
46
|
+
lockFiles.push(lockfileName);
|
47
|
+
}
|
48
|
+
return {
|
49
|
+
lockFiles,
|
50
|
+
deps: [],
|
51
|
+
};
|
52
|
+
}
|
53
|
+
//# sourceMappingURL=extract.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/extract.ts"],"names":[],"mappings":";;AAkDA,gDAqBC;AAvED,6BAAwB;AACxB,4CAAyC;AACzC,yCAAuE;AACvE,iDAA8C;AAC9C,6DAAkD;AAClD,6CAAmD;AAEnD,qCAAqD;AAErD,MAAM,aAAa,GAAG,mBAAI,CAAC,IAAI,CAAC,wBAAe,CAAC,CAAC;AAEjD,SAAS,iBAAiB,CACxB,OAAe,EACf,WAAmB;IAEnB,IACE,WAAW,KAAK,gBAAgB;QAChC,WAAW,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EACvC,CAAC;QACD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,eAAM,CAAC,KAAK,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,MAAM,EAAE,CAAC;QACnE,IAAI,GAAG,EAAE,CAAC;YACR,eAAM,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,iBAAiB,WAAW,EAAE,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,GAAG,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC;IAChC,CAAC;IAED,IAAI,WAAW,KAAK,WAAW,IAAI,WAAW,CAAC,QAAQ,C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EAAE,CAAC;QACxC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO;QACL,SAAS;QACT,IAAI,EAAE,EAAE;KACT,CAAC;AACJ,CAAC","sourcesContent":["import { z } from 'zod';\nimport { logger } from '../../../logger';\nimport { getSiblingFileName, localPathExists } from '../../../util/fs';\nimport { Result } from '../../../util/result';\nimport { Toml } from '../../../util/schema-utils';\nimport { PyProjectSchema } from '../pep621/schema';\nimport type { PackageFileContent } from '../types';\nimport { type PixiConfig, PixiToml } from './schema';\n\nconst PyProjectToml = Toml.pipe(PyProjectSchema);\n\nfunction 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, PyProjectToml).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, PixiToml).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([PixiToml, PyProjectToml.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 config = getUserPixiConfig(content, packageFile);\n if (!config) {\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 return {\n lockFiles,\n deps: [],\n };\n}\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Category } from '../../../constants';
|
2
|
+
export { bumpPackageVersion } from '../pep621/update';
|
3
|
+
export { extractPackageFile } from './extract';
|
4
|
+
export { updateArtifacts } from './artifacts';
|
5
|
+
export declare const supportsLockFileMaintenance = true;
|
6
|
+
export declare const url = "https://github.com/prefix-dev/pixi/";
|
7
|
+
export declare const categories: Category[];
|
8
|
+
export declare const defaultConfig: {
|
9
|
+
fileMatch: string[];
|
10
|
+
};
|
11
|
+
export declare const supportedDatasources: string[];
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.supportedDatasources = exports.defaultConfig = exports.categories = exports.url = exports.supportsLockFileMaintenance = exports.updateArtifacts = exports.extractPackageFile = exports.bumpPackageVersion = void 0;
|
4
|
+
const conda_1 = require("../../datasource/conda");
|
5
|
+
const pypi_1 = require("../../datasource/pypi");
|
6
|
+
var update_1 = require("../pep621/update");
|
7
|
+
Object.defineProperty(exports, "bumpPackageVersion", { enumerable: true, get: function () { return update_1.bumpPackageVersion; } });
|
8
|
+
var extract_1 = require("./extract");
|
9
|
+
Object.defineProperty(exports, "extractPackageFile", { enumerable: true, get: function () { return extract_1.extractPackageFile; } });
|
10
|
+
var artifacts_1 = require("./artifacts");
|
11
|
+
Object.defineProperty(exports, "updateArtifacts", { enumerable: true, get: function () { return artifacts_1.updateArtifacts; } });
|
12
|
+
exports.supportsLockFileMaintenance = true;
|
13
|
+
exports.url = 'https://github.com/prefix-dev/pixi/';
|
14
|
+
exports.categories = ['python'];
|
15
|
+
exports.defaultConfig = {
|
16
|
+
fileMatch: [
|
17
|
+
'(^|/)pyproject\\.toml$', // `tool.pixi` section
|
18
|
+
'(^|/)pixi\\.toml$', // root object
|
19
|
+
],
|
20
|
+
};
|
21
|
+
exports.supportedDatasources = [pypi_1.PypiDatasource.id, conda_1.CondaDatasource.id];
|
22
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/index.ts"],"names":[],"mappings":";;;AACA,kDAAyD;AACzD,gDAAuD;AAEvD,2CAAsD;AAA7C,4GAAA,kBAAkB,OAAA;AAC3B,qCAA+C;AAAtC,6GAAA,kBAAkB,OAAA;AAC3B,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AAEX,QAAA,2BAA2B,GAAG,IAAI,CAAC;AAEnC,QAAA,GAAG,GAAG,qCAAqC,CAAC;AAC5C,QAAA,UAAU,GAAe,CAAC,QAAQ,CAAC,CAAC;AAEpC,QAAA,aAAa,GAAG;IAC3B,SAAS,EAAE;QACT,wBAAwB,EAAE,sBAAsB;QAChD,mBAAmB,EAAE,cAAc;KACpC;CACF,CAAC;AAEW,QAAA,oBAAoB,GAAG,CAAC,qBAAc,CAAC,EAAE,EAAE,uBAAe,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import type { Category } from '../../../constants';\nimport { CondaDatasource } from '../../datasource/conda';\nimport { PypiDatasource } from '../../datasource/pypi';\n\nexport { bumpPackageVersion } from '../pep621/update';\nexport { extractPackageFile } from './extract';\nexport { updateArtifacts } from './artifacts';\n\nexport const supportsLockFileMaintenance = true;\n\nexport const url = 'https://github.com/prefix-dev/pixi/';\nexport const categories: Category[] = ['python'];\n\nexport const defaultConfig = {\n fileMatch: [\n '(^|/)pyproject\\\\.toml$', // `tool.pixi` section\n '(^|/)pixi\\\\.toml$', // root object\n ],\n};\n\nexport const supportedDatasources = [PypiDatasource.id, CondaDatasource.id];\n"]}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.pickConfig = pickConfig;
|
4
|
+
/**
|
5
|
+
* There is no way to know which version we should pick based on `pixi.toml` and `pixi.lock`
|
6
|
+
* so we need to maintain a mapping from pixi version and it's generated lock file version.
|
7
|
+
*
|
8
|
+
* it should support lock version < 6 but old version of pixi doesn't release the binary we need, so just skip them and support only lock file version >=6
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
const pixiGenerateLockFileVersion = [
|
12
|
+
{ lockVersion: 6, range: '>=0.39.2, <0.43.0' },
|
13
|
+
];
|
14
|
+
function pickConfig(lockVersion) {
|
15
|
+
if (!lockVersion) {
|
16
|
+
return null;
|
17
|
+
}
|
18
|
+
for (const pixi of pixiGenerateLockFileVersion) {
|
19
|
+
if (lockVersion === pixi.lockVersion) {
|
20
|
+
return pixi;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
return null;
|
24
|
+
}
|
25
|
+
//# sourceMappingURL=lockfile.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"lockfile.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/lockfile.ts"],"names":[],"mappings":";;AAgBA,gCAYC;AA5BD;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAa;IAC5C,EAAE,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE;CACtC,CAAC;AAOX,SAAgB,UAAU,CAAC,WAAoB;IAC7C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,2BAA2B,EAAE,CAAC;QAC/C,IAAI,WAAW,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * There is no way to know which version we should pick based on `pixi.toml` and `pixi.lock`\n * so we need to maintain a mapping from pixi version and it's generated lock file version.\n *\n * it should support lock version < 6 but old version of pixi doesn't release the binary we need, so just skip them and support only lock file version >=6\n *\n */\nconst pixiGenerateLockFileVersion: Config[] = [\n { lockVersion: 6, range: '>=0.39.2, <0.43.0' },\n] as const;\n\ninterface Config {\n lockVersion: number;\n range: string;\n}\n\nexport function pickConfig(lockVersion?: number): Config | null {\n if (!lockVersion) {\n return null;\n }\n\n for (const pixi of pixiGenerateLockFileVersion) {\n if (lockVersion === pixi.lockVersion) {\n return pixi;\n }\n }\n\n return null;\n}\n"]}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
/**
|
3
|
+
* config of `pixi.toml` of `tool.pixi` of `pyproject.toml`
|
4
|
+
*/
|
5
|
+
export declare const PixiConfigSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
6
|
+
export type PixiConfig = z.infer<typeof PixiConfigSchema>;
|
7
|
+
export declare const PixiToml: z.ZodPipeline<z.ZodEffects<z.ZodString, unknown, string>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
8
|
+
export declare const LockfileYaml: z.ZodPipeline<z.ZodEffects<z.ZodString, string | number | boolean | import("type-fest").JsonObject | import("type-fest").JsonValue[] | readonly import("type-fest").JsonValue[] | null, string>, z.ZodObject<{
|
9
|
+
version: z.ZodNumber;
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
11
|
+
version: number;
|
12
|
+
}, {
|
13
|
+
version: number;
|
14
|
+
}>>;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.LockfileYaml = exports.PixiToml = exports.PixiConfigSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const schema_utils_1 = require("../../../util/schema-utils");
|
6
|
+
/**
|
7
|
+
* config of `pixi.toml` of `tool.pixi` of `pyproject.toml`
|
8
|
+
*/
|
9
|
+
exports.PixiConfigSchema = zod_1.z.object({});
|
10
|
+
exports.PixiToml = schema_utils_1.Toml.pipe(exports.PixiConfigSchema);
|
11
|
+
exports.LockfileYaml = schema_utils_1.Yaml.pipe(zod_1.z.object({
|
12
|
+
version: zod_1.z.number(),
|
13
|
+
}));
|
14
|
+
//# sourceMappingURL=schema.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,6DAAwD;AAExD;;GAEG;AACU,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAIhC,QAAA,QAAQ,GAAG,mBAAI,CAAC,IAAI,CAAC,wBAAgB,CAAC,CAAC;AAEvC,QAAA,YAAY,GAAG,mBAAI,CAAC,IAAI,CACnC,OAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport { Toml, Yaml } from '../../../util/schema-utils';\n\n/**\n * config of `pixi.toml` of `tool.pixi` of `pyproject.toml`\n */\nexport const PixiConfigSchema = z.object({});\n\nexport type PixiConfig = z.infer<typeof PixiConfigSchema>;\n\nexport const PixiToml = Toml.pipe(PixiConfigSchema);\n\nexport const LockfileYaml = Yaml.pipe(\n z.object({\n version: z.number(),\n }),\n);\n"]}
|
@@ -21,7 +21,7 @@ const util_1 = require("../../datasource/util");
|
|
21
21
|
const schema_1 = require("./schema");
|
22
22
|
function getPythonConstraint(pyProjectContent, existingLockFileContent) {
|
23
23
|
// Read Python version from `pyproject.toml` first as it could have been updated
|
24
|
-
const pyprojectPythonConstraint = result_1.Result.parse(pyProjectContent, schema_1.PoetrySchemaToml.transform(({ packageFileContent }) => packageFileContent.deps.find((dep) => dep.depName === 'python')
|
24
|
+
const pyprojectPythonConstraint = result_1.Result.parse((0, toml_1.massage)(pyProjectContent), schema_1.PoetrySchemaToml.transform(({ packageFileContent }) => packageFileContent.deps.find((dep) => dep.depName === 'python')
|
25
25
|
?.currentValue)).unwrapOrNull();
|
26
26
|
if (pyprojectPythonConstraint) {
|
27
27
|
logger_1.logger.debug('Using python version from pyproject.toml');
|
@@ -48,7 +48,7 @@ function getPoetryRequirement(pyProjectContent, existingLockFileContent) {
|
|
48
48
|
logger_1.logger.debug(`Using poetry version ${lockfilePoetryConstraint} from poetry.lock metadata`);
|
49
49
|
return lockfilePoetryConstraint;
|
50
50
|
}
|
51
|
-
const { val: pyprojectPoetryConstraint } = result_1.Result.parse(pyProjectContent, schema_1.PoetrySchemaToml.transform(({ poetryRequirement }) => poetryRequirement)).unwrap();
|
51
|
+
const { val: pyprojectPoetryConstraint } = result_1.Result.parse((0, toml_1.massage)(pyProjectContent), schema_1.PoetrySchemaToml.transform(({ poetryRequirement }) => poetryRequirement)).unwrap();
|
52
52
|
if (pyprojectPoetryConstraint) {
|
53
53
|
logger_1.logger.debug(`Using poetry version ${pyprojectPoetryConstraint} from pyproject.toml`);
|
54
54
|
return pyprojectPoetryConstraint;
|
@@ -58,7 +58,7 @@ function getPoetryRequirement(pyProjectContent, existingLockFileContent) {
|
|
58
58
|
function getPoetrySources(content, fileName) {
|
59
59
|
let pyprojectFile;
|
60
60
|
try {
|
61
|
-
pyprojectFile = (0, toml_1.parse)(content);
|
61
|
+
pyprojectFile = (0, toml_1.parse)((0, toml_1.massage)(content));
|
62
62
|
}
|
63
63
|
catch (err) {
|
64
64
|
logger_1.logger.debug({ err }, 'Error parsing pyproject.toml file');
|
@@ -163,7 +163,6 @@ async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileCon
|
|
163
163
|
cwdFile: packageFileName,
|
164
164
|
extraEnv,
|
165
165
|
docker: {},
|
166
|
-
userConfiguredEnv: config.env,
|
167
166
|
toolConstraints: [
|
168
167
|
{ toolName: 'python', constraint: pythonConstraint },
|
169
168
|
{ toolName: 'poetry', constraint: poetryConstraint },
|