Create a Package

Hello Julia Community,
i have a question what if i want to create a Package on Julia 0.7 is it possible and if it’s yes how can i do that ?

See here: 5. Creating Packages · Pkg.jl

You should use Julia 1.1 (or 1.0) for a new package, not 0.7.

6 Likes

thanks, can’t i use 0.7 cause it’s more stable?

Not really, 0.7 was just made as a transition from 0.6 to 1.0: PSA: use Julia 0.7 if you are upgrading. If you need the most stability, use 1.0.x. But really, just just 1.1.x (or later).

3 Likes

Have a try on PkgTemplates.jl if you decide to use v1.0?

4 Likes

it shows me this error message when i type: t=Template()

ERROR: ArgumentError: No GitHub username found, set one with user=username

Did you try to set one with user=username? I.e. Template(user = "marouane").

2 Likes

it shows me this:
ERROR: MethodError: no method matching Template(::String)

Could you copy paste what you wrote?

julia>using PkgTemplates

julia> t=Template(“midow”)

Template(user = "marouane").
Template("midow")

There is a difference.

3 Likes

ohhhh yeah you’re right i didn’t notice that, thank you very much.

still when i wrote my github username and went to the next command which is:
generate(“name of Pkg”,t), it shows me this:

ERROR: GitError(Code:ENOTFOUND, Class:Config, config value ‘user.name’ was not found)

Here is a beginners tutorial that provides a tested and simple (if inflexible) workflow. It may be useful to get started https://lectures.quantecon.org/jl/testing.html

4 Likes

everything was okay till it showed me a warning:
Git config option ‘user.name’ missing, package generation will fail unless you supply a GitConfig
after typing the command of
generate(“Cwrap”.jl, ourTemplate)
this error showed up:
ERROR: type String has no field jl
and i don’t know what does it mean.

Well, you need to read/type carefully! This "Cwrap".jl not the same as the correct "Cwrap.jl".

Then concerning the git error, a quick google brings up Git - First-Time Git Setup, which should get you up to speed with your git setup.

PS: please quote your code! Best have a read through: Please read: make it easier to help you.

1 Like

If you look at https://lectures.quantecon.org/jl/testing.html#Julia-Setup it shows you the right command for the git config. Alternatively, I think you can use the user = argument in the function.

1 Like

thank you very much i’ve created the package succefully and now i need to put the content inside it and there is another package like mine but it’s outdated i want to put the content of that package in mine it’s like cloning.

Cool. Using the other package, just be sure to include the appropriate stuff into your license file. (and maybe a shout-out in the README)

1 Like

the problem right now is i’m struggling on how am i suppose to do that cause it’s my first time.