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.copy_examples("package_name") #3093

Open
ufechner7 opened this issue May 25, 2022 · 4 comments
Open

Add function Pkg.copy_examples("package_name") #3093

ufechner7 opened this issue May 25, 2022 · 4 comments

Comments

@ufechner7
Copy link
Contributor

Feature request

After creating a user project you often want to run some of the examples that are often provided with packages.

There should be a default location for examples, e.g. a folder examples in the package directory.

With

using Pkg
pkg"add KiteViewers"
pkg"copy_examples KiteViewers"

a folder examples should be created and the examples from https://github.com/aenarete/KiteViewers.jl/tree/main/examples should
be copied into this folder. In addition the permissions of the files should be changed to allow editing of the examples.

This feature would:

  1. encourage package authors to provide examples at a standard location
  2. make it easier for users to install the examples and to try them out

At discourse I here a lot of questions from new users these days that ask how to install and run examples. Many then use git to check out the package source code which results in further confusion.

@ufechner7 ufechner7 changed the title Add function Pkg.copy_examples() Add function Pkg.copy_examples("package_name") May 25, 2022
@fredrikekre
Copy link
Member

I have never felt a need for something like this -- why should this be part of the package manager?

@ufechner7
Copy link
Contributor Author

ufechner7 commented May 25, 2022

@fredrikekre I guess you are a pretty advanced developer. If I teach Julia to bachelor students they want to try out packages.... And it would be easier if:

  • all packages would have working examples
  • these examples would be at a well known location
  • you could copy them into your work folder, or into the folder "examples" with a standard command
    I mean, if you have installed a package and the packages has examples they are on your computer already, but in a hidden folder with a cryptic name... And even if you find them and copy them manually to your work folder the files are read-only... And beginners don't even know how to change file permissions...

Why is life so difficult for Julia users who are beginners?

@fredrikekre
Copy link
Member

I don't see how just copying files makes anything easier. What is the context of these files? IMO you should put stuff like this in context in the documentation, and people can download there and save in whatever folder they want.

@KristofferC
Copy link
Member

Why is life so difficult for Julia users who are beginners?

How is it done in other languages e.g. Python? Does pip have a pip --copy-examples pyPackage? Would be good to see how other languages have solved this.

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

3 participants