# Keeping local Manifest.toml's up to date

**URL:** https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694
**Category:** General Usage
**Tags:** question, pkg, manifest
**Created:** [July 14, 2025, 8:38am UTC](https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694 "2025-07-14T08:38:48Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [July 14, 2025, 8:38am UTC](https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694/1 "2025-07-14T08:38:48Z")

</div>

Generally, I do not commit `Manifest.toml`, `docs/Manifest.toml` and `test/Manifest.toml` (where applicable) to git repositories for _packages_.

However, as a result, sometimes these become out of date for local clones of packages repos. I can of course always update them manually, but I am wondering if there is a semi-automated solution that would at least give a warning about them being outdated whenever I activate any of these projects.

(Bonus question: should `docs/` and `test/` projects `] dev ..`?)

---

<div class="post-metadata">

### Author: ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)
#### Post date: [July 14, 2025, 8:55am UTC](https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694/2 "2025-07-14T08:55:13Z")

</div>

At least for the docs, I do update them when running the `make.jl`. I do not yet do a separate `test/` manifest.

Concerning the bonus question, instead of a `dev` I switched to providing the parent folder as a source for the package.

> <https://github.com/JuliaManifolds/Manopt.jl/blob/f3adc77aa35976278a31f6465607add9d423e0e3/docs/Project.toml#L49-L50>

---

<div class="post-metadata">

### Author: ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)
#### Post date: [July 14, 2025, 9:54am UTC](https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694/3 "2025-07-14T09:54:02Z")

</div>

> [@Tamas\_Papp](#):
>
> (Bonus question: should `docs/` and `test/` projects `] dev ..`?)

Nowadays I use

```julia
[sources]
MainPackage = {path = ".."}

```

in my Project.toml files for both `docs/` and `test/`. This makes docs CI simpler (no need to add the package) and works as long as you build your docs on 1.11. It doesn’t matter for `] test MainPackage` so CI tests work also for older juila versions. It is very convenient for cases where you `] activate MainPackage/test` (which is the environment I have activated 99% of the time when developing `MainPackage`).

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [July 14, 2025, 1:16pm UTC](https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694/4 "2025-07-14T13:16:17Z")

</div>

> [@kellertuer](#):
>
> instead of a `dev` I switched to providing the parent folder as a source for the package

Great idea! It appears that in 1.12 dev automatically does that.

I am now experimenting with the following `pre-commit` git hook:

```bash
#!/bin/bash
if [[-n "$CI"]]; then
   echo "In CI, skipping updates."
   exit 0
fi
if [`git rev-parse --is-bare-repository` == "true"]; then
   echo "In bare repository, skipping updates."
   exit 0
fi
JULIA=`which julia`
if [-z "$JULIA"]; then
   echo "Julia executable not found, skipping updates."
   exit 1
fi
cat <<"EOF" | $JULIA --startup-file=no -q
import Pkg
let # wrap to minimize clutter printed
    function maybe_update_project(dir;
                                  old_manifest_days = 10)
        isfile(joinpath(dir, "Project.toml")) || return
        manifest = joinpath(dir, "Manifest.toml")
        isfile(manifest) && (time() - stat(manifest).mtime) < (60*60*24*old_manifest_days) && return
        Pkg.activate(dir)
        Pkg.update()
    end
    maybe_update_project(".")
    maybe_update_project("test/")
    maybe_update_project("docs/")
    nothing
end
EOF

```

It only updates every 10 days. Firing up a Julia process has a tiny cost, but I prefer to script in Julia.

---

<div class="post-metadata">

### Author: ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)
#### Post date: [July 14, 2025, 2:13pm UTC](https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694/5 "2025-07-14T14:13:16Z")

</div>

This doesn’t exactly warn about outdated manifests, or even remove the need for “manual” updating, but I would recommend that all projects [include a `Makefile` for dev-tasks](https://github.com/goerz/cookiecutter-juliapackage/blob/master/%7B%7Bcookiecutter.project_name%7D%7D/Makefile).

I use `make distclean` to remove all `Manifest.toml` files in the project:

> <https://github.com/goerz/cookiecutter-juliapackage/blob/64f4ed5819339adde36865f182bc8e33d64b99ea/%7B%7Bcookiecutter.project_name%7D%7D/Makefile#L56-L59>

I’m in the habit of typing `make distclean` on a somewhat regular basis, e.g., after switching between non-trivial branches or before making releases.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [July 14, 2025, 5:10pm UTC](https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694/6 "2025-07-14T17:10:22Z")

</div>

[Here](https://gist.github.com/tpapp/88d9b5c3f284fb97a891c0cc49bafa40) is an updated script that does the testing in Bash.

(Disclaimer: I am not very good at programming Bash. Suggestions welcome.)

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [July 17, 2025, 12:09pm UTC](https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694/7 "2025-07-17T12:09:25Z")

</div>

> [@kellertuer](#):
>
> instead of a `dev` I switched to providing the parent folder as a source for the package.

I think that is the ideal solution, but my understanding is that `[sources]` requires 1.12 (unreleased yet):

> <https://github.com/JuliaLang/Pkg.jl/pull/3783>
>
> Extracted and tweaked based on https://github.com/JuliaLang/Pkg.jl/pull/3263.
> 
> …
> Currently requires https://github.com/JuliaLang/julia/pull/53233
> 
> Some questions:
> 
> \- What happens if you have a source for a URL and then you \`add\` the package with another URL? Error or update the source?
> \- Same as above but with a \`path\`.
> \- What should \`free\` do when there is a source specified.
> 
> TODO:
> \- \[\] Docs
> \- \[\] More thorough tests
> \- \[x\] Verify parsing of source section in project file
> \- \[x\] remove source in \`free\` (\`update\_package\_free\`)
> \- \[x\] update source on \`add\` (\`update\_package\_add\`)
> \- \[x\] remove source in \`rm\`
> \- \[x\] Test when \`resolve\` with non source in manifest and source in project.

The discussion was enlightening for me, this feature specifically includes this use case.

---

<div class="post-metadata">

### Author: ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)
#### Post date: [July 17, 2025, 3:03pm UTC](https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694/8 "2025-07-17T15:03:29Z")

</div>

I can not confirm your understanding, since it also already works just fine (locally and on CI) with Julia 1.11.

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [July 18, 2025, 5:46am UTC](https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694/9 "2025-07-18T05:46:32Z")

</div>

> [@Tamas\_Papp](#):
>
> I think that is the ideal solution, but my understanding is that `[sources]` requires 1.12

It’s a 1.11 feature: [Julia 1.11 Highlights](https://julialang.org/blog/2024/10/julia-1.11-highlights/#sources_section_in_projecttoml_in_pkgjl)

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [July 18, 2025, 7:50am UTC](https://discourse.julialang.org/t/keeping-local-manifest-tomls-up-to-date/130694/10 "2025-07-18T07:50:05Z")

</div>

Thanks for the corrections, indeed it is in the [1.11 news](https://github.com/JuliaLang/julia/blob/release-1.11/NEWS.md#package-manager).
