# Specify both an upper and a lower bound in Project.toml?

**URL:** https://discourse.julialang.org/t/specify-both-an-upper-and-a-lower-bound-in-project-toml/37027
**Category:** General Usage
**Tags:** question, package
**Created:** [April 4, 2020, 6:29pm UTC](https://discourse.julialang.org/t/specify-both-an-upper-and-a-lower-bound-in-project-toml/37027 "2020-04-04T18:29:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [April 4, 2020, 6:29pm UTC](https://discourse.julialang.org/t/specify-both-an-upper-and-a-lower-bound-in-project-toml/37027/1 "2020-04-04T18:29:31Z")

</div>

How do you specify numeric values for _both_ an upper and a lower bound for a package in `Project.toml`?

In particular, I would like to specify that a package is compatible with `1.90 ≤ PyCall < 2`. My first thought was

```julia
PyCall = "≥ 1.90, < 2"

```

but [the `Project.toml` documentation](https://julialang.github.io/Pkg.jl/v1/compatibility/index.html) states that it takes the _union_ of comma-separated values, whereas I want the _intersection_.

Nowadays the registry requires an upper bound for merging updates, and I don’t want to manually specify a list of minor versions like `"1.90, 1.91, 1.92, …"`.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [April 4, 2020, 6:41pm UTC](https://discourse.julialang.org/t/specify-both-an-upper-and-a-lower-bound-in-project-toml/37027/2 "2020-04-04T18:41:08Z")

</div>

The [source code](https://github.com/JuliaLang/Pkg.jl/blob/b6e2ac29effb8a636dd297735296589cf80e3bae/src/versions.jl#L313-L343) seems to indicate that this is impossible, even though the underlying `VersionRange` type seems to support it. ☹

It looks like [hyphenated ranges](https://github.com/JuliaLang/Pkg.jl/pull/1410) were added in Julia 1.4, but this looks like an inclusive range, where I want `< 2` rather than `≤ 2`

I filed an issue: [support specifying both lower and upper compatibility bounds · Issue #1748 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/1748)

---

<div class="post-metadata">

### Author: ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)
#### Post date: [April 4, 2020, 7:16pm UTC](https://discourse.julialang.org/t/specify-both-an-upper-and-a-lower-bound-in-project-toml/37027/3 "2020-04-04T19:16:56Z")

</div>

I thought this was what the caret did?

```julia
^1.90

```

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [April 4, 2020, 7:57pm UTC](https://discourse.julialang.org/t/specify-both-an-upper-and-a-lower-bound-in-project-toml/37027/4 "2020-04-04T19:57:59Z")

</div>

Oh duh, `^1.90` (or `1.90`, since `^` is the default) according to the semver spec means exactly `1.90 ≤ version < 2`.
