From 949c0e1e81af3658a2098cac7a530dc5d67368cc Mon Sep 17 00:00:00 2001 From: Ben Elkin <8xe8n-cm@online.de> Date: Sat, 28 Jun 2025 15:38:36 +0200 Subject: [PATCH 1/2] Add refs to ShareAdd.jl and PackageMaker.jl --- sharing/index.md | 15 ++++++++++++++- writing/index.md | 10 ++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/sharing/index.md b/sharing/index.md index 57c5fad..2b5accb 100644 --- a/sharing/index.md +++ b/sharing/index.md @@ -48,9 +48,20 @@ t("MyAwesomePackage") ``` Then, you simply need to push this new folder to the remote repository , and you're ready to go. + +The steps described above, including creation of a GitHub repo and pushing your project to it, can also be comfortably done with the help of [PackageMaker.jl](https://github.com/Eben60/PackageMaker.jl), which is a GUI wrap around [PkgTemplates.jl](https://github.com/JuliaCI/PkgTemplates.jl) with a couple features of it's own. + The rest of this post will explain to you what each part of this folder does, and how to bend them to your will. -To work on the package further, we develop it into the current environment and import it: +To work on the package further, we switch to it's environment or "develop" it into the current one, and then import it: + +```julia-repl +julia> using Pkg # remember, you can equivalently do all that from the pkg REPL after pressing ] + +julia> Pkg.activate(path="MyAwesomePackage") +``` + +or ```julia-repl julia> using Pkg @@ -69,6 +80,8 @@ using MyAwesomePackage ``` + + ## GitHub Actions The most useful aspect of PkgTemplates.jl is that it automatically generates workflows for [GitHub Actions](https://docs.github.com/en/actions/quickstart). diff --git a/writing/index.md b/writing/index.md index 88cbfbf..ebf0cdf 100644 --- a/writing/index.md +++ b/writing/index.md @@ -355,8 +355,8 @@ Once in an environment, the packages you `]add` will be listed in two files `som * `Manifest.toml` contains the exact versions of all direct and indirect dependencies If you haven't entered any local project, packages will be installed in the default environment, called `@v1.X` after the active version of Julia (note the `@` before the name). -Packages installed that way are available no matter which local environment is active, because of "environment stacking". -It is therefore recommended to keep the default environment very light, containing only essential development tools. +Packages installed that way are available no matter which local environment is active, because of "environment [stacking](https://docs.julialang.org/en/v1/manual/code-loading/#Environment-stacks)". +It is recommended to keep the default environment very light to avoid dependencies conflicts. It should contain only essential development tools. \vscode{ @@ -380,7 +380,7 @@ Once your code base grows beyond a few scripts, you will want to [create a packa The first advantage is that you don't need to specify the path of every file: `using MyPackage: myfunc` is enough to get access to the names you define. Furthermore, you can specify versions for your package and its dependencies, making your code easier and safer to reuse. -To create a new package locally, the easy way is to use `]generate` (we will discuss a more sophisticated workflow in the next blog post). +To create a new package locally, one easy way is to use `]generate`. We will discuss more sophisticated workflows, including a [GUI tool](https://github.com/Eben60/PackageMaker.jl), in the next blog post. ```>generate-package Pkg.generate(sitepath("MyPackage")); # ignore sitepath @@ -428,7 +428,7 @@ Whenever you edit a source file and hit save, the REPL will update its state acc \vscode{ -The Julia extension imports Revise.jl by default when it starts a REPL. +The Julia extension imports Revise.jl by default when it starts a REPL, provided it is installed in the default environment. } @@ -462,6 +462,8 @@ using MyPackage MyPackage.myfunc() ``` +For the common case of dependencies needed for interactive work only, [shared](https://pkgdocs.julialang.org/v1/environments/#Shared-environments)/[stacked](https://docs.julialang.org/en/v1/manual/code-loading/#Environment-stacks) environments is another practicable solution. [ShareAdd.jl](https://github.com/Eben60/ShareAdd.jl) can help you in using and managing these. See also it's [documentation](https://eben60.github.io/ShareAdd.jl/) for some explanations on how it works. + } ## Configuration From 04c83b1aa0c9f9198987d2182ca7d6cae1924d3d Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Sun, 29 Jun 2025 14:17:42 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- sharing/index.md | 4 +--- writing/index.md | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sharing/index.md b/sharing/index.md index 2b5accb..79f575b 100644 --- a/sharing/index.md +++ b/sharing/index.md @@ -49,7 +49,7 @@ t("MyAwesomePackage") Then, you simply need to push this new folder to the remote repository , and you're ready to go. -The steps described above, including creation of a GitHub repo and pushing your project to it, can also be comfortably done with the help of [PackageMaker.jl](https://github.com/Eben60/PackageMaker.jl), which is a GUI wrap around [PkgTemplates.jl](https://github.com/JuliaCI/PkgTemplates.jl) with a couple features of it's own. +The steps described above, including creation of a GitHub repo and pushing your project to it, can also be comfortably done with the help of [PackageMaker.jl](https://github.com/Eben60/PackageMaker.jl), which is a graphical wrapper around [PkgTemplates.jl](https://github.com/JuliaCI/PkgTemplates.jl) with a couple features of its own. The rest of this post will explain to you what each part of this folder does, and how to bend them to your will. @@ -80,8 +80,6 @@ using MyAwesomePackage ``` - - ## GitHub Actions The most useful aspect of PkgTemplates.jl is that it automatically generates workflows for [GitHub Actions](https://docs.github.com/en/actions/quickstart). diff --git a/writing/index.md b/writing/index.md index ebf0cdf..5606574 100644 --- a/writing/index.md +++ b/writing/index.md @@ -380,7 +380,7 @@ Once your code base grows beyond a few scripts, you will want to [create a packa The first advantage is that you don't need to specify the path of every file: `using MyPackage: myfunc` is enough to get access to the names you define. Furthermore, you can specify versions for your package and its dependencies, making your code easier and safer to reuse. -To create a new package locally, one easy way is to use `]generate`. We will discuss more sophisticated workflows, including a [GUI tool](https://github.com/Eben60/PackageMaker.jl), in the next blog post. +To create a new package locally, one easy way is to use `]generate`. We will discuss more sophisticated workflows, including a graphical tool, in the next blog post. ```>generate-package Pkg.generate(sitepath("MyPackage")); # ignore sitepath @@ -462,7 +462,8 @@ using MyPackage MyPackage.myfunc() ``` -For the common case of dependencies needed for interactive work only, [shared](https://pkgdocs.julialang.org/v1/environments/#Shared-environments)/[stacked](https://docs.julialang.org/en/v1/manual/code-loading/#Environment-stacks) environments is another practicable solution. [ShareAdd.jl](https://github.com/Eben60/ShareAdd.jl) can help you in using and managing these. See also it's [documentation](https://eben60.github.io/ShareAdd.jl/) for some explanations on how it works. +For the common case of dependencies needed for interactive work only, [shared](https://pkgdocs.julialang.org/v1/environments/#Shared-environments) or [stacked](https://docs.julialang.org/en/v1/manual/code-loading/#Environment-stacks) environments are another practical solution. +[ShareAdd.jl](https://github.com/Eben60/ShareAdd.jl) can help you in using and managing these (see its documentation). }