Repository: spack/spack

Issue:
Installation issue: py-plotly should not fix all versions of dependencies
### Steps to reproduce the issue

The plotly package incorrectly uses one and only one version of it's dependencies specified in upstream's requirements.txt instead of specifying a minimum version like upstream's setup.py:
https://github.com/plotly/plotly.py/blob/v2.2.0/setup.py#L49

This is is introducing a circular dependency in my trying to use a fewer version of py-deeptools@3.4.1 which has a bugfix my labmate needs.  I can't install a newer version of py-requests because py-plotly use a conflicting

```console
$ spack spec py-deeptools
Input spec
--------------------------------
py-deeptools

Concretized
--------------------------------
==> Error: An unsatisfiable version constraint has been detected for spec:

    py-requests@2.5.0:
        ^py-setuptools@24.3:
            ^python@2.7:2.8,3.5:
                ^pkgconfig@0.9.0:


while trying to concretize the partial spec:

    py-plotly@2.0.0:
        ^py-setuptools@24.3:
            ^python@2.7:2.8,3.5:
                ^pkgconfig@0.9.0:


py-plotly requires py-requests version 2.3.0, but spec asked for 2.5.0:
```

### Information on your system

<!-- Please include the output of `spack debug report` -->
```console
$ spack debug report
* **Spack:** 0.14.2
* **Python:** 3.6.9
* **Platform:** linux-ubuntu18.04-zen
```

<!-- If you have any relevant configuration detail (custom `packages.yaml` or `modules.yaml`, etc.) you can add that here as well. -->

```yaml
# /etc/spack/packages.yaml 
packages:
  all:
    permissions:
      write: group
      group: users
  r:
    paths:
      r@3.6.1: /usr/bin
    buildable: false
  # py-deeptools:
  #   providers:
  #     'python@3'
```

```yaml
# /etc/spack/repos.yaml 
repos:
- /var/spack/repos/corelab
- $spack/var/spack/repos/builtin
```

```yaml
# /etc/spack/mirrors.yaml 
mirrors:
  local: file:///var/spack/mirror
```

```console
$ tree -F /var/spack/mirror/
/var/spack/mirror/
├── jdk/
│   ├── jdk-11.0.4_10.tar.gz -> jdk-11.0.4_linux-x64_bin.tar.gz
│   └── jdk-11.0.4_linux-x64_bin.tar.gz
└── trf/
    └── trf409.linux64

2 directories, 3 files
```

### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [ ] I have uploaded the build log and environment files
- [x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:
The spec resolves after changing to an open range:

```diff
--- /opt/spack/var/spack/repos/builtin/packages/py-plotly/package.py    2020-01-01 00:00:04.176201792 -0500
+++ /var/spack/repos/corelab/packages/py-plotly/package.py      2020-05-09 17:52:40.378906186 -0400
@@ -15,6 +15,6 @@
     version('2.2.0', sha256='ca668911ffb4d11fed6d7fbb12236f8ecc6a7209db192326bcb64bdb41451a58')
 
     depends_on('py-setuptools', type='build')
-    depends_on('py-requests@2.3.0', type=('build', 'run'))
-    depends_on('py-six@1.8.0', type=('build', 'run'))
-    depends_on('py-pytz@2014.9', type=('build', 'run'))
+    depends_on('py-requests@2.3.0:', type=('build', 'run'))
+    depends_on('py-six@1.8.0:', type=('build', 'run'))
+    depends_on('py-pytz@2014.9:', type=('build', 'run'))
```

```console
$ spack spec py-deeptools ^corelab.py-plotly
Input spec
--------------------------------
py-deeptools
    ^py-plotly

Concretized
--------------------------------
py-deeptools@3.3.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
    ^py-deeptoolsintervals@0.1.9%gcc@7.4.0 arch=linux-ubuntu18.04-zen
        ^py-setuptools@46.1.3%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^python@3.7.7%gcc@7.4.0+bz2+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tix~tkinter~ucs4~uuid+zlib arch=linux-ubuntu18.04-zen
                ^bzip2@1.0.8%gcc@7.4.0+shared arch=linux-ubuntu18.04-zen
                    ^diffutils@3.7%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                        ^libiconv@1.16%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^expat@2.2.9%gcc@7.4.0+libbsd arch=linux-ubuntu18.04-zen
                    ^libbsd@0.10.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^gdbm@1.18.1%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                    ^readline@8.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                        ^ncurses@6.2%gcc@7.4.0~symlinks+termlib arch=linux-ubuntu18.04-zen
                            ^pkgconf@1.6.3%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^gettext@0.20.2%gcc@7.4.0+bzip2+curses+git~libunistring+libxml2+tar+xz arch=linux-ubuntu18.04-zen
                    ^libxml2@2.9.10%gcc@7.4.0~python arch=linux-ubuntu18.04-zen
                        ^xz@5.2.5%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                        ^zlib@1.2.11%gcc@7.4.0+optimize+pic+shared arch=linux-ubuntu18.04-zen
                    ^tar@1.32%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^libffi@3.3%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^openssl@1.1.1g%gcc@7.4.0+systemcerts arch=linux-ubuntu18.04-zen
                    ^perl@5.30.2%gcc@7.4.0+cpanm+shared+threads arch=linux-ubuntu18.04-zen
                ^sqlite@3.31.1%gcc@7.4.0+column_metadata+fts~functions~rtree arch=linux-ubuntu18.04-zen
    ^py-matplotlib@3.2.1%gcc@7.4.0~animation backend=agg +image~latex~movies arch=linux-ubuntu18.04-zen
        ^freetype@2.10.1%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^libpng@1.6.37%gcc@7.4.0 arch=linux-ubuntu18.04-zen
        ^py-cycler@0.10.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-six@1.14.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
        ^py-kiwisolver@1.1.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
        ^py-numpy@1.18.4%gcc@7.4.0+blas+lapack arch=linux-ubuntu18.04-zen
            ^openblas@0.3.9%gcc@7.4.0~consistent_fpcsr~ilp64+pic+shared threads=none arch=linux-ubuntu18.04-zen
            ^py-cython@0.29.16%gcc@7.4.0 arch=linux-ubuntu18.04-zen
        ^py-pillow@7.0.0%gcc@7.4.0~freetype~jpeg2000~lcms~tiff~webp~webpmux arch=linux-ubuntu18.04-zen
            ^libjpeg-turbo@2.0.3%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^cmake@3.17.1%gcc@7.4.0~doc+ncurses+openssl+ownlibs patches=1c540040c7e203dd8e27aa20345ecb07fe06570d56410a24a266ae570b1c4c39 ~qt arch=linux-ubuntu18.04-zen
                ^nasm@2.14.02%gcc@7.4.0 arch=linux-ubuntu18.04-zen
        ^py-pyparsing@2.4.2%gcc@7.4.0 arch=linux-ubuntu18.04-zen
        ^py-python-dateutil@2.8.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-setuptools-scm@3.3.3%gcc@7.4.0 arch=linux-ubuntu18.04-zen
    ^py-numpydoc@0.6.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
        ^py-sphinx@3.0.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-alabaster@0.7.12%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-babel@2.7.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^py-pytz@2019.3%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-docutils@0.15.2%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-imagesize@1.1.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-jinja2@2.10.3%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^py-markupsafe@1.1.1%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-packaging@19.2%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-pygments@2.4.2%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-requests@2.22.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^py-certifi@2019.9.11%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^py-chardet@3.0.4%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                    ^py-pytest-runner@5.1%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^py-idna@2.8%gcc@7.4.0 arch=linux-ubuntu18.04-zen
                ^py-urllib3@1.25.6%gcc@7.4.0~secure~socks arch=linux-ubuntu18.04-zen
            ^py-snowballstemmer@2.0.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-sphinxcontrib-applehelp@1.0.1%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-sphinxcontrib-devhelp@1.0.1%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-sphinxcontrib-htmlhelp@1.0.2%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-sphinxcontrib-jsmath@1.0.1%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-sphinxcontrib-qthelp@1.0.2%gcc@7.4.0 arch=linux-ubuntu18.04-zen
            ^py-sphinxcontrib-serializinghtml@1.1.3%gcc@7.4.0 arch=linux-ubuntu18.04-zen
    ^py-plotly@2.2.0%gcc@7.4.0 arch=linux-ubuntu18.04-zen
    ^py-py2bit@0.2.1%gcc@7.4.0 arch=linux-ubuntu18.04-zen
    ^py-pybigwig@0.3.4%gcc@7.4.0 arch=linux-ubuntu18.04-zen
        ^curl@7.68.0%gcc@7.4.0~darwinssl~gssapi~libssh~libssh2~nghttp2 arch=linux-ubuntu18.04-zen
    ^py-pysam@0.14.1%gcc@7.4.0 arch=linux-ubuntu18.04-zen
        ^bcftools@1.10.2%gcc@7.4.0~libgsl~perl-filters arch=linux-ubuntu18.04-zen
            ^htslib@1.10.2%gcc@7.4.0+libcurl arch=linux-ubuntu18.04-zen
        ^samtools@1.10%gcc@7.4.0 arch=linux-ubuntu18.04-zen
    ^py-scipy@1.4.1%gcc@7.4.0 arch=linux-ubuntu18.04-zen
        ^py-pybind11@2.5.0%gcc@7.4.0 build_type=RelWithDebInfo arch=linux-ubuntu18.04-zen
```

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/py-plotly/package.py b/var/spack/repos/builtin/packages/py-plotly/package.py
--- a/var/spack/repos/builtin/packages/py-plotly/package.py
+++ b/var/spack/repos/builtin/packages/py-plotly/package.py
@@ -15,6 +15,8 @@ class PyPlotly(PythonPackage):
     version('2.2.0', sha256='ca668911ffb4d11fed6d7fbb12236f8ecc6a7209db192326bcb64bdb41451a58')
 
     depends_on('py-setuptools', type='build')
-    depends_on('py-requests@2.3.0', type=('build', 'run'))
-    depends_on('py-six@1.8.0', type=('build', 'run'))
-    depends_on('py-pytz@2014.9', type=('build', 'run'))
+    depends_on('py-decorator@4.0.6:', type=('build', 'run'))
+    depends_on('py-nbformat@4.2.0:', type=('build', 'run'))
+    depends_on('py-requests', type=('build', 'run'))
+    depends_on('py-six', type=('build', 'run'))
+    depends_on('py-pytz', type=('build', 'run'))


Test patch: