All need githup. We are not allowed to use githup in my company. My company has a local gitlab server. I look at many pages and youtube and it always talk about github. Am I correct when I see that my company can not use Julia since it need github?
Gitlab is perfectly fine to use for Julia packages, and so is any other git host. Github is used as the most common example because it is the most popular one and widely used within the Julia community (for better or worse), but it’s not necessary to use it.
PkgTemplates.jl has a Github Actions plugin, but right next to it you can see that it also has a GitLab CI (for handling continuous integration tasks when using Gitlab).
In the main Template call, you can see for the user keyword, it says “GitHub (or other code hosting service) username”.
And for host it says:
host::AbstractString="github.com": URL to the code hosting service where packages will reside.
i.e. "github.com" is the default if no host is specified, but you can instead specify your Gitlab instance’s URL here to use that instead.
A quick answer: no, Julia packages can be hosted on whatever git repository, and there are several packages (altough latgely a minority) that are hosted on gitlab without problems.
This has mostly been answered already but I can add that I have been working with company internal packages hosted on a BitBucket instance with Jenkins for CI, as well as transitioned those to a GitLab setup. There is nothing in Julia’s package manager that requires GitHub, although there are some GitHub-specific optimizations for the benefit of the large amount of public packages hosted there. Third-party tooling and documentation may sometimes be preferential to GitHub but there’s at least one packaging related functionality that’s only available for GitLab.
| | |_| | | | (_| | | Version 1.8.0 (2022-08-17)
julia> using PkgTemplates
julia> t = Template()
ERROR: Git: Git hosting service username is required, set one with keyword `user="<username>"`
Stacktrace:
[1] (::PkgTemplates.var"#8#14")(p::Git)
If you read the options for the template here you see that it mentions that you have to either provide a user for the code hosting service and author name or have those defined in your gitconfig.
User Options
user::AbstractString="username": GitHub (or other code hosting service) username. The default value comes from the global Git config (github.user). If no value is obtained, many plugins that use this value will not work.
authors::Union{AbstractString, Vector{<:AbstractString}}="name <email> and contributors": Package authors. Like user, it takes its default value from the global Git config (user.name and user.email).
So something like
t = Template(; user="Barvid", authors="Barvid Something barvid@something.com")
t()
could maybe work?
You probably want to set the host keyword also since github is the default.
It now work. I learn that information page is not correct. It say
Using PkgTemplates is straightforward. Just create a Template, and call it on a package name to generate that package:
using PkgTemplates
t = Template()
t("MyPkg")
This crash.
I learn Template() need username option. Maybe correct page with information.
So it does work (I assume) if you have those values set up in you git config, though maybe it should be clearer that this is a required criteria. You can always add this as an issue or PR to the package if you feel strongly about it.