From 4695e6662209744aadbecde8e016a69d92adc43e Mon Sep 17 00:00:00 2001 From: David Little Date: Thu, 11 Apr 2024 16:22:02 -0400 Subject: [PATCH] Move docs to readme (#8) --- .github/workflows/CI.yml | 16 +++----- .github/workflows/Documenter.yml | 68 -------------------------------- README.md | 18 ++++++++- codecov.yml | 9 ----- docs/.gitignore | 1 - docs/Project.toml | 6 --- docs/fix_doctests.jl | 21 ---------- docs/make.jl | 10 ----- docs/src/index.md | 13 ------ 9 files changed, 21 insertions(+), 141 deletions(-) delete mode 100644 .github/workflows/Documenter.yml delete mode 100644 codecov.yml delete mode 100644 docs/.gitignore delete mode 100644 docs/Project.toml delete mode 100644 docs/fix_doctests.jl delete mode 100644 docs/make.jl delete mode 100644 docs/src/index.md diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 89fb87c..739a452 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -76,11 +76,12 @@ jobs: with: version: ${{ steps.version_resolver.outputs.version }} arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v1 - - uses: julia-actions/add-julia-registry@v1 + - uses: actions/cache@v2 with: - key: ${{ secrets.BEACONBUDDY_SSH_KEY }} - registry: beacon-biosignals/BeaconRegistry + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-artifacts-${{ hashFiles('**/Project.toml') }} + restore-keys: ${{ runner.os }}-test-artifacts + - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 with: annotate: true @@ -92,10 +93,3 @@ jobs: files: lcov.info flags: WeakKeyIdDicts token: ${{ secrets.CODECOV_TOKEN }} - # - name: Percy Upload - # if: ${{ matrix.version == '1' }} - # uses: percy/exec-action@v0.3.1 - # with: - # custom-command: "npx @percy/cli upload ./WeakKeyIdDicts.jl/test/test_images" - # env: - # PERCY_TOKEN: ${{ secrets.PERCY_TOKEN_WEAKKEYIDDICTS }} diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml deleted file mode 100644 index 8517975..0000000 --- a/.github/workflows/Documenter.yml +++ /dev/null @@ -1,68 +0,0 @@ ---- -name: Documenter -on: - workflow_dispatch: - push: - tags: ["*"] - branches: - - main - paths: - - "docs/**" - - "src/**" - - "Project.toml" - - ".github/workflows/Documenter.yml" - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - paths: - - "docs/**" - - "src/**" - - "Project.toml" - - ".github/workflows/Documenter.yml" - - ".github/workflows/DocPreviewCleanup.yml" -jobs: - docs: - name: Build - # Run on non-draft PRs - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} - # These permissions are needed to: - # - Deploying documentation: https://github.com/JuliaDocs/Documenter.jl/pull/2478 - # - Delete old caches: https://github.com/julia-actions/cache#usage - permissions: - actions: write - contents: write - pull-requests: read - statuses: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: "1" - show-versioninfo: true - - uses: julia-actions/cache@v1 - - uses: julia-actions/add-julia-registry@v1 - with: - key: ${{ secrets.BEACONBUDDY_SSH_KEY }} - registry: beacon-biosignals/BeaconRegistry - - name: Install dependencies - shell: julia --project=docs --color=yes {0} - run: | - using Pkg - Pkg.develop(PackageSpec(path=pwd())) - Pkg.instantiate() - - name: Build docs - uses: julia-actions/julia-docdeploy@v1 - with: - install-package: false # Avoid instantiating twice - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Preview URL - if: ${{ github.event_name == 'pull_request' }} - run: | - repo_owner="${repo%/*}" # e.g. JuliaLang - repo_name="${repo#*/}" # e.g. Example.jl - echo ":books: Documentation preview available at:" | tee -a "$GITHUB_STEP_SUMMARY" - echo "" | tee -a "$GITHUB_STEP_SUMMARY" - env: - repo: ${{ github.repository }} # e.g. JuliaLang/Example.jl - PR: ${{ github.event.number }} diff --git a/README.md b/README.md index 210d2c1..f6f283e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,23 @@ # WeakKeyIdDicts -[![docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://beacon-biosignals.github.io/WeakKeyIdDicts.jl/dev) -[![docs](https://img.shields.io/badge/docs-stable-blue.svg)](https://beacon-biosignals.github.io/WeakKeyIdDicts.jl/stable) [![CI](https://github.com/beacon-biosignals/WeakKeyIdDicts.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/beacon-biosignals/WeakKeyIdDicts.jl/actions/workflows/CI.yml?query=branch%3Amain) [![codecov](https://codecov.io/gh/beacon-biosignals/WeakKeyIdDicts.jl/branch/main/graph/badge.svg?token=IeRxFxQwG8&flag=WeakKeyIdDicts)](https://app.codecov.io/gh/beacon-biosignals/WeakKeyIdDicts.jl/tree/main) Implements a WeakKeyIdDict which constructs a hash table where the keys are weak references to objects that may be garbage collected even when referenced in a hash table. + +It defines one type, `WeakKeyIdDict`, that follows the same API as `Dict`. + +```julia +_tmp_key = [1] +wkd = WeakKeyIdDict(_tmp_key => 1) +let tmp = [42] + wkd[tmp] = 2 + @show length(wkd) # 2 +end +# at this point there is no strong reference left to the vector [42] +# previously reachable via tmp +GC.gc(true) + +@show length(wkd) # 1 +``` diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 8ca2b56..0000000 --- a/codecov.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -comment: off -flag_management: - default_rules: - carryforward: true - individual_flags: - - name: WeakKeyIdDicts - paths: - - src/** diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index a007fea..0000000 --- a/docs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build/* diff --git a/docs/Project.toml b/docs/Project.toml deleted file mode 100644 index 3243236..0000000 --- a/docs/Project.toml +++ /dev/null @@ -1,6 +0,0 @@ -[deps] -Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -WeakKeyIdDicts = "ecbed89c-9d59-4137-ae1f-d1084086d01c" - -[compat] -Documenter = "1" diff --git a/docs/fix_doctests.jl b/docs/fix_doctests.jl deleted file mode 100644 index bd5b528..0000000 --- a/docs/fix_doctests.jl +++ /dev/null @@ -1,21 +0,0 @@ -# run this script in the `docs` project to fix the doctests if they are out of date -# carefully review the changes before committing! - -# One needs to be careful because `fix=true` will edit the source to fix -# the doctests, and it's good to separate those changes so you can check -# they are correct (and be easily revertable if they do something wrong). - -using Documenter, WeakKeyIdDicts - -DocMeta.setdocmeta!(WeakKeyIdDicts, :DocTestSetup, :(using WeakKeyIdDicts); - recursive=true) - -if get(ENV, "CI", "false") == "true" || success(`git diff --quiet`) - # Uncommment if a special aws configuration is required to run tests (as additionally set in CI) - # if ismissing(get(ENV, "AWS_PROFILE", missing)) - # @warn """You may need to set `ENV["AWS_PROFILE"] = weakkeyiddicts-ci` in order to successfully run the doctests""" - # end - doctest(WeakKeyIdDicts; fix=true) -else - error("Git repo dirty; commit changes before fixing doctests.") -end diff --git a/docs/make.jl b/docs/make.jl deleted file mode 100644 index 98d3d76..0000000 --- a/docs/make.jl +++ /dev/null @@ -1,10 +0,0 @@ -using WeakKeyIdDicts -using Documenter - -makedocs(; modules=[WeakKeyIdDicts], - sitename="WeakKeyIdDicts.jl", - authors="Beacon Biosignals") - -deploydocs(; repo="github.com/beacon-biosignals/WeakKeyIdDicts.jl.git", - push_preview=true, - devbranch="main") diff --git a/docs/src/index.md b/docs/src/index.md deleted file mode 100644 index 1b9e11d..0000000 --- a/docs/src/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# WeakKeyIdDicts.jl - -```@autodocs -Modules = [WeakKeyIdDicts] -Private = false -``` - -## Non-exported functions and types - -```@autodocs -Modules = [WeakKeyIdDicts] -Public = false -```