# Define package by url and branch in Project.toml

**URL:** https://discourse.julialang.org/t/define-package-by-url-and-branch-in-project-toml/104810
**Category:** Package Management
**Created:** [October 10, 2023, 4:45pm UTC](https://discourse.julialang.org/t/define-package-by-url-and-branch-in-project-toml/104810 "2023-10-10T16:45:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![brucala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brucala/32/14229_2.png) [@brucala](https://discourse.julialang.org/u/brucala)
#### Post date: [October 10, 2023, 4:45pm UTC](https://discourse.julialang.org/t/define-package-by-url-and-branch-in-project-toml/104810/1 "2023-10-10T16:45:42Z")

</div>

I’m wondering if it’s possible to defined a package in the `Project.toml` file by its github url and branch.

In my environment I can do `pkg> add https://github.com/pathto/MyPackage.jl#mybranch`, but only the `Manifest.toml` gets updated with the relevant package url/branch information, and not the `Project.toml`. From the [Pkg.jl docs](https://pkgdocs.julialang.org/v1/) I don’t see any indication that this is possible, but I would like to make sure that I haven’t missed anything in the docs (or anything not documented)?

If this isn’t possible, my next question is: what’s the right approach to add dependencies on packages by url/branch. I mean, should we push the `Manifest.toml` to the git repo? From several threads (e.g. [this](https://discourse.julialang.org/t/does-manifest-toml-belong-in-the-repository/12029) and [this](https://discourse.julialang.org/t/putting-manifest-toml-in-git/94144)) I understand that this is generally discouraged. Is this particular situation an example were pushing the `Manifest.toml` is the only solution? The problem I find with that is that I have troubles with the CI if I push the `Manifest.toml`.

I’ll illustrate the reason for all these question with my real problem.

[Deneb.jl](https://github.com/brucala/Deneb.jl) dependes on [DemoCards.jl](https://github.com/JuliaDocs/DemoCards.jl) to build its docs. I’ve recently open a [PR](https://github.com/JuliaDocs/DemoCards.jl/pull/157) to DemoCards.jl with an update that I would like to bring to Deneb.jl’s docs. Before waiting for the PR to be merged and a version tag created, I would like Deneb.jl to already make use of the proposed update. I attempted this by pushing a `Manifest.jl` file that points to DemoCards.jl version that i forked to create the PR (see the pushed manifest [here](https://github.com/brucala/Deneb.jl/blob/8eff03b0d069f071e5a833a3b350ba3950ed20f0/docs/Manifest.toml#L146-152)). This works well locally (the environment builds correctly and I can produce the desired docs), but makes the Documentation CI action to [fail in the dependency installation step](https://github.com/brucala/Deneb.jl/actions/runs/6448448523/job/17505722061).

Any light on this problem would be appreciated.

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [October 10, 2023, 6:45pm UTC](https://discourse.julialang.org/t/define-package-by-url-and-branch-in-project-toml/104810/2 "2023-10-10T18:45:33Z")

</div>

[JuliaLang/Pkg.jl#492](https://github.com/JuliaLang/Pkg.jl/issues/492) has some discussion.

---

<div class="post-metadata">

### Author: ![brucala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brucala/32/14229_2.png) [@brucala](https://discourse.julialang.org/u/brucala)
#### Post date: [October 11, 2023, 8:58am UTC](https://discourse.julialang.org/t/define-package-by-url-and-branch-in-project-toml/104810/3 "2023-10-11T08:58:08Z")

</div>

@fredrikekre Thanks for the pointer, it looks like this is a most wanted issue!

There is also a proposed solution on [this PR](https://github.com/JuliaLang/Pkg.jl/pull/3263) by @quinnj from almost a year ago. But I don’t see any discussion since April this year. Does anyone know what’s the status of that PR? any reason not to push it forward?

---

<div class="post-metadata">

### Author: ![brucala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brucala/32/14229_2.png) [@brucala](https://discourse.julialang.org/u/brucala)
#### Post date: [October 11, 2023, 9:02am UTC](https://discourse.julialang.org/t/define-package-by-url-and-branch-in-project-toml/104810/4 "2023-10-11T09:02:18Z")

</div>

BTW, the solution to my problem was fixed by adding `Pkg.add(url="https://github.com/brucala/DemoCards.jl", rev="transitiongrid-theme")` in the [docs CI workflow](https://github.com/brucala/Deneb.jl/commit/e278c800a35c2c742b1d11a7ee7b099a0fed86a1).

Sounds a bit hackish. Hope the [PR](https://github.com/JuliaLang/Pkg.jl/pull/3263) mentioned above gets merged sometime.
