# How to pin package to the master version?

**URL:** <https://discourse.julialang.org/t/how-to-pin-package-to-the-master-version/29480>\
**Category:** New to Julia\
**Created:** [October 4, 2019, 10:46am UTC](https://discourse.julialang.org/t/how-to-pin-package-to-the-master-version/29480 "2019-10-04T10:46:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Post date:** [October 4, 2019, 10:46am UTC](https://discourse.julialang.org/t/how-to-pin-package-to-the-master-version/29480/1 "2019-10-04T10:46:01Z")

</div>

How to pin package to the master version? I need this for Travis testing.

---

<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:** [October 4, 2019, 11:26am UTC](https://discourse.julialang.org/t/how-to-pin-package-to-the-master-version/29480/2 "2019-10-04T11:26:47Z")

</div>

Add a `Pkg.add` to the test script.

---

<div class="post-metadata">

**Author:** ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Post date:** [October 4, 2019, 11:43am UTC](https://discourse.julialang.org/t/how-to-pin-package-to-the-master-version/29480/3 "2019-10-04T11:43:03Z")

</div>

Yes, thank you. Here is what I try now (in `.travis.yml`):

```julia
before_script:
  - julia -e 'using Pkg; Pkg.pin(PackageSpec(name="CxxWrap",version="0.8.1")); pkg"add Materials#master"; pkg"add FEMMaterials#master"'

```

---

<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:** [October 4, 2019, 12:38pm UTC](https://discourse.julialang.org/t/how-to-pin-package-to-the-master-version/29480/4 "2019-10-04T12:38:40Z")

</div>

This should work. But if your package really depends on a specific version of another, you could say so in `[compat]`.

As for depending on `master`, that is not something that can be enforced in `[compat]` AFAIK, so perhaps the long run solution is making a release for those packages. (Note that I fully understand that these workarounds can be necessary, but they should be interim).
