Skip to content

Commit

Permalink
Update package configuration (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman authored Nov 26, 2024
1 parent 81de897 commit c562847
Show file tree
Hide file tree
Showing 16 changed files with 290 additions and 10 deletions.
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
name: TypeParameterAccessors.jl bug report
about: Create a bug report to help us improve TypeParameterAccessors.jl
title: "[BUG] YOUR SHORT DESCRIPTION OF THE BUG HERE"
labels: ["bug"]
assignees: ''

---

**Description of bug**

Please give a brief description of the bug or unexpected behavior here.

**Minimal code demonstrating the bug or unexpected behavior**

If applicable, provide a minimal code that can be run to demonstrate the bug or unexpected behavior.

If you are unable to construct a minimal code that demonstrates the bug or unexpected behavior, provide detailed steps for how to reproduce the behavior you are seeing.

<details><summary>Minimal runnable code</summary><p>

```julia
[YOUR MINIMAL RUNNABLE CODE HERE]
```

</p></details>


**Expected output or behavior**

Describe what you expected to happen.

If you provided a minimal code that can be run to demonstrate the bug or unexpected behavior, describe what you expected the output would be.


**Actual output or behavior**

Describe what actually happened.

If you provided a minimal code that demonstrates the bug or unexpected behavior, provide the output you get from that code. If the code leads to an error or warning, include the full error or warning below.

<details><summary>Output of minimal runnable code</summary><p>

```julia
[OUTPUT OF YOUR MINIMAL RUNNABLE CODE HERE]
```

</p></details>


**Version information**

- Output from `versioninfo()`:
```julia
julia> versioninfo()
[YOUR OUTPUT HERE]
```
- Output from `using Pkg; Pkg.status("TypeParameterAccessors")`:
```julia
julia> using Pkg; Pkg.status("TypeParameterAccessors")
[YOUR OUTPUT HERE]
```
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: TypeParameterAccessors.jl feature request
about: Suggest an idea for TypeParameterAccessors.jl
title: "[ENHANCEMENT] YOUR SHORT DESCRIPTION OF THE FEATURE REQUEST HERE"
labels: ["enhancement"]
assignees: ''

---

**Is your feature request related to a problem? Please describe.**

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**

A clear and concise description of what you want to happen.

**Describe alternatives you've considered**

A clear and concise description of any alternative solutions or features you've considered.

**Additional context**

Add any other context or screenshots about the feature request here.
42 changes: 42 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Description

Please include a summary of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #(issue)

If practical and applicable, please include a minimal demonstration of the previous behavior and new behavior below.

<details><summary>Minimal demonstration of previous behavior</summary><p>

```julia
[YOUR MINIMAL DEMONSTRATION OF PREVIOUS BEHAVIOR]
```

</p></details>

<details><summary>Minimal demonstration of new behavior</summary><p>

```julia
[YOUR MINIMAL DEMONSTRATION OF NEW BEHAVIOR]
```

</p></details>

# How Has This Been Tested?

Please add tests that verify your changes to a file in the `test` directory.

Please give a summary of the tests that you added to verify your changes.

- [ ] Test A
- [ ] Test B

# Checklist:

- [ ] My code follows the style guidelines of this project. Please run `using JuliaFormatter; format(".")` in the base directory of the repository (`~/.julia/dev/TypeParameterAccessors`) to format your code according to our style guidelines.
- [ ] I have performed a self-review of my own code.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have added tests that verify the behavior of the changes I made.
- [ ] I have made corresponding changes to the documentation.
- [ ] My changes generate no new warnings.
- [ ] Any dependent changes have been merged and published in downstream modules.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
fail-fast: false
matrix:
version:
- '1.10'
- 'lts'
- '1'
os:
- ubuntu-latest
- macOS-latest
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Format check
on:
push:
branches: [main]
tags: [v*]
pull_request:

jobs:
format:
name: "Format Check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: 1
- name: Install JuliaFormatter and format
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
julia -e 'using JuliaFormatter; format(".", verbose=true)'
- name: Check format
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "The following files have not been formatted:"
write(stdout, out)
out_diff = Cmd(`git diff`) |> read |> String
@error "Diff:"
write(stdout, out_diff)
exit(1)
@error ""
end'
39 changes: 39 additions & 0 deletions .github/workflows/LiterateCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Literate check
on:
push:
branches: [main]
tags: [v*]
pull_request:

jobs:
literate:
name: "Literate Check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: 1
- name: Install Literate and generate docs
run: |
julia -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
Pkg.add(PackageSpec(name="Literate"))'
julia -e 'include("make_readme.jl")'
- name: Check if docs need to be updated
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "The docs are outdated, rerun Literate to regenerate them."
write(stdout, out)
out_diff = Cmd(`git diff`) |> read |> String
@error "Diff:"
write(stdout, out_diff)
exit(1)
@error ""
end'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
.vscode/
/docs/Manifest.toml
/docs/build/
/docs/src/index.md
Manifest.toml
benchmark/*.json
docs/build/
test/LocalPreferences.toml
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
exclude_types: [markdown] # incompatible with Literate.jl
- repo: https://github.com/qiaojunfeng/pre-commit-julia-format
rev: v0.2.0
hooks:
- id: julia-format
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "TypeParameterAccessors"
uuid = "7e5a90cf-f82e-492e-a09b-e3e26432c138"
authors = ["ITensor developers"]
authors = ["ITensor developers <[email protected]> and contributors"]
version = "0.1.0"

[deps]
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TypeParameterAccessors
# TypeParameterAccessors.jl

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://ITensor.github.io/TypeParameterAccessors.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://ITensor.github.io/TypeParameterAccessors.jl/dev/)
Expand All @@ -7,10 +7,23 @@
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
[![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)

## Installation
## Installation instructions

```julia
julia> import Pkg
julia> using Pkg: Pkg

julia> Pkg.add("https://github.com/ITensor/TypeParameterAccessors.jl")
```

## Examples

````julia
using TypeParameterAccessors: TypeParameterAccessors
````

Examples go here.

---

*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*

3 changes: 2 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
TypeParameterAccessors = "7e5a90cf-f82e-492e-a09b-e3e26432c138"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
14 changes: 10 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
using TypeParameterAccessors
using Documenter
using TypeParameterAccessors: TypeParameterAccessors
using Documenter: Documenter, DocMeta, deploydocs, makedocs

DocMeta.setdocmeta!(
TypeParameterAccessors, :DocTestSetup, :(using TypeParameterAccessors); recursive=true
)

include("make_index.jl")

makedocs(;
modules=[TypeParameterAccessors],
authors="ITensor developers",
authors="ITensor developers <[email protected]> and contributors",
sitename="TypeParameterAccessors.jl",
format=Documenter.HTML(;
canonical="https://ITensor.github.io/TypeParameterAccessors.jl",
edit_link="main",
assets=String[],
),
pages=["Home" => "index.md"],
# TODO: Define missing docs and delete this.
warnonly=[:missing_docs],
)

deploydocs(; repo="github.com/ITensor/TypeParameterAccessors.jl", devbranch="main")
deploydocs(;
repo="github.com/ITensor/TypeParameterAccessors.jl", devbranch="main", push_preview=true
)
9 changes: 9 additions & 0 deletions docs/make_index.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Literate: Literate
using TypeParameterAccessors: TypeParameterAccessors

Literate.markdown(
joinpath(pkgdir(TypeParameterAccessors), "examples", "README.jl"),
joinpath(pkgdir(TypeParameterAccessors), "docs", "src");
flavor=Literate.DocumenterFlavor(),
name="index",
)
2 changes: 2 additions & 0 deletions examples/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
TypeParameterAccessors = "3d388ab1-018a-49f4-ae50-18094d5f71ea"
23 changes: 23 additions & 0 deletions examples/README.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# # TypeParameterAccessors.jl
#
# [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://ITensor.github.io/TypeParameterAccessors.jl/stable/)
# [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://ITensor.github.io/TypeParameterAccessors.jl/dev/)
# [![Build Status](https://github.com/ITensor/TypeParameterAccessors.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/ITensor/TypeParameterAccessors.jl/actions/workflows/CI.yml?query=branch%3Amain)
# [![Coverage](https://codecov.io/gh/ITensor/TypeParameterAccessors.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/ITensor/TypeParameterAccessors.jl)
# [![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
# [![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)

# ## Installation instructions

#=
```julia
julia> using Pkg: Pkg
julia> Pkg.add("https://github.com/ITensor/TypeParameterAccessors.jl")
```
=#

# ## Examples

using TypeParameterAccessors: TypeParameterAccessors
# Examples go here.
9 changes: 9 additions & 0 deletions make_readme.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Literate: Literate
using TypeParameterAccessors: TypeParameterAccessors

Literate.markdown(
joinpath(pkgdir(TypeParameterAccessors), "examples", "README.jl"),
joinpath(pkgdir(TypeParameterAccessors));
flavor=Literate.CommonMarkFlavor(),
name="README",
)

0 comments on commit c562847

Please sign in to comment.