Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function Pkg.create_project(project_name="", packages=[]) #3092

Open
ufechner7 opened this issue May 25, 2022 · 1 comment
Open

Add function Pkg.create_project(project_name="", packages=[]) #3092

ufechner7 opened this issue May 25, 2022 · 1 comment

Comments

@ufechner7
Copy link
Contributor

ufechner7 commented May 25, 2022

Feature request

It should be easier to create new user projects. Currently you need to do:

mkdir new_project
cd new_project
julia --project="."
using Pkg
pkg"add LinearAlgebra"
prg"add StaticArrays"

This is just an example.
After this new feature is implemented you should be able to do:

julia
using Pkg
Pkg.create_project("new_project", ["LinearAlgebra","StaticArrays"])

This would make it easier to explain to new students how to create a user project.
Perhaps even an interactive dialog could be started if the parameters are missing.

@KristofferC
Copy link
Sponsor Member

KristofferC commented May 25, 2022

shell> mkdir NewProj

(@v1.8) pkg> activate NewProj
  Activating new project at `~/JuliaTests/NewProj`

(NewProj) pkg> add LinearAlgebra StaticArrays

This would make it easier to explain to new students how to create a user project.

Instead of having a "magic" command that does this, I think it is more instructive for students to see these three steps.

  • The first one shows that a project is just a folder.
  • The second one shows that you activate a project by just activating the folder.
  • The third one adds packages to the activated project.

If you have Pkg.create_project("new_project", ["LinearAlgebra","StaticArrays"]) who knows what is going on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants