Skip to content
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

Automatically change compat entries on Pkg.update #4092

Open
fonsp opened this issue Nov 19, 2024 · 3 comments
Open

Automatically change compat entries on Pkg.update #4092

fonsp opened this issue Nov 19, 2024 · 3 comments

Comments

@fonsp
Copy link
Member

fonsp commented Nov 19, 2024

#3732 automatically adds compat entries when you add a package (to a named environment). The compat entry looks like:

[compat]
Example = "1.2.3"

My proposal is that compat entries should be changed automatically when you Pkg.update(). E.g. when you update to 1.3.0, the Project.toml should change to:

[compat]
Example = "1.3.0"

I believe that the same reasoning behind #3732 applies to the update situation.

(This same behaviour also happens in yarn and npm, where the install adds ^1.2.3 to the package.json, and upgrade changes it to ^1.3.0.)

@jakobnissen
Copy link
Contributor

But then, if the author did check it was compatible with Example 1.2.3, wouldn't it be annoying that the compat was incorrectly changed?

@KristofferC
Copy link
Member

This doesn't make sense to me? Why would you want to claim incompatible with previous versions just because you do an update?

@fonsp
Copy link
Member Author

fonsp commented Nov 20, 2024

Thanks for the comments! To me it makes sense as a default, because update changes the version your are developing and testing with, and you might start depending on new functionality that was added in a minor update.

So as a "safe" default, 1.3.0 seems better after updating. To me it feels like the same argument for using 1.2.3 as the default for add, instead of just 1.

But I also see some practical issues like the one @jakobnissen brought up, where it is useful in the Julia ecosystem for packages to have wide compat ranges and we don't want to override those with stricter ones. npm is different here, since dependencies are not necessarily shared (two packages in one project can import different versions of the same transitive dep), so restricting compat bounds upwards is never really an issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants