Create a Package


#1

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 ?


#2

See here: https://julialang.github.io/Pkg.jl/v1/creating-packages/

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


#3

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


#4

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).


#5

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


#6

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

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


#7

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


#8

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


#9

Could you copy paste what you wrote?


#10

julia>using PkgTemplates

julia> t=Template(“midow”)


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

There is a difference.


#12

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


#13

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)


#14

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


#15

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.


#16

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 https://git-scm.com/book/en/v2/Getting-Started-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: PSA: make it easier to help you.


#17

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.


#18

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.


#19

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)


#20

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