-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can you add a dependency with hyphens to a kcl package #141
Comments
cc @zong-zhe |
Hi @ma-ble 😄 Thanks for your feedback and help us find the omissions in the documentation work. I have explained this problem through PR kcl-lang/kcl-lang.io#389. I hope it will be helpful |
Thank you very much for the answer and the adjustment of the documentation.
pkgpath crossplane_provider_helm.v1alpha1 not found in the program(CannotFindModule). Cannot find the module crossplane_provider_helm.v1alpha1 from /Users/USERNAME/test/kcl/examples/test/crossplane_provider_helm/v1alpha1 not found in the program. For AWS and Azure it also took a little longer until the error messages disappeared.
I use vscode as an IDE and I have the extension installed. Can you force the conversion of the modules (hyphens to underscores)? |
Hi @ma-ble 😄 You can try to upgrade the KCL version to the 0.9.0 prefix using command |
I think I know the problem. Its because of the module dependencies. All three modules "crossplane-provider-aws, crossplane-provider-azure, crossplane-provider-helm" need the module k8s. Modul dependencies are not installed automatically and there is no automatic reuse if the module already exists on the computer. |
@ma-ble Thanks very much for your feedback, which helped us find some problems and will be very helpful for the future of KCL. Let me provide you with some more detailed information. 😄 It is known that in version Suppose you also encounter an error in the IDE that you cannot find the dependencies. In that case, you can try to compile using the command You can try the two ways I mentioned above to upgrade kcl version in your local.
or use the scripts here: https://www.kcl-lang.io/docs/user_docs/getting-started/install#using-script-to-install-the-latest-release When downloading KCL's dependencies, KCL will give priority to checking whether a dependency already exists locally each time. If it does exist, it will recursively look for indirect dependencies. If it does not exist, it will re-download and reload indirect dependencies. |
After updating to the 0.9.0 , 'kcl run' works as expected, and the dependencies are working. When you install further dependencies without a specific version, the first
When you run the command |
Closed by kcl-lang/kcl-lang.io#389 |
General Question
I would like to add the model "crossplane-provider-aws" to my package as a dependency so that I can get validation in my IDE.
When I try to import the package,
I get an error saying that hyphens are not allowed in imports.
If I manually rename the folder in the download directory (/User/xxx/.kcl/kpm) - with underscores instead of hyphens - the import works as expected.
However, that certainly won't be the normal way, right?
The text was updated successfully, but these errors were encountered: