Skip to content

Commit 3b67082

Browse files
committed
[WIP] [NDTensors] Vendor TypeParameterAccessors.jl
1 parent 59058d3 commit 3b67082

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

NDTensors/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "NDTensors"
22
uuid = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
33
authors = ["Matthew Fishman <[email protected]>"]
4-
version = "0.4.13"
4+
version = "0.4.14"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"

NDTensors/vendor/Project.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[deps]
2+
PackageAnalyzer = "e713c705-17e4-4cec-abe0-95bf5bf3e10c"
3+
4+
[compat]
5+
PackageAnalyzer = "3.1"

NDTensors/vendor/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# vendor
2+
3+
Here we vendor some of our dependencies to load our own copies of them. This means:
4+
5+
- the functions defined in them are not shared with the "real" package they come from, so we do not see method extensions of them
6+
- we have our own private copy of the module, allowing us to load a different version than the user
7+
8+
To update the dependencies, install the `vendor` environment and invoke `run.jl`:
9+
10+
```sh
11+
julia --project=vendor -e 'using Pkg; Pkg.instantiate()'
12+
julia --project=vendor vendor/run.jl
13+
```

NDTensors/vendor/run.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using PackageAnalyzer: PackageAnalyzer
2+
3+
deps = [("TypeParameterAccessors", v"0.3.11")]
4+
5+
for (name, version) in deps
6+
pkg = PackageAnalyzer.find_package(name; version)
7+
local_path, reachable, _ = PackageAnalyzer.obtain_code(pkg)
8+
@assert reachable
9+
p = mkpath(joinpath(@__DIR__, "..", "src", "vendored", name))
10+
# remove any existing files
11+
if isdir(p)
12+
rm(p; recursive = true, force = true)
13+
end
14+
mkpath(joinpath(p, "src"))
15+
cp(joinpath(local_path, "src"), joinpath(p, "src"); force = true)
16+
end

0 commit comments

Comments
 (0)