-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
Update warnings and announcements #176
Comments
Or, more generally, some mechanism for packages to query and save mutable metadata (ie a state) somewhere. Mock code: using TerminalMenus
if !Pkg3.getmeta("DiffEqBase", "DISABLED_UPDATE_WARNING")
print("warning")
if request("do you want to disable this warning in the future?",
RadioMenu(["disable", "keep"])) == 1
Pkg3.setmeta("DiffEqBase", "DISABLED_UPDATE_WARNING", true)
end
end Pkg3 itself uses environment variables for something similar. These are fine, but can easily proliferate if a lot of packages need something like this. |
Do you want this metatada to be stored even if the package is deleted? Otherwise, you can just touch a file and look for the presence of it https://github.com/JuliaCI/PkgBenchmark.jl/blob/master/deps/build.jl. |
Oh wow. That seems like a much better approach! |
(remember to add the file to |
It would be great if the solution above could end up as a suggestion in the documentation when that is written, so maybe this issue could be kept open as a reminder. |
Since we currently redirect the build log to an output file the workaround described above is no longer effective. |
Oh no, seemed like an awesome idea. Do you have any alternative suggestions? |
You could do almost the same thing but instead when loading the package for the first time. |
I think this can be done by touching a file in the repo and look for the existence of that file and else print the message. This would also show it when you use it instead of when things are building and you are unlikely to pay attention. |
Thanks, seems like a plan! I will soon test it and report here how it went. |
@KristofferC I did this, and it worked like a charm. The update is displayed only once. For reference, this is what I have inside my main
However, there is something I don't understand. Where is this file being created? To my understanding it should be at the directory where the package is installed, no? Yet when I go to this directory, I can't seem to find the file:
I wanted to delete it to re-test the update message, but I can't find it :D |
Hm, turns it I am not sure whether it worked. I did some changes to my file, but I did not change the file's name. When |
Since you used |
You are correct. It should be in the So the update message just got displayed again after re-compilation. The file though is not in the main folder, not in the Could it be that edit: |
damn I am such a huge moron... look at the code I pasted. I do |
DiffEq has been using a hack by @Datseris to display an announcement in the DiffEq repos.
https://github.com/JuliaDiffEq/DiffEqBase.jl/blob/master/deps/build.jl
While it works, it's quite hacked on so there's issues like SciML/DiffEqBase.jl#94 , but I am wondering if there could be a better way to do announcements than "follow the entire repo" that are built into Pkg3. I for one would love to know about all releases of dependencies for example.
The text was updated successfully, but these errors were encountered: