Reference

ITensorPkgSkeleton.generateFunction
generate(
    pkgname;
    path,
    templates,
    ignore_templates,
    user_replacements...
)
Warning

This function might overwrite existing code if you specify a path to a package that already exists, use with caution! See PkgSkeleton.jl for more details. If you are updating an existing package, make sure you save everything you want to keep (for example, commit all of your changes if it is a git repository).

Generate a package template for a package, by default in the ITensor organization, or update an existing package. This is a wrapper around PkgSkeleton.generate but with extra functionality, custom templates used in the ITensor organization, and defaults biased towards creating a package in the ITensor organization.

Examples

julia> using ITensorPkgSkeleton: ITensorPkgSkeleton;

julia> ITensorPkgSkeleton.generate("NewPkg"; path=mktempdir());

julia> ITensorPkgSkeleton.generate("NewPkg"; path=mktempdir());

julia> ITensorPkgSkeleton.generate("NewPkg"; path=mktempdir(), templates=ITensorPkgSkeleton.default_templates());

julia> ITensorPkgSkeleton.generate("NewPkg"; path=mktempdir(), templates=["github"]);

julia> ITensorPkgSkeleton.generate("NewPkg"; path=mktempdir(), templates=["src", "github"]);

julia> ITensorPkgSkeleton.generate("NewPkg"; path=mktempdir(), ignore_templates=["src", "github"]);

julia> ITensorPkgSkeleton.generate("NewPkg"; path=mktempdir(), ghuser="MyOrg");

julia> ITensorPkgSkeleton.generate("NewPkg"; path=mktempdir(), downstreampkgs=["ITensors", "ITensorMPS"]);

julia> ITensorPkgSkeleton.generate("NewPkg"; path=mktempdir(), downstreampkgs=[(user="ITensor", repo="ITensors")]);

Arguments

  • pkgname::AbstractString: Name of the package (without the .jl extension). Replaces {PKGNAME} in the template.

Keywords

  • path::AbstractString: Path where the package will be generated. Defaults to the development directory, i.e. /home/runner/.julia/dev.
  • templates: A list of templates to use. Select a subset of ITensorPkgSkeleton.all_templates() = ["benchmark", "docs", "downstreampkgs", "examples", "formatter", "github", "gitignore", "license", "precommit", "project", "src", "test"]. Defaults to ITensorPkgSkeleton.default_templates() = ["benchmark", "docs", "downstreampkgs", "examples", "formatter", "github", "gitignore", "license", "precommit", "project", "src", "test"].
  • ignore_templates: A list of templates to ignore. This is the same as setting templates=setdiff(templates, ignore_templates).
  • downstreampkgs: Specify the downstream packages that depend on this package. Setting this will create a workflow where the downstream tests will be run alongside the tests for this package in Github Actions to ensure that changes to your package don't break the specified downstream packages. Specify it as a list of packages, for example ["DownstreamPkg1", "DownstreamPkg2"], which assumes the packages are in the ITensor organization. Alternatively, specify the organization with [(user="Org1", repo="DownstreamPkg1"), (user="Org2", repo="DownstreamPkg2")]; . Defaults to an empty list.
  • uuid: Replaces {UUID} in the template. Defaults to the existing UUID in the Project.toml if the path points to an existing package, otherwise generates one randomly with UUIDs.uuid4().
  • year: Replaces {YEAR} in the template. Year the package/repository was created. Defaults to the current year.
source
ITensorPkgSkeleton.default_templatesFunction
default_templates()

Default templates when constructing a package. Includes the following templates: ["benchmark", "docs", "downstreampkgs", "examples", "formatter", "github", "gitignore", "license", "precommit", "project", "src", "test"]

source
ITensorPkgSkeleton.all_templatesFunction
all_templates()

All available templates when constructing a package. Includes the following templates: ["benchmark", "docs", "downstreampkgs", "examples", "formatter", "github", "gitignore", "license", "precommit", "project", "src", "test"]

source