From 5a9c10e559b6ed4dca0e100caf44782d51a4ba95 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Wed, 15 Jun 2022 13:04:23 +0200 Subject: [PATCH] Upgrade package to 1.6 - CI moves from AppVeyor/Travis -> GHA - Update `make.jl` for newer Documenter.jl versions - Add Project.toml to package - Add Project.toml + Manifest.toml to docs - Extend `Base.peek` instead of exporting - Update badges --- .github/workflows/CI.yml | 51 ++++++++++++++++++ .gitignore | 5 ++ .travis.yml | 19 ------- Project.toml | 12 +++++ README.md | 23 +++------ REQUIRE | 2 - appveyor.yml | 42 --------------- docs/Manifest.toml | 103 +++++++++++++++++++++++++++++++++++++ docs/Project.toml | 3 ++ docs/make.jl | 9 ++-- docs/src/index.md | 25 +++------ src/BufferedStreams.jl | 1 - src/bufferedinputstream.jl | 2 +- 13 files changed, 194 insertions(+), 103 deletions(-) create mode 100644 .github/workflows/CI.yml delete mode 100644 .travis.yml create mode 100644 Project.toml delete mode 100644 REQUIRE delete mode 100644 appveyor.yml create mode 100644 docs/Manifest.toml create mode 100644 docs/Project.toml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..426b253 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,51 @@ +name: CI +on: + pull_request: + push: + branches: [master] + tags: ['*'] +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.6' + - '1' # automatically expands to the latest stable 1.x release of Julia + - 'nightly' + os: + - ubuntu-latest + arch: + - x64 + include: + - os: windows-latest + version: '1' + arch: x86 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + env: + JULIA_NUM_THREADS: 4 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info + docs: + name: Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-buildpkg@latest + - uses: julia-actions/julia-docdeploy@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} diff --git a/.gitignore b/.gitignore index d6c81c3..d09616d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Built documentation +docs/build/ + # Julia temp files *.cov *.mem @@ -9,3 +12,5 @@ # OS temp or generated files .DS_Store .directory + +Manifest.toml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f6049af..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: julia -os: - - linux - - osx -julia: - - 0.7 - - 1.0 - - nightly -notifications: - email: false - -matrix: - allow_failures: - - julia: nightly - -after_success: - - julia -e 'using Pkg; ps=Pkg.PackageSpec(name="Documenter", version="0.19"); Pkg.add(ps); Pkg.pin(ps); Pkg.add("Coverage")' - - julia -e 'import BufferedStreams; cd(dirname(dirname(pathof(BufferedStreams)))); include(joinpath("docs", "make.jl"))' - - julia -e 'using Coverage; import BufferedStreams; cd(dirname(dirname(pathof(BufferedStreams)))); Codecov.submit(process_folder())' diff --git a/Project.toml b/Project.toml new file mode 100644 index 0000000..e492f11 --- /dev/null +++ b/Project.toml @@ -0,0 +1,12 @@ +name = "BufferedStreams" +uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d" +version = "1.1.0" + +[compat] +julia = "1.6" + +[extras] +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["Test"] diff --git a/README.md b/README.md index 8c6fcda..c6475e5 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # BufferedStreams -[![](https://img.shields.io/github/release/BioJulia/BufferedStreams.jl.svg?style=flat-square)](https://github.com/BioJulia/BufferedStreams.jl/releases/latest) -[![](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://github.com/BioJulia/BufferedStreams.jl/blob/master/LICENSE) -[![](https://img.shields.io/badge/docs-stable-blue.svg?style=flat-square)](https://biojulia.github.io/BufferedStreams.jl/stable) -[![](https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square)](https://biojulia.github.io/BufferedStreams.jl/latest) + + +[![](https://img.shields.io/github/release/BioJulia/BufferedStreams.jl.svg?style=flat-square)](https://github.com/BioJulia/BufferedStreams.jl/releases/latest) +[![](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://github.com/BioJulia/BufferedStreams.jl/blob/master/LICENSE) +[![Build Status](https://github.com/BioJulia/BufferedStreams.jl/workflows/CI/badge.svg)](https://github.com/BioJulia/BufferedStreams.jl/actions?query=workflows/CI) [![codecov](https://codecov.io/gh/BioJulia/BufferedStreams.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/BioJulia/BufferedStreams.jl) +[![](https://img.shields.io/badge/docs-stable-blue.svg?style=flat-square)](https://biojulia.github.io/BufferedStreams.jl/stable) [![Project Status: Inactive](https://www.repostatus.org/badges/latest/inactive.svg)](https://www.repostatus.org/#inactive) [![Chat on Discord](https://img.shields.io/badge/discord-chat-blue.svg?style=flat-square&logo=discord&colorB=%237289DA)](https://discord.gg/z73YNFz) @@ -18,23 +20,12 @@ automatically making incremental reading and writing faster. ```julia using Pkg -add("BufferedStreams") -# Pkg.add("BufferedStreams") on julia prior to v0.7 +Pkg.add("BufferedStreams") ``` If you are interested in the cutting edge of the development, please check out the master branch to try new features before release. - -## Testing - -BufferedStreams is tested against Julia `0.7` and `1.0` on Linux, OS X, and Windows. - -| **PackageEvaluator** | **Latest Build Status** | -|:--------------------:|:-----------------------:| -| [![](https://pkg.julialang.org/badges/BufferedStreams_0.7.svg)](https://pkg.julialang.org/detail/BufferedStreams) [![](https://pkg.julialang.org/badges/BufferedStreams_1.0.svg)](https://pkg.julialang.org/detail/BufferedStreams) | [![](https://img.shields.io/travis/BioJulia/BufferedStreams.jl/master.svg?label=Linux+/+macOS)](https://travis-ci.org/BioJulia/BufferedStreams.jl) [![](https://ci.appveyor.com/api/projects/status/0f7jv901adjmp8o7?svg=true)](https://ci.appveyor.com/project/Ward9250/bufferedstreams-jl/branch/master) [![](https://codecov.io/gh/BioJulia/BufferedStreams.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/BioJulia/BufferedStreams.jl) | - - ## Contributing We appreciate contributions from users including reporting bugs, fixing diff --git a/REQUIRE b/REQUIRE deleted file mode 100644 index 5a10078..0000000 --- a/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 0.7 -Compat diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index d586f10..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,42 +0,0 @@ -environment: - matrix: - - Julia_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.7/julia-0.7-latest-win64.exe" - - Julia_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" - -matrix: - allow_failures: - - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" - -branches: - only: - - master - - /release-.*/ - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12" -# if there's a newer build queued for the same PR, cancel this one - - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` - https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` - Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` - throw "There are newer queued builds for this pull request, failing early." } -# Download most recent Julia Windows binary - - ps: (new-object net.webclient).DownloadFile( - $env:JULIA_URL, - "C:\projects\julia-binary.exe") -# Run installer silently, output to C:\projects\julia - - C:\projects\julia-binary.exe /S /D=C:\projects\julia - -build_script: -# Need to convert from shallow to complete for Pkg.clone to work - - IF EXIST .git\shallow (git fetch --unshallow) - - C:\projects\julia\bin\julia -e "versioninfo(); - Pkg.clone(pwd(), \"BufferedStreams\"); Pkg.build(\"BufferedStreams\")" - -test_script: - - C:\projects\julia\bin\julia -e "Pkg.test(\"BufferedStreams\")" diff --git a/docs/Manifest.toml b/docs/Manifest.toml new file mode 100644 index 0000000..db50c95 --- /dev/null +++ b/docs/Manifest.toml @@ -0,0 +1,103 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.8.0-rc1" +manifest_format = "2.0" +project_hash = "314c8c0d5d781207b79a84bba2324642088c07db" + +[[deps.ANSIColoredPrinters]] +git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c" +uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9" +version = "0.0.1" + +[[deps.Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[deps.BufferedStreams]] +path = ".." +uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d" +version = "1.0.0" + +[[deps.Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "b19534d1895d702889b219c382a6e18010797f0b" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.8.6" + +[[deps.Documenter]] +deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] +git-tree-sha1 = "f7809f532671564e48cd81627ddcfb1ba670f87d" +uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +version = "0.27.19" + +[[deps.IOCapture]] +deps = ["Logging", "Random"] +git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a" +uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" +version = "0.2.2" + +[[deps.InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.3" + +[[deps.LibGit2]] +deps = ["Base64", "NetworkOptions", "Printf", "SHA"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[deps.Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[deps.Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.Parsers]] +deps = ["Dates"] +git-tree-sha1 = "1285416549ccfcdf0c50d4997a94331e88d68413" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.3.1" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[deps.REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[deps.Random]] +deps = ["SHA", "Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[deps.Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 0000000..c6358c2 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,3 @@ +[deps] +BufferedStreams = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d" +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" diff --git a/docs/make.jl b/docs/make.jl index 8f8e46e..ed2deaa 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,7 +1,10 @@ using Documenter, BufferedStreams makedocs( - format = :html, + format = Documenter.HTML( + prettyurls = !("local" in ARGS), + canonical = "https://biojulia.net/BufferedStreams.jl/stable/", + ), sitename = "BufferedStreams", pages = [ "Home" => "index.md", @@ -13,9 +16,5 @@ makedocs( deploydocs( repo = "github.com/BioJulia/BufferedStreams.jl.git", - julia = "1.0", - osname = "linux", target = "build", - deps = nothing, - make = nothing ) diff --git a/docs/src/index.md b/docs/src/index.md index 353d0fc..7382fda 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,10 +1,12 @@ # BufferedStreams -[![](https://img.shields.io/github/release/BioJulia/BufferedStreams.jl.svg?style=flat-square)](https://github.com/BioJulia/BufferedStreams.jl/releases/latest) -[![](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://github.com/BioJulia/BufferedStreams.jl/blob/master/LICENSE) -[![](https://img.shields.io/badge/docs-stable-blue.svg?style=flat-square)](https://biojulia.github.io/BufferedStreams.jl/stable) -[![](https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square)](https://biojulia.github.io/BufferedStreams.jl/latest) -![Lifecycle](https://img.shields.io/badge/lifecycle-stable-green.svg?style=flat-square) + + +[![](https://img.shields.io/github/release/BioJulia/BufferedStreams.jl.svg?style=flat-square)](https://github.com/BioJulia/BufferedStreams.jl/releases/latest) +[![](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://github.com/BioJulia/BufferedStreams.jl/blob/master/LICENSE) +[![Build Status](https://github.com/BioJulia/BufferedStreams.jl/workflows/CI/badge.svg)](https://github.com/BioJulia/BufferedStreams.jl/actions?query=workflows/CI) [![codecov](https://codecov.io/gh/BioJulia/BufferedStreams.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/BioJulia/BufferedStreams.jl) +[![](https://img.shields.io/badge/docs-stable-blue.svg?style=flat-square)](https://biojulia.github.io/BufferedStreams.jl/stable) +[![Project Status: Inactive](https://www.repostatus.org/badges/latest/inactive.svg)](https://www.repostatus.org/#inactive) [![Chat on Discord](https://img.shields.io/badge/discord-chat-blue.svg?style=flat-square&logo=discord&colorB=%237289DA)](https://discord.gg/z73YNFz) @@ -18,23 +20,12 @@ automatically making incremental reading and writing faster. ```julia using Pkg -add("BufferedStreams") -# Pkg.add("BufferedStreams") on julia prior to v0.7 +Pkg.add("BufferedStreams") ``` If you are interested in the cutting edge of the development, please check out the master branch to try new features before release. - -## Testing - -BufferedStreams is tested against Julia `0.7` and `1.0` on Linux, OS X, and Windows. - -| **PackageEvaluator** | **Latest Build Status** | -|:--------------------:|:-----------------------:| -| [![](https://pkg.julialang.org/badges/BufferedStreams_0.7.svg)](https://pkg.julialang.org/detail/BufferedStreams) [![](https://pkg.julialang.org/badges/BufferedStreams_1.0.svg)](https://pkg.julialang.org/detail/BufferedStreams) | [![](https://img.shields.io/travis/BioJulia/BufferedStreams.jl/master.svg?label=Linux+/+macOS)](https://travis-ci.org/BioJulia/BufferedStreams.jl) [![](https://ci.appveyor.com/api/projects/status/0f7jv901adjmp8o7?svg=true)](https://ci.appveyor.com/project/Ward9250/bufferedstreams-jl/branch/master) [![](https://codecov.io/gh/BioJulia/BufferedStreams.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/BioJulia/BufferedStreams.jl) | - - ## Contributing We appreciate contributions from users including reporting bugs, fixing diff --git a/src/BufferedStreams.jl b/src/BufferedStreams.jl index a9e3c27..a0fd2a1 100644 --- a/src/BufferedStreams.jl +++ b/src/BufferedStreams.jl @@ -3,7 +3,6 @@ module BufferedStreams export BufferedInputStream, BufferedOutputStream, - peek, peekbytes!, fillbuffer!, isanchored, diff --git a/src/bufferedinputstream.jl b/src/bufferedinputstream.jl index e300735..8bf4403 100644 --- a/src/bufferedinputstream.jl +++ b/src/bufferedinputstream.jl @@ -147,7 +147,7 @@ end """ Return the next byte from the input stream without advancing the position. """ -@inline function peek(stream::BufferedInputStream) +@inline function Base.peek(stream::BufferedInputStream) checkopen(stream) if stream.position > stream.available if fillbuffer!(stream) < 1