A template generator for creating new Julia packages based on TensorCrossInterpolation.jl patterns and tensor4all organization conventions.
- Test.jl-based tests (default) with debugging tips
- Documenter.jl documentation scaffold
- GitHub Actions CI with multiple Julia versions (1.9, LTS, latest)
- CompatHelper and TagBot automation
- JuliaFormatter configuration
- Optional TensorCrossInterpolation dependency
$ git clone [email protected]:tensor4all/T4ATemplate.jl.git
$ cd T4ATemplate.jl
$ julia --project=. -e 'using Pkg; Pkg.instantiate()'To create a new package named MyPkg.jl:
$ julia --project=. generate.jl MyPkg.jlOr using the module directly:
julia> using T4ATemplate
julia> T4ATemplate.generate("MyPkg.jl")Create a package with TensorCrossInterpolation as a dependency:
$ julia --project=. generate.jl MyPkg.jl --include-tciOr specify a different GitHub user/organization:
$ julia --project=. generate.jl MyPkg.jl --user myusernameMyPkg.jl/
├── LICENSE
├── Manifest.toml
├── Project.toml
├── README.md
├── .github/
│ └── workflows/
│ └── CI.yml
├── docs/
│ ├── Manifest.toml
│ ├── Project.toml
│ ├── make.jl
│ └── src/
│ └── index.md
├── src/
│ └── MyPkg.jl
└── test/
└── runtests.jl
Create a repository on GitHub (using gh CLI if available):
$ gh repo create tensor4all/MyPkg.jl \
--public \
--description "Julia package for tensor4all" \
--clone=falseThe template already sets the remote URL. Push your code:
$ cd MyPkg.jl
$ git push -u origin mainAdd the new package as a submodule to JuliaUmbrella:
$ cd /path/to/JuliaUmbrella
$ git submodule add [email protected]:tensor4all/MyPkg.jl.git
$ git commit -m "Add MyPkg.jl as submodule"
$ git pushEnable GitHub Pages for documentation:
- Go to repository Settings → Pages
- Source: Deploy from a branch
- Branch:
main/docs
To enable automatic documentation deployment, you need to set up a DOCUMENTER_KEY secret:
-
Generate a deploy key:
julia> using Documenter, DocumenterTools julia> DocumenterTools.genkeys("tensor4all", "YourPkg.jl")
-
Add the private key as a GitHub secret:
- Go to repository Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
DOCUMENTER_KEY - Value: Paste the private key generated above
- Click "Add secret"
Note: If DOCUMENTER_KEY is not set, the documentation job will still run but will skip deployment (with continue-on-error: true). This allows the CI to pass even without the key configured.
Run all tests:
julia> using Pkg; Pkg.test()Or from command line:
$ julia --project=. -e 'using Pkg; Pkg.test()'For packages using include() statements in test/runtests.jl (like TensorCrossInterpolation.jl), you can comment out unnecessary includes and run only the test file you're debugging:
$ julia --project=. test/your_test_file.jlOr edit test/runtests.jl to comment out other includes and run:
$ julia --project=. test/runtests.jl- Test.jl (default): Used by TensorCrossInterpolation.jl and packages using Distributed for parallel computation
- ReTestItems: Used by some libraries (e.g., Quantics.jl, QuanticsGrids.jl), but not recommended for packages using Distributed
If your package should be registered in T4ARegistry, use T4ARegistrator.jl.
If your package is already registered in the official Julia registry, to register a new version, comment @JuliaRegistrator register in the library's issue, and the bot will create a PR to the official registry.
- Julia 1.9 or later
- All packages are under the tensor4all GitHub organization
MIT License