# Versioning with Pkg

**URL:** <https://discourse.julialang.org/t/versioning-with-pkg/32604>\
**Category:** New to Julia\
**Tags:** pkg\
**Created:** [December 23, 2019, 5:55am UTC](https://discourse.julialang.org/t/versioning-with-pkg/32604 "2019-12-23T05:55:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfioravanti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dfioravanti/32/11750_2.png) [@dfioravanti](https://discourse.julialang.org/u/dfioravanti)\
**Post date:** [December 23, 2019, 5:55am UTC](https://discourse.julialang.org/t/versioning-with-pkg/32604/1 "2019-12-23T05:55:46Z")

</div>

Hi everyone,

I wanted to help with the development of a Julia package. To do so I wanted to use `Pkg.dev(Package)` command but it does not work. I think that the reason is that the authors of that package append `-DEV` to the version in their `Project.toml` to avoid Pkg to update the package every time they push a change on master.

I was wondering, in general, what is is the correct way to deal with the update problem while still been able to use Pkg. Does Pkg implicitly assume that master is never broken and that it should be possible to constantly update every change?

Moreover, where can I find a reference for this things? I looked in to the documentation but I could not find anything that really clarified my mind.

thanks a lot in advance.

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [December 23, 2019, 6:19am UTC](https://discourse.julialang.org/t/versioning-with-pkg/32604/2 "2019-12-23T06:19:35Z")

</div>

> To do so I wanted to use `Pkg.dev(Package)` command but it does not work.

what specific behavior leads you to believe it does not work?

> I was wondering, in general, what is is the correct way to deal with the update problem while still been able to use Pkg.

I’m not clear on what the “update problem” is. `Pkg.develop` will never change the files of the directory it is tracking (aside from possibly the initial download). If you want to update the files at that directory, you have to change them manually.

what are you trying to get Pkg to do? or what behavior did you expect but did not see?

---

<div class="post-metadata">

**Author:** ![dfioravanti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dfioravanti/32/11750_2.png) [@dfioravanti](https://discourse.julialang.org/u/dfioravanti)\
**Post date:** [December 23, 2019, 6:33am UTC](https://discourse.julialang.org/t/versioning-with-pkg/32604/3 "2019-12-23T06:33:57Z")

</div>

Basically, I want to use `Pkg.dev` to copy the current version of LanguageServer.jl from github but it crashes with the following error

```julia
 CSTParser [00ebfdb7] log:
 ├─possible versions are: [0.4.0-0.4.1, 0.5.0-0.5.2, 0.6.0-0.6.2, 1.0.0, 1.1.0-1.1.1, 2.0.0] or uninstalled
 ├─restricted to versions 2 by LanguageServer [2b0e0bc5], leaving only versions 2.0.0
 │ └─LanguageServer [2b0e0bc5] log:
 │ ├─possible versions are: 1.1.0 or uninstalled
 │ └─LanguageServer [2b0e0bc5] is fixed to version 1.1.0-DEV
 └─restricted to versions 1.1.1 by an explicit requirement — no versions left

```

If read the message correctly the problem here is that `-DEV` in the versioning, right?

I assume that the reason why that -DEV is there to avoid Pkg to interpret any change in master as an update the package. I was wondering if there is a better or more canonical way to achieve the same result.

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [December 23, 2019, 8:08am UTC](https://discourse.julialang.org/t/versioning-with-pkg/32604/4 "2019-12-23T08:08:26Z")

</div>

> If read the message correctly the problem here is that `-DEV` in the versioning, right?

No, the problem is that you have `CSTParser` as a direct dependency (in your project file) so Pkg is refusing to change the version.

This should work:

```julia
pkg> rm CSTParser; dev LanguageServer; add CSTParser

```

---

<div class="post-metadata">

**Author:** ![dfioravanti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dfioravanti/32/11750_2.png) [@dfioravanti](https://discourse.julialang.org/u/dfioravanti)\
**Post date:** [December 23, 2019, 1:24pm UTC](https://discourse.julialang.org/t/versioning-with-pkg/32604/5 "2019-12-23T13:24:32Z")

</div>

Thanks now it works. I am still a bit confused about how Pkg works. I will read up more about it.

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [December 23, 2019, 5:48pm UTC](https://discourse.julialang.org/t/versioning-with-pkg/32604/6 "2019-12-23T17:48:56Z")

</div>

Very welcome.

Pkg has been adjusted to be more flexible in 1.4. It will automatically find the correct solution:

```julia
julia> Pkg.develop("LanguageServer")
Path `/home/david/.julia/dev/LanguageServer` exists and looks like the correct package. Using existing path.
 Resolving package versions...
  Updating `/tmp/foobizzle/Project.toml`
  [00ebfdb7] ↑ CSTParser v1.1.1 ⇒ v2.0.0
  [2b0e0bc5] + LanguageServer v1.1.0-DEV [`~/.julia/dev/LanguageServer`]
  Updating `/tmp/foobizzle/Manifest.toml`
  [00ebfdb7] ↑ CSTParser v1.1.1 ⇒ v2.0.0
  [ffa9a821] + DocumentFormat v1.1.1
  [48062228] + FilePathsBase v0.7.0
  [682c06a0] + JSON v0.21.0
  [2b0e0bc5] + LanguageServer v1.1.0-DEV [`~/.julia/dev/LanguageServer`]
  [69de0a69] + Parsers v0.3.10
  [b3cc710f] + StaticLint v3.0.0
...

```

---

<div class="post-metadata">

**Author:** ![dfioravanti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dfioravanti/32/11750_2.png) [@dfioravanti](https://discourse.julialang.org/u/dfioravanti)\
**Post date:** [December 24, 2019, 11:23am UTC](https://discourse.julialang.org/t/versioning-with-pkg/32604/7 "2019-12-24T11:23:39Z")

</div>

Ah cool, I will keep an eye out for the new version. Thanks.
