-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
If Pkg.dir()
is deprecated, what is its replacement?
#417
Comments
FWIW, here's what I used previously: tkluck/StatProfilerHTML.jl@df697a1 I thought |
Use relative paths (with e.g. |
This function has been deprecated in Pkg3. See here for the discussion: JuliaLang/Pkg.jl#417 This reverts commit df697a1.
Thanks @KristofferC! I just pushed tkluck/StatProfilerHTML.jl@6eb9335 by your recommendation.
Is that a necessary limitation for this function? Couldn't |
It was a limitation with the old function, but it could indeed support showing the actual location (and that is actually what the deprecation sneakily uses). JuliaLang/julia#27592 should be relevant. |
Another use case I had for cd(Pkg.dir("somepkg", "test")) so that I could step through a Is there a suggested replacement for this? |
Until JuliaLang/julia#27592 is fixed you can use something like
But what package julia will load is completely independent of the package manager which is why I feel this should maybe be a Base API. |
For most uses I recommend trying to rewrite the code to use |
Not opening another issue, but I am not sure how to determine where the coverage files ended up after a Pkg.test("SomePkg"; coverage = true) using the official API. |
For Coverage submission on CI? You don't need the |
No, for LocalCoverage.jl. I want to know where the files are so I can run I think this is a reasonable use case. Coverage may be run outside CI, and one may want to know where the output is for processing. |
Also, if there is no immediate fix, please reopen the issue or let me know if I should create another one. |
Why can't you load it? You can also use |
Another option is to change your API, and make it |
My understanding is that it would be a global side-effect, which I would want to avoid in a function.
A comment above suggests that it may not be the right solution, did that change? In any case, I think my issue boils down to the following: |
That is pretty much #624. We could have something like |
I thought of reworking the API of LocalCoverage.jl to use the active project instead (if any), but I am not sure how to hook into that either. I could proceed from |
Thanks. Is there a way to query if the result of |
If it has a Could probably do it like
|
The function
Pkg.dir()
gives the following warning:which I think means that it is deprecated. I currently use it to pass the right library environment to a non-julia subprocess (source). What's the best way to get the same result?
I'll be happy to submit a pull request to document the alternative, hopefully in the warning itself.
The text was updated successfully, but these errors were encountered: