Skip to content

Commit

Permalink
update Documenter to v1 (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk authored Sep 28, 2023
1 parent 8126819 commit 6582be2
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 66 deletions.
36 changes: 29 additions & 7 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c"
uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9"
version = "0.0.1"

[[deps.AbstractTrees]]
git-tree-sha1 = "faa260e4cb5aba097a73fab382dd4b5819d8ec8c"
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
version = "0.4.4"

[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
version = "1.1.1"
Expand Down Expand Up @@ -40,10 +45,10 @@ uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.9.3"

[[deps.Documenter]]
deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
git-tree-sha1 = "39fd748a73dce4c05a9655475e437170d8fb1b67"
deps = ["ANSIColoredPrinters", "AbstractTrees", "Base64", "Dates", "DocStringExtensions", "Downloads", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "MarkdownAST", "Pkg", "PrecompileTools", "REPL", "RegistryInstances", "SHA", "Test", "Unicode"]
git-tree-sha1 = "f1a7eaf2b5ac7a4feb27973a09d25daf80dc56db"
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "0.27.25"
version = "1.0.1"

[[deps.Downloads]]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
Expand All @@ -67,7 +72,7 @@ uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
deps = ["InteractiveUtils", "JuliaInterpreter", "LoweredCodeUtils", "MacroTools", "Pkg", "PrecompileTools", "Preferences", "Revise", "Test"]
path = ".."
uuid = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
version = "0.8.13"
version = "0.8.14"

[[deps.JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
Expand All @@ -81,6 +86,11 @@ git-tree-sha1 = "81dc6aefcbe7421bd62cb6ca0e700779330acff8"
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.9.25"

[[deps.LazilyInitializedFields]]
git-tree-sha1 = "410fe4739a4b092f2ffe36fcb0dcc3ab12648ce1"
uuid = "0e77f7df-68c5-4e49-93ce-4cd80f5598bf"
version = "1.2.1"

[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
Expand All @@ -98,7 +108,7 @@ uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
[[deps.LibGit2_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"]
uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5"
version = "1.6.4+0"
version = "1.7.1+0"

[[deps.LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
Expand Down Expand Up @@ -133,6 +143,12 @@ version = "0.5.11"
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[deps.MarkdownAST]]
deps = ["AbstractTrees", "Markdown"]
git-tree-sha1 = "e8513266815200c0c8f522d6d44ffb5e9b366ae4"
uuid = "d0879d2d-cac2-40c8-9cee-1863dc0c7391"
version = "0.1.1"

[[deps.MbedTLS_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
Expand Down Expand Up @@ -173,9 +189,9 @@ version = "1.2.0"

[[deps.Preferences]]
deps = ["TOML"]
git-tree-sha1 = "7eb1686b4f04b82f96ed7a4ea5890a4f0c7a09f1"
git-tree-sha1 = "00805cd429dcb4870060ff49ef443486c262e38e"
uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.4.0"
version = "1.4.1"

[[deps.Printf]]
deps = ["Unicode"]
Expand All @@ -189,6 +205,12 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
deps = ["SHA"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[deps.RegistryInstances]]
deps = ["LazilyInitializedFields", "Pkg", "TOML", "Tar"]
git-tree-sha1 = "ffd19052caf598b8653b99404058fce14828be51"
uuid = "2792f1a3-b283-48e8-9a74-f99dce5104f3"
version = "0.1.0"

[[deps.Requires]]
deps = ["UUIDs"]
git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
Expand Down
28 changes: 16 additions & 12 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function generate_example_docs!(dir = PLUGIN_EXAMPLES_DIRS[1], outs = String[])
push!(outs, Literate.markdown(normpath(root, file), outdir; documenter=true))
end
for dir in dirs
gen_example_doc!(normpath(root, dir), outs)
generate_example_docs!(normpath(root, dir), outs)
end
end

Expand All @@ -94,7 +94,15 @@ function generate_api_doc(examples_pages)
contents = codeblock("Pages = $(repr([out]))", "@contents")
interface_docs = let
objs = getfield.(Ref(JET.JETInterface), JET.JETInterface.DOCUMENTED_NAMES)
codeblock(join(string.(parentmodule.(objs), '.', nameof.(objs)), '\n'))
map(objs) do @nospecialize obj
if obj === JET.AnalysisCache
return "JET.AnalysisCache(::JET.AbstractAnalyzer)"
elseif obj === JET.InferenceErrorReport
return "JET.InferenceErrorReport()"
else
return string(parentmodule(obj), '.', nameof(obj))
end
end |> Base.Fix2(join, '\n') |> codeblock
end
examples_contents = codeblock("Pages = $(repr(examples_pages))", "@contents")

Expand Down Expand Up @@ -140,22 +148,18 @@ let
"Tutorial" => "tutorial.md",
"Analyses" => Any[
"Error Analysis" => "jetanalysis.md",
"Optimization Analysis" => "optanalysis.md",
],
"Optimization Analysis" => "optanalysis.md"],
"Configurations" => "config.md",
"Internals" => "internals.md",
"`AbstractAnalyzer` Framework" => Any[
"API" => generate_api_doc(examples),
"Examples" => examples,
]
"API" => generate_api_doc(examples),
"Examples" => examples]
],
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", nothing) == "true",
ansicolor = true,
),
)
ansicolor = true),
warnonly = [:missing_docs, :cross_references])
end

deploydocs(; repo = "github.com/aviatesk/JET.jl.git",
push_preview = true,
)
push_preview = true)
10 changes: 5 additions & 5 deletions examples/find_unstable_api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@ function report_package_unstable_api(args...; jetconfigs...)
return analyze_and_report_package!(analyzer, args...; jetconfigs...)
end

using Pkg #src
if "IRTools" in keys(Pkg.project().dependencies) #src
using Pkg #hide
if "IRTools" in keys(Pkg.project().dependencies) #hide
report_package_unstable_api("IRTools";
## to only find errors detected within the module context of `IRTools`
target_defined_modules=true)
else #src
@warn "IRTools isn't installed in the current environment at $(Pkg.project().path)" #src
end #src
else #hide
@warn "IRTools isn't installed in the current environment at $(Pkg.project().path)" #hide
end #hide

# ```
# ═════ 59 possible errors found ═════
Expand Down
15 changes: 7 additions & 8 deletions src/abstractinterpret/abstractanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,6 @@ end
AnalysisCache
JET's internal representation of a global analysis cache.
---
AnalysisCache(analyzer::AbstractAnalyzer) -> analysis_cache::AnalysisCache
Returns [`AnalysisCache`](@ref) for this `analyzer::AbstractAnalyzer`.
`AbstractAnalyzer` instances can share the same cache if they perform the same analysis,
otherwise their cache should be separated.
"""
struct AnalysisCache
cache::IdDict{MethodInstance,CodeInstance}
Expand All @@ -477,6 +469,13 @@ Base.setindex!(analysis_cache::AnalysisCache, ci::CodeInstance, mi::MethodInstan
Base.delete!(analysis_cache::AnalysisCache, mi::MethodInstance) = delete!(analysis_cache.cache, mi)
Base.show(io::IO, analysis_cache::AnalysisCache) = print(io, typeof(analysis_cache), "(", length(analysis_cache.cache), " entries)")

"""
AnalysisCache(analyzer::AbstractAnalyzer) -> analysis_cache::AnalysisCache
Returns [`AnalysisCache`](@ref) for this `analyzer::AbstractAnalyzer`.
`AbstractAnalyzer` instances can share the same cache if they perform the same analysis,
otherwise their cache should be separated.
"""
@noinline function AnalysisCache(analyzer::AbstractAnalyzer)
AnalyzerType = nameof(typeof(analyzer))
error(lazy"""
Expand Down
Loading

0 comments on commit 6582be2

Please sign in to comment.