Skip to content

Commit 1956b02

Browse files
authored
Merge pull request #52 from KristofferC/kc/pkg
get rid of Pkg dependency
2 parents 552315c + 20d38a8 commit 1956b02

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

Project.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name = "AutoHashEquals"
22
uuid = "15f4f7f2-30c1-5605-9d31-71845cf9641f"
33
authors = ["Neal Gafter <[email protected]>", "andrew cooke <[email protected]>"]
4-
version = "2.1.0"
5-
6-
[deps]
7-
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
4+
version = "2.2.0"
85

96
[compat]
10-
julia = "1.8"
7+
julia = "1.9"

src/impl.jl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
using Pkg
2-
31
const is_expr = Base.Meta.isexpr
42

5-
function pkgversion(m::Module)
6-
pkgdir = dirname(string(first(methods(m.eval)).file))
7-
toml = Pkg.TOML.parsefile(joinpath(pkgdir, "..", "Project.toml"))
8-
VersionNumber(toml["version"])
9-
end
10-
113
function if_has_package(
124
action::Function,
135
name::String,
@@ -17,7 +9,7 @@ function if_has_package(
179
pkgid = Base.PkgId(uuid, name)
1810
if Base.root_module_exists(pkgid)
1911
pkg = Base.root_module(pkgid)
20-
if pkgversion(pkg) >= version
12+
if Base.pkgversion(pkg) >= version
2113
return action(pkg)
2214
end
2315
end

0 commit comments

Comments
 (0)