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

Pkg.project() returns nothing for name, uuid, version for package added via Pkg #3477

Open
NHDaly opened this issue May 15, 2023 · 0 comments
Labels

Comments

@NHDaly
Copy link
Member

NHDaly commented May 15, 2023

This question regards the Pkg.project() feature, originally added in #385.

The package in question here is RAI.jl, which attempts to set its user agent for HTTP requests using the project version:
https://github.com/RelationalAI/rai-sdk-julia/blob/93b18be6d7d91385a0854330b5d3bd0fe28f4653/src/RAI.jl#L25-L26

When I clone this repo, and open it as a project via julia --proj, it works correctly, giving:

julia> using RAI

julia> RAI.PROJECT_VERSION
v"0.2.4"

julia> RAI._user_agent()
"rai-sdk-julia/0.2.4"

However, if I add the package to another project, or to my top-level environment, it gets nothing:

julia> using Pkg

julia> Pkg.add("RAI")

julia> using RAI

julia> RAI._user_agent()
"rai-sdk-julia/nothing"

julia> RAI.PROJECT_VERSION

You can see that this is returning nothing:

julia> @eval RAI Pkg.project()
Pkg.API.ProjectInfo(nothing, nothing, nothing, false, Dict{String, Base.UUID}("PProf" => UUID("e4faabce-9ead-11e9-39d9-4379958e3056"), "MethodAnalysis" => UUID("85b6ec6f-f7df-4429-9514-a64bcd9ee824"), "Memoize" => UUID("c03570c3-d221-55d1-a50c-7939bbd78826"), "Revise" => UUID("295af30f-e4ad-537b-8983-00126c2a3abe"), "BenchmarkTo
ols" => UUID("6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"), "Cthulhu" => UUID("f68482b8-f384-11e8-15f7-abe071a5a75f"), "RAI" => UUID("9c30249a-7e08-11ec-0e99-a323e937e79f"), "LookingGlass" => UUID("1fcbbee2-b350-4a01-aad8-439064dba09e"), "CloudStore" => UUID("3365d9ee-d53b-4a56-812d-5344d5b716d7")), "/Users/nathandaly/.julia/environme
nts/v1.8/Project.toml")

julia> @eval RAI Pkg.project().version

julia>

I see in #3267 that this is an experimental feature.

Should we not be using it like this?

Thank you!

@NHDaly NHDaly added the bug label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant