-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
78 additions
and
89 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,12 @@ julia> using Pkg: Pkg | |
|
||
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry") | ||
``` | ||
or: | ||
```julia | ||
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git") | ||
``` | ||
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. | ||
|
||
Then, the package can be added as usual through the package manager: | ||
|
||
```julia | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
[deps] | ||
Git_jll = "f8c6e375-362e-5223-8a59-34ff63f689eb" | ||
ITensorPkgSkeleton = "3d388ab1-018a-49f4-ae50-18094d5f71ea" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,14 @@ julia> using Pkg: Pkg | |
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry") | ||
``` | ||
=# | ||
# or: | ||
#= | ||
```julia | ||
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git") | ||
``` | ||
=# | ||
# 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. | ||
|
||
# Then, the package can be added as usual through the package manager: | ||
|
||
#= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,6 +155,31 @@ function to_pkgskeleton(user_replacements) | |
return Dict(uppercase.(string.(keys(user_replacements))) .=> values(user_replacements)) | ||
end | ||
|
||
function pkg_registration_message(; pkgname, path) | ||
return """ | ||
The package "$pkgname" has been generated at "$path". | ||
To register the package in the [ITensor registry](https://github.com/ITensor/ITensorRegistry), first add | ||
the registry if you haven't already with: | ||
```julia | ||
julia> using Pkg: Pkg | ||
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry") | ||
``` | ||
or: | ||
```julia | ||
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git") | ||
``` | ||
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. | ||
Then, use `LocalRegistry.jl` to register the package. First, you should add `LocalRegistry.jl` in your global environment. Then, activate the package and call: | ||
```julia | ||
using LocalRegistry: LocalRegistry | ||
LocalRegistry.register() | ||
``` | ||
""" | ||
end | ||
|
||
""" | ||
$(SIGNATURES) | ||
|
@@ -165,7 +190,7 @@ Generate a package template for a package, by default in the ITensor organizatio | |
# Examples | ||
```jldoctest | ||
```julia | ||
julia> using ITensorPkgSkeleton: ITensorPkgSkeleton; | ||
julia> ITensorPkgSkeleton.generate("NewPkg"; path=mktempdir()); | ||
|
@@ -232,6 +257,9 @@ function generate( | |
change_branch_name(pkgpath, branch_name) | ||
set_remote_url(path, pkgname, user_replacements.ghuser) | ||
end | ||
if is_new_repo | ||
println(pkg_registration_message(; pkgname, path)) | ||
end | ||
return nothing | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,16 +12,19 @@ | |
This package resides in the `ITensor/ITensorRegistry` local registry. | ||
In order to install, simply add that registry through your package manager. | ||
This step is only required once. | ||
|
||
```julia | ||
julia> using Pkg: Pkg | ||
|
||
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry") | ||
``` | ||
or: | ||
```julia | ||
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git") | ||
``` | ||
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. | ||
|
||
Then, the package can be added as usual through the package manager: | ||
|
||
|
||
```julia | ||
julia> Pkg.add("{PKGNAME}") | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,14 @@ julia> using Pkg: Pkg | |
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry") | ||
``` | ||
=# | ||
# or: | ||
#= | ||
```julia | ||
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git") | ||
``` | ||
=# | ||
# 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. | ||
|
||
# Then, the package can be added as usual through the package manager: | ||
|
||
#= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[deps] | ||
{PKGNAME} = "{UUID}" | ||
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" | ||
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
@eval module $(gensym()) | ||
using {PKGNAME}: {PKGNAME} | ||
using Test: @test, @testset | ||
using Suppressor: @suppress | ||
using Test: @testset | ||
|
||
@testset "examples" begin | ||
include(joinpath(pkgdir({PKGNAME}), "examples", "README.jl")) | ||
@testset "{PKGNAME}.jl examples" begin | ||
examples_path = joinpath(pkgdir({PKGNAME}), "examples") | ||
filenames = filter(readdir(examples_path; join=true)) do f | ||
endswith(".jl")(f) | ||
end | ||
@testset "Test $filename" for filename in filenames | ||
@suppress include(filename) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
@eval module $(gensym()) | ||
using ITensorPkgSkeleton: ITensorPkgSkeleton | ||
using Test: @test, @testset | ||
using Suppressor: @suppress | ||
using Test: @testset | ||
|
||
@testset "examples" begin | ||
include(joinpath(pkgdir(ITensorPkgSkeleton), "examples", "README.jl")) | ||
@testset "ITensorPkgSkeleton.jl examples" begin | ||
examples_path = joinpath(pkgdir(ITensorPkgSkeleton), "examples") | ||
filenames = filter(readdir(examples_path; join=true)) do f | ||
endswith(".jl")(f) | ||
end | ||
@testset "Test $filename" for filename in filenames | ||
@suppress include(filename) | ||
end | ||
end | ||
end |