-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
area/codegenAffects quality or correctness of generated codeAffects quality or correctness of generated codekind/bugSome behavior is incorrect or out of specSome behavior is incorrect or out of specresolution/fixedThis issue was fixedThis issue was fixed
Description
What happened?
When I use crd2pulumi generate a python package, the resulting pyproject.toml has a [project.depenedencies] entry that references a nonexistent "pulumi-kubernetes4.18.0" package:
$ grep dependencies pyproject.toml
dependencies = ["parver>=0.2.1", "pulumi>=3.109.0,<4.0.0", "pulumi-kubernetes4.18.0", "requests>=2.21,<3.0", "semver>=2.8.1", "typing-extensions>=4.11; python_version < \"3.11\""]
Example
I can reproduce this on main (f670a71 at time of writing).
$ go run main.go --pythonPath ./crontabs tests/crds/k8sversion/mock_crd.yaml --force
Successfully generated python code.
$ grep dependencies crontabs/pyproject.toml
dependencies = ["parver>=0.2.1", "pulumi>=3.109.0,<4.0.0", "pulumi-kubernetes4.18.0", "requests>=2.21,<3.0", "semver>=2.8.1", "typing-extensions>=4.11; python_version < \"3.11\""]
Output of pulumi about
N/A
Additional context
I dug into this, and believe the issue is the interaction between these 2 lines of code:
- Here is where pulumi-kubernetes adds the Python dependency: https://github.com/pulumi/pulumi-kubernetes/blob/v4.18.1/provider/pkg/gen/schema.go#L661
- I believe this the bug: it probably should be giving a version specifier (something like
>= x.y.zor== x.y.z) rather than a plain version.
- I believe this the bug: it probably should be giving a version specifier (something like
- Here's where the pulumi's codegen code concatenates the package name and the version specifier: https://github.com/pulumi/pulumi/blob/v3.132.0/pkg/codegen/python/gen.go#L3382. Note that there's no separator between the package name and the version specifier.
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/codegenAffects quality or correctness of generated codeAffects quality or correctness of generated codekind/bugSome behavior is incorrect or out of specSome behavior is incorrect or out of specresolution/fixedThis issue was fixedThis issue was fixed