# Freeze versions for a specific project

**URL:** <https://discourse.julialang.org/t/freeze-versions-for-a-specific-project/27074>\
**Category:** General Usage\
**Tags:** question, pkg\
**Created:** [August 1, 2019, 9:49am UTC](https://discourse.julialang.org/t/freeze-versions-for-a-specific-project/27074 "2019-08-01T09:49:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [August 1, 2019, 9:49am UTC](https://discourse.julialang.org/t/freeze-versions-for-a-specific-project/27074/1 "2019-08-01T09:49:00Z")

</div>

Say I have a project, it has its `Project.toml` and `Manifest.toml` files. Everything works right now. How can I freeze/pin the versions of everything this project uses so that whenever I use this project in the future it will work? So while my environment marches on and updates everything in its stack, whenever I use that specific project, it will only use the (now) old versions that work. And then at some point in the future I might decide to upgrade this project and release those restrictions.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [August 1, 2019, 9:56am UTC](https://discourse.julialang.org/t/freeze-versions-for-a-specific-project/27074/2 "2019-08-01T09:56:25Z")

</div>

Just don’t update the project’s environment? The Manifest.toml already nails down all packages and their versions. Just make sure that you aren’t implicitly using packages from an environment that’s deeper in your LOAD\_PATH (like the default environment v1.1)

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [August 1, 2019, 10:55am UTC](https://discourse.julialang.org/t/freeze-versions-for-a-specific-project/27074/3 "2019-08-01T10:55:17Z")

</div>

Yes, and be sure to check in both the Project and Manifest files to version control. I’ve also used `git tag` to mark where I have a known working environment in case I later accidentally `] up`. That way, you can keep developing other parts of the project, but you can always go back and grab a copy of those files and reinstantiate the environment of something goes wrong.

---

<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:** [August 1, 2019, 11:07am UTC](https://discourse.julialang.org/t/freeze-versions-for-a-specific-project/27074/4 "2019-08-01T11:07:45Z")

</div>

> [@kevbonham](#):
>
> check in both the Project and Manifest files to version control.

My only concern about checking in the `Manifest.toml` is that my understanding is that it would make CI run in the exact same environment all the time. In other words, I don’t catch errors from mistaken assumptions about other packages (eg insufficiently narrow version bounds) and similar.

Of course I can always do a `Pkg.API.up()` I guess, but I am not sure where it goes in the `.travis.yml`.

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [August 1, 2019, 11:26am UTC](https://discourse.julialang.org/t/freeze-versions-for-a-specific-project/27074/5 "2019-08-01T11:26:58Z")

</div>

> [@carstenbauer](#):
>
> Just don’t update the project’s environment?

So this means that if I do **not** `julia --project` in the package’s repo and then `]up` then that package will stay fixed in that sense. And therefore all my own (local and githubed) packages are not affected when I update my default environment (i.e. do a ` (v1.1) pkg> up`). So if I wanted to update them all I’d need to go into each and everyone of them and update them manually (which is a good thing).

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [August 1, 2019, 1:09pm UTC](https://discourse.julialang.org/t/freeze-versions-for-a-specific-project/27074/6 "2019-08-01T13:09:30Z")

</div>

> [@Tamas\_Papp](#):
>
> My only concern about checking in the `Manifest.toml` is that my understanding is that it would make CI run in the exact same environment all the time

Do you not have a test-specific environment? If you have a `Manifest.toml` in `MyPackage`, and then your test environment does `using MyPackage, Test` the `Manifest.toml` in `MyPackage` doesn’t get consulted - what matters is the `test/Project.toml` (and if you had it, the `test/Manifest.toml`, though I don’t think that’s necessary).

Though now that I’m writing this, I don’t know what happens if you do `] test MyPackage` locally - I would have thought it’s the same, but Stefan has said that the reason to include the `Manifest.toml` in the first place is that it guarantees you have at least one tested environment that works, so…

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [August 1, 2019, 1:24pm UTC](https://discourse.julialang.org/t/freeze-versions-for-a-specific-project/27074/7 "2019-08-01T13:24:31Z")

</div>

Correct, if you do not explicitly `] up` in the project’s environment the toml files will stay as they are, forever. The project’s environment is completely independent from the default environment.
