# Project management for a julia project

**URL:** <https://discourse.julialang.org/t/project-management-for-a-julia-project/22698>\
**Category:** Tooling\
**Created:** [April 3, 2019, 2:30pm UTC](https://discourse.julialang.org/t/project-management-for-a-julia-project/22698 "2019-04-03T14:30:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sagartewari01](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sagartewari01/32/7810_2.png) [@sagartewari01](https://discourse.julialang.org/u/sagartewari01)\
**Post date:** [April 3, 2019, 2:30pm UTC](https://discourse.julialang.org/t/project-management-for-a-julia-project/22698/1 "2019-04-03T14:30:25Z")

</div>

I wanted to know the correct way to run the tests and benchmarks included in a julia project. Specifically, I’m looking at [this](https://github.com/JuliaCollections/FunctionalCollections.jl) project. It includes some tests and benchmarks, but I can’t find any online resources regarding project management for julia projects.  
Is there something equivalent to `cargo` for julia?

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [April 3, 2019, 7:01pm UTC](https://discourse.julialang.org/t/project-management-for-a-julia-project/22698/2 "2019-04-03T19:01:51Z")

</div>

Package and project management in Julia are provided by the built-in `Pkg` tool. You can read all about Pkg in the manual here: [1. Introduction · Pkg.jl](https://julialang.github.io/Pkg.jl/v1/)

For example, if you want to create a brand-new project, install the FunctionalCollections package within that project, and run its tests, you could do the following:

1. create a new folder and cd into it
2. Start julia, and run:

```julia
(v1.1) pkg> activate .

```

Note that I have pressed the `]` key to switch the prompt from `julia>` to `(v1.1) pkg>` and thus entered “package mode”.

`activate .` tells Julia to use the project in your current directory. There’s nothing there yet, but that’s OK.

Next, you can do:

```julia
(project) pkg> add FunctionalCollections

```

which will do the following:

- Download FunctionalCollections (and its deps)
- Create `Manifest.toml` and `Project.toml` files which describe your current project and its packages

Then you can test the package with:

```julia
(project) pkg> test FunctionalCollections

```

All of this will happen only within your current package environment, so any packages you install here won’t affect any other projects you’re currently working on.

---

<div class="post-metadata">

**Author:** ![sagartewari01](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sagartewari01/32/7810_2.png) [@sagartewari01](https://discourse.julialang.org/u/sagartewari01)\
**Post date:** [April 4, 2019, 8:47am UTC](https://discourse.julialang.org/t/project-management-for-a-julia-project/22698/3 "2019-04-04T08:47:10Z")

</div>

Thanks for reply. What about benchmarks? This project seems to use `Benchmark` package but it appears to be deprecated. The `Pkg.jl` documentation doesn’t say anything about benchmarks. Is the user expected to just setup the `LOAD_PATH` and `include` the respective benchmark sources?

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [April 4, 2019, 10:43am UTC](https://discourse.julialang.org/t/project-management-for-a-julia-project/22698/4 "2019-04-04T10:43:41Z")

</div>

I think you should look at BenchmarkTools [GitHub - JuliaCI/BenchmarkTools.jl: A benchmarking framework for the Julia language](https://github.com/JuliaCI/BenchmarkTools.jl)

Manual here [https://github.com/JuliaCI/BenchmarkTools.jl/blob/master/doc/manual.md](https://github.com/JuliaCI/BenchmarkTools.jl/blob/master/doc/manual.md)

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [April 4, 2019, 10:45am UTC](https://discourse.julialang.org/t/project-management-for-a-julia-project/22698/5 "2019-04-04T10:45:45Z")

</div>

ALso - Sagar, if you are new to Julia we are all really friendly here. Keep on asking question. I do!

---

<div class="post-metadata">

**Author:** ![sagartewari01](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sagartewari01/32/7810_2.png) [@sagartewari01](https://discourse.julialang.org/u/sagartewari01)\
**Post date:** [April 4, 2019, 11:31am UTC](https://discourse.julialang.org/t/project-management-for-a-julia-project/22698/6 "2019-04-04T11:31:58Z")

</div>

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [April 4, 2019, 1:10pm UTC](https://discourse.julialang.org/t/project-management-for-a-julia-project/22698/7 "2019-04-04T13:10:18Z")

</div>

Pkg itself doesn’t know about benchmark suites, but you can at least look up the correct path to the benchmark script. `using FunctionalCollections; pathof(FunctionalCollections)` will give you the path to the source file for that module, so you can automatically include the benchmark file (no matter where the package happens to be installed) with:

```julia
julia> include(joinpath(dirname(pathof(FunctionalCollections)), "..", "benchmark", "bench.jl"))

```

although, as you noted, that particular package happens to rely on the out-dated `Benchmark.jl` package. I’d suggest using `BenchmarkTools.jl` instead, since it’s nicer and actively maintained.
