# Upgrading a package to v1.0 and developping

**URL:** <https://discourse.julialang.org/t/upgrading-a-package-to-v1-0-and-developping/17371>\
**Category:** New to Julia\
**Created:** [November 9, 2018, 11:00pm UTC](https://discourse.julialang.org/t/upgrading-a-package-to-v1-0-and-developping/17371 "2018-11-09T23:00:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [November 9, 2018, 11:00pm UTC](https://discourse.julialang.org/t/upgrading-a-package-to-v1-0-and-developping/17371/1 "2018-11-09T23:00:55Z")

</div>

Hi,

I would like to first apologize because despite reading some posts on discourse and in the docs, I am quite confused about how I should do the following:

1. upgrade my package [PDMP.jl](https://github.com/rveltz/PDMP.jl) to Julia 1.0 and register it
2. develop it on my computer. It is located at `~/work/prog_gd/julia/dev/PDMP.jl` (I named it `dev` during julia v0.5, it has nothing to do with my `~/.julia/dev` )

My problem for 1. is that I have none of the files Project.toml… What is the easiest way to do this. It seems `] dev https://github.com/rveltz/PDMP.jl` will not do it. I am not sure I should start from scratch like `(v1.0) pkg> generate PDMP` and add the files as I would lose the git history (eg located in `~/work/prog_gd/julia/dev/PDMP.jl`).

My problem for 2. is the lack of understanding. I have a feeling that I should do `] dev PDMP` once 1. is solved but I am not sure. Also, I would prefer to work in `~/work/prog_gd/julia/dev/PDMP.jl` if possible.

Hopefully, I am not the only one concerned by these questions.

Thank you for your help,

---

<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:** [November 10, 2018, 12:11am UTC](https://discourse.julialang.org/t/upgrading-a-package-to-v1-0-and-developping/17371/2 "2018-11-10T00:11:25Z")

</div>

1. You can do `(v1.0) pkg> generate PDMP` and copy over the `Project.toml` file to the already existing project. Just make sure the existing project contains this subtree

```julia
├── Project.toml
└── src
    └── PDMP.jl

```

At this point, your project will be a valid Pkg project. The rest of the process is more documented.
2. To develop the project: activate it and add dependencies:
  - `(v1.0) pkg> activate ~/work/prog_gd/julia/dev/PDMP.jl`
  - `(PDMP) pkg> add Dep1 Dep2 ...`

3. Now you can develop your project; just make sure your project stays activated. In other words: as long as the Pkg prompt is `(PDMP) pkg>` you will be able to do `julia> import PDMP`.

* * *

Conceptually:

1. Step 1 gets you to a valid project directory in a slightly hacky way (there is an [open PR](https://github.com/JuliaLang/Pkg.jl/pull/889).)
2. Pkg is based on environments. You point Pkg at the environment you want to use by using `activate`. You specify the packages which should be available in that environment by using `add`.
3. Once you set up your environment, you can develop normally. You can load any dependency declared in your `Project.toml` file with `using`/`import`.

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [November 10, 2018, 12:39am UTC](https://discourse.julialang.org/t/upgrading-a-package-to-v1-0-and-developping/17371/3 "2018-11-10T00:39:56Z")

</div>

This works: `] dev ~/work/prog_gd/julia/dev/PDMP.jl`

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [November 10, 2018, 8:04am UTC](https://discourse.julialang.org/t/upgrading-a-package-to-v1-0-and-developping/17371/4 "2018-11-10T08:04:14Z")

</div>

Thank you for your detailed explanation!

├── Project.toml └── src └── PDMP.jl  
[/quote]

you mean:

```julia
├── Project.toml
└── src
            └── PDMP.jl

```

?

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [November 10, 2018, 8:30am UTC](https://discourse.julialang.org/t/upgrading-a-package-to-v1-0-and-developping/17371/5 "2018-11-10T08:30:59Z")

</div>

Thank you for 1. It works for me. You did notn mention the way to register it though.

---

<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:** [November 11, 2018, 7:47am UTC](https://discourse.julialang.org/t/upgrading-a-package-to-v1-0-and-developping/17371/6 "2018-11-11T07:47:59Z")

</div>

> [@rveltz](#):
>
> register

> **[GitHub - attobot/attobot: Julia package release bot](https://github.com/attobot/attobot)**
>
> Julia package release bot. Contribute to attobot/attobot development by creating an account on GitHub.

---

<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:** [November 14, 2018, 2:22am UTC](https://discourse.julialang.org/t/upgrading-a-package-to-v1-0-and-developping/17371/7 "2018-11-14T02:22:05Z")

</div>

Yup, that’s what I meant. Fixed
