Open zong-zhe opened 7 months ago
@Peefy please assign me this issue
@AkashKumar7902 Thank you for the contribution. ❤️
Hey @zong-zhe @Peefy I'd like to work on this issue, but I see there's still ongoing work. If any tasks are left to be completed, please let me know so I can move forward with this issue.
Hello @vinayakjaas
This is an unfinished feature, I assigned it to you, good luck! ❤️
@vinayakjaas, can you please pass this issue to me? I saw that you are working on another issue, and I have already worked with Git dependencies in one of my PRs.
Hey @Manoramsharma I started planning to work on this issue , but if you want to take over and move forward with it, that's okay no problem at all.
Thanks @vinayakjaas I already have a draft PR in mind that would possibly solve this issue .
I would like get this assigned @Peefy
Hi @Gmin2 I think your changes in pkg/package/toml.go
and pkg/package/modfile.go
were not required as this would not have solved the parsing of version
to dependencies struct from the corresponding mod files. Rather directly setting it as a a value here sourceWithoutBrace += fmt.Sprintf(
, version = "%s", dep.Version)
which is not an ideal approach.
This issue comes from the preceding https://github.com/kcl-lang/kpm/issues/190 The content in the above issue https://github.com/kcl-lang/kpm/issues/190 is outdated, so add some more detail to this issue.
Related PR: https://github.com/kcl-lang/kpm/pull/254
Context
KPM currently supports adding third-party dependencies from git repositories as dependencies, mainly supporting through tags or commits from the git repository.
You can use command as below to add a kcl package from git repo
Then you will see the below content added in
kcl.mod
or
You can use command as below to add a kcl package from git repo
Then you will see the below content added in
kcl.mod
Referring to the implementation of Cargo in Rust, we hope to support adding dependencies from git repositories with the
version
of kcl package.Feature
If you add a dependency using the following command,
Then the following content will appear in your
kcl.mod
file, because theversion
field in thekcl.mod
of the KCL package corresponding to commita29e3db
is0.1.1
.If you add a dependency using the following command,
Then the following content will appear in your
kcl.mod
file, because theversion
field in thekcl.mod
of the KCL package corresponding to tag0.0.2
is0.1.1
.If you manually write the
kcl.mod
file as follows,But the
version
field in thekcl.mod
of the KCL package corresponding to tag0.0.3
is0.0.1
, i.e., version0.1.1
does not exist in the KCL package with tag0.0.3
. Then, during the process of compiling or updating KCL third-party libraries that trigger the re-download of third-party libraries, an error should be thrown to notify the user that this third-party library with version0.1.1
does not exist in the repo with tag0.0.3
.