-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
lazily load Pkg #4955
lazily load Pkg #4955
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4955 +/- ##
==========================================
- Coverage 89.77% 89.68% -0.09%
==========================================
Files 40 40
Lines 8780 8801 +21
==========================================
+ Hits 7882 7893 +11
- Misses 898 908 +10 ☔ View full report in Codecov by Sentry. |
Not sure if we even need to depend on pkg given v2 and PlotsBase https://github.com/JuliaPlots/Plots.jl/tree/v2/PlotsBase |
PlotsBase does the same: Plots.jl/PlotsBase/src/backends.jl Line 45 in f32247a
But with extensions the compat should be enforced and maybe this code is not needed, or? |
I dont think this function is needed at all now Plots.jl/PlotsBase/src/backends.jl Line 27 in f32247a
but lets wait for @BeastyBlacksmith to confirm |
Thats true, that code can go in |
It is easy to read the project file of the package and extract the version. I just didn't remember when |
(Looking forward to v2 which seems to have a great design avoiding these type of "hacks") |
This is a bit of a hack to work around the fact that depending on Pkg is quite expensive in 1.11. Here, we only load it when checking the compatibility / install status of a backend and also skipping that when the backend is GR.jl (since we know that is compatible due to resolving together with Plots).
I'll admit this is kind of ugly and a bit of "TTFP hacking". However, I don't think Plots.jl should depend on a package manager at all so 🤷.
TTFP change 2.1s to 1.7s