From eb1574ac87164440356553b878d3aa53164453cc Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Fri, 14 Feb 2025 12:19:50 -0400 Subject: [PATCH 1/2] Mark symbols public instead of exporting. Given the nature of this package, I think we should encourage explicit import of functionality in the packages that depend on GPUToolbox. I originally didn't implement this, as Compat.jl adds a bunch of standard library dependencies to this no-dependency package, but then I found https://discourse.julialang.org/t/is-compat-jl-worth-it-for-the-public-keyword/119041/11. It's not pretty, but it works. Technically breaking, but all backends already explicity import the GPUToolbox functionality that they use, so it'll just be a matter of me adding "0.2" to the compat. --- Project.toml | 2 +- README.md | 2 +- src/ccalls.jl | 5 +++-- src/simpleversion.jl | 4 +++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 4d76b97..6dc11c7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "GPUToolbox" uuid = "096a3bc2-3ced-46d0-87f4-dd12716f4bfc" -version = "0.1.0" +version = "0.2.0" [compat] julia = "1.10" diff --git a/README.md b/README.md index cc9de1b..704a8e2 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ ## Functionality -This package currently exports the following: +This package currently has the following public symbols: - `SimpleVersion`: a GPU-compatible version number - `@sv_str`: constructs a SimpleVersion from a string - `@checked`: Add to a function definition to generate an unchecked and a checked version. diff --git a/src/ccalls.jl b/src/ccalls.jl index 3fe88e0..3b31c55 100644 --- a/src/ccalls.jl +++ b/src/ccalls.jl @@ -1,7 +1,8 @@ # utilities for calling foreign functionality more conveniently -export @checked, @debug_ccall, @gcsafe_ccall - +if VERSION >= v"1.11.0-DEV.469" + eval(Meta.parse("public @checked, @debug_ccall, @gcsafe_ccall")) +end ## function wrapper for checking the return value of a function diff --git a/src/simpleversion.jl b/src/simpleversion.jl index c5fa439..13503e6 100644 --- a/src/simpleversion.jl +++ b/src/simpleversion.jl @@ -1,4 +1,6 @@ -export SimpleVersion, @sv_str +if VERSION >= v"1.11.0-DEV.469" + eval(Meta.parse("public SimpleVersion, @sv_str")) +end """ SimpleVersion(major, [minor]) From 7e5edfa0d96837f9f7d9b80829dc3058237966da Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:49:04 -0400 Subject: [PATCH 2/2] Fix tests --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 2a93553..7c3436c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,5 @@ using Test -using GPUToolbox +using GPUToolbox: SimpleVersion, @sv_str @testset "GPUToolbox.jl" begin @testset "SimpleVersion" begin