# Compat entry for non-dependency

**URL:** https://discourse.julialang.org/t/compat-entry-for-non-dependency/91590
**Category:** General Usage
**Tags:** question
**Created:** [December 13, 2022, 9:36am UTC](https://discourse.julialang.org/t/compat-entry-for-non-dependency/91590 "2022-12-13T09:36:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [December 13, 2022, 9:36am UTC](https://discourse.julialang.org/t/compat-entry-for-non-dependency/91590/1 "2022-12-13T09:36:24Z")

</div>

In the `Project.toml` of package `A`, I would like to restrict compatibility for package `B` that is **not** a dependency.

> **(why I am doing this)**
>
> The motivation is following up on an array index ordering change of [MCMCDiagnosticTools.jl](https://github.com/TuringLang/MCMCDiagnosticTools.jl/pull/50) which is not a direct dependency of DynamicHMC.jl, but the latter has a utility function for stacking posteriors in this order and I don’t want users to accidentally end up with incompatible arrays.

The following works:

```nohighlight
[extras]
B = "uuid of B"

[compat]
B = "the.version"

```

but I am not sure if it is the indended API, I find `[extras]` to be somewhat underdocumented.

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [December 13, 2022, 9:50am UTC](https://discourse.julialang.org/t/compat-entry-for-non-dependency/91590/2 "2022-12-13T09:50:32Z")

</div>

As far as I know that’s what you can do for now. Julia 1.9 will bring more possibilities and some more documentation. See [add support for package extensions by KristofferC · Pull Request #3264 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/3264).

---

<div class="post-metadata">

### Author: ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)
#### Post date: [December 13, 2022, 12:16pm UTC](https://discourse.julialang.org/t/compat-entry-for-non-dependency/91590/3 "2022-12-13T12:16:34Z")

</div>

> [@Tamas\_Papp](#):
>
> The following works:

As far as my testing goes prior to julia 1.9 this only works for the environment of `A`, if you add `A` and `B` to environment `C` you might still get incompatible versions.
