Skip to content

Commit 9bc0e97

Browse files
authored
Installation instructions (#27)
1 parent 01e0f35 commit 9bc0e97

File tree

11 files changed

+78
-89
lines changed

11 files changed

+78
-89
lines changed

.github/workflows/CI.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ julia> using Pkg: Pkg
1717

1818
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")
1919
```
20+
or:
21+
```julia
22+
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git")
23+
```
24+
if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.
25+
2026
Then, the package can be added as usual through the package manager:
2127

2228
```julia

examples/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
[deps]
2-
Git_jll = "f8c6e375-362e-5223-8a59-34ff63f689eb"
32
ITensorPkgSkeleton = "3d388ab1-018a-49f4-ae50-18094d5f71ea"

examples/README.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ julia> using Pkg: Pkg
1919
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")
2020
```
2121
=#
22+
# or:
23+
#=
24+
```julia
25+
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git")
26+
```
27+
=#
28+
# if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.
29+
2230
# Then, the package can be added as usual through the package manager:
2331

2432
#=

src/ITensorPkgSkeleton.jl

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,31 @@ function to_pkgskeleton(user_replacements)
155155
return Dict(uppercase.(string.(keys(user_replacements))) .=> values(user_replacements))
156156
end
157157

158+
function pkg_registration_message(; pkgname, path)
159+
return """
160+
The package "$pkgname" has been generated at "$path".
161+
162+
To register the package in the [ITensor registry](https://github.com/ITensor/ITensorRegistry), first add
163+
the registry if you haven't already with:
164+
```julia
165+
julia> using Pkg: Pkg
166+
167+
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")
168+
```
169+
or:
170+
```julia
171+
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git")
172+
```
173+
if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.
174+
175+
Then, use `LocalRegistry.jl` to register the package. First, you should add `LocalRegistry.jl` in your global environment. Then, activate the package and call:
176+
```julia
177+
using LocalRegistry: LocalRegistry
178+
LocalRegistry.register()
179+
```
180+
"""
181+
end
182+
158183
"""
159184
$(SIGNATURES)
160185
@@ -165,7 +190,7 @@ Generate a package template for a package, by default in the ITensor organizatio
165190
166191
# Examples
167192
168-
```jldoctest
193+
```julia
169194
julia> using ITensorPkgSkeleton: ITensorPkgSkeleton;
170195
171196
julia> ITensorPkgSkeleton.generate("NewPkg"; path=mktempdir());
@@ -232,6 +257,9 @@ function generate(
232257
change_branch_name(pkgpath, branch_name)
233258
set_remote_url(path, pkgname, user_replacements.ghuser)
234259
end
260+
if is_new_repo
261+
println(pkg_registration_message(; pkgname, path))
262+
end
235263
return nothing
236264
end
237265

templates/docs/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@
1212
This package resides in the `ITensor/ITensorRegistry` local registry.
1313
In order to install, simply add that registry through your package manager.
1414
This step is only required once.
15-
1615
```julia
1716
julia> using Pkg: Pkg
1817

1918
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")
2019
```
20+
or:
21+
```julia
22+
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git")
23+
```
24+
if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.
2125

2226
Then, the package can be added as usual through the package manager:
2327

24-
2528
```julia
2629
julia> Pkg.add("{PKGNAME}")
2730
```

templates/examples/examples/README.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ julia> using Pkg: Pkg
1919
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")
2020
```
2121
=#
22+
# or:
23+
#=
24+
```julia
25+
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git")
26+
```
27+
=#
28+
# if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.
29+
2230
# Then, the package can be added as usual through the package manager:
2331

2432
#=

templates/test/test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[deps]
22
{PKGNAME} = "{UUID}"
33
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
4+
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
45
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
@eval module $(gensym())
22
using {PKGNAME}: {PKGNAME}
3-
using Test: @test, @testset
3+
using Suppressor: @suppress
4+
using Test: @testset
45

5-
@testset "examples" begin
6-
include(joinpath(pkgdir({PKGNAME}), "examples", "README.jl"))
6+
@testset "{PKGNAME}.jl examples" begin
7+
examples_path = joinpath(pkgdir({PKGNAME}), "examples")
8+
filenames = filter(readdir(examples_path; join=true)) do f
9+
endswith(".jl")(f)
10+
end
11+
@testset "Test $filename" for filename in filenames
12+
@suppress include(filename)
13+
end
714
end
815
end

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
33
Git_jll = "f8c6e375-362e-5223-8a59-34ff63f689eb"
44
ITensorPkgSkeleton = "3d388ab1-018a-49f4-ae50-18094d5f71ea"
5+
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
56
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

0 commit comments

Comments
 (0)