# Generate Package and Test

**URL:** https://discourse.julialang.org/t/generate-package-and-test/133475
**Category:** General Usage
**Tags:** package
**Created:** [October 28, 2025, 11:29am UTC](https://discourse.julialang.org/t/generate-package-and-test/133475 "2025-10-28T11:29:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![tduretz](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tduretz](https://discourse.julialang.org/u/tduretz)
#### Post date: [October 28, 2025, 11:29am UTC](https://discourse.julialang.org/t/generate-package-and-test/133475/1 "2025-10-28T11:29:20Z")

</div>

In have a question about package generation. Why does `generate` not also automatically generate the `test` folder as well as the necessary `Project.toml` and empty `runtests.jl` file ?  
I find it sometimes not trivial to add a test folder/environment after having generated a package. Or is `generate` not the most standard/recommended way to generate a package, to the favor of [PkgTemplates](https://github.com/invenia/PkgTemplates.jl) ?

---

<div class="post-metadata">

### Author: ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)
#### Post date: [October 28, 2025, 11:34am UTC](https://discourse.julialang.org/t/generate-package-and-test/133475/2 "2025-10-28T11:34:11Z")

</div>

> [@tduretz](#):
>
> Or is `generate` not the most standard/recommended way to generate a package

Indeed, yes. `Pkg.generate` is designed to create a _minimal_ package. This is useful in many contexts, but not for “public” projects that go on GitHub and will be registered. Those should follow additional “best practices”, and should be set up with more dedicated tools like `PkgTemplates`.

---

<div class="post-metadata">

### Author: ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)
#### Post date: [October 28, 2025, 11:57am UTC](https://discourse.julialang.org/t/generate-package-and-test/133475/3 "2025-10-28T11:57:40Z")

</div>

Apart from PkgTemplates.jl mentioned above, there are also following tools to generate packages with bells and whistles:

- PackageMager.jl (mostly a GUI for PkgTemplates.jl)
- PkgSkeleton.jl (an opinionated minimalistic tool)
- BestieTemplate.jl (allows also for modifying existing packages)

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [October 28, 2025, 1:28pm UTC](https://discourse.julialang.org/t/generate-package-and-test/133475/4 "2025-10-28T13:28:52Z")

</div>

For completeness, an example where a minimal `Pkg.generate` is exactly what you want: [Fail more gracefully when precompiling huge data · Issue #59835 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/59835#issuecomment-3405451795)

---

<div class="post-metadata">

### Author: ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)
#### Post date: [October 28, 2025, 5:24pm UTC](https://discourse.julialang.org/t/generate-package-and-test/133475/5 "2025-10-28T17:24:06Z")

</div>

Since we’re throwing all the options out there, I have one as well: [GitHub - goerz/cookiecutter-juliapackage: Cookiecutter Template for Julia Projects](https://github.com/goerz/cookiecutter-juliapackage)

Obviously, aimed at my particular preferences. That’s something I might encourage people to do in any case: take ownership of your templates; invest some time in understanding what you want, and _why_ something should be set up a particular way. A lot of the existing solutions end up having opinions that I find questionable, and then I end up spending significant time “cleaning up” whatever they generated.
