Repository: scikit-hep/pyhf

Issue:
loosen numpy requirements for non-extra installs
# Description

we are pretty restrictive in the numpy version range due to trying to conform to TF's valid range, but TF is only one of the backends. If just installing `pip install pyhf` we should not force users to a speciic range unless we require the APIs

`numpy>=1.14.0` should be enough unless i'm missing something. @kratsg since you changed this last, any reason you see to restrict numpy further?


Discussion:
Related, I'm seeing conflicts in PR #228 and I now see that we have [`tensorflow==1.10.0` and `coverage==4.0.3`](https://github.com/diana-hep/pyhf/commit/4b9bad19ce500ad838ff3b4dab34d466e25fa18e#diff-2eeaed663bd0d25b7e608891384b7298R28) and [`jsonschema==v3.0.0a2`](https://github.com/diana-hep/pyhf/commit/7ac7d12bed83922bdf16fbbf3240286358c30be1#diff-2eeaed663bd0d25b7e608891384b7298R51).

@kratsg @lukasheinrich Do `coverage` and `jsonschema` need to be pinned to those exact versions? Also, why is `tensorflow` pinned at all? 
I'm not sure why tensorflow is pinned. maybe @kratsg knows? I think `jsonschema` is there because of the discussin @kratsg had here: https://github.com/Julian/jsonschema/issues/454#issuecomment-414709969 `coverage` could be released but pytest has a minimum requirement
Yeah, I unpinned tensorflow in PR #228 (now set to `tensorflow>=1.10.0`), and I somewhat answered my questions with regards to `coverage` (now set to `coverage>=4.0`) and `jsonschema` just by playing around with installs in a Docker container. Thanks for the link though, that's helpful info.

We should still look at if we can set `numpy>=1.14.0` though.
yes, that would be good
I think the difficult thing here (and I could be wrong, I'm not super well versed in all this) is that as `extras_require` is a
> ...[dictionary mapping names of “extras” (optional features of your project)](https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords)...

with the emphasis on "optional", then `install_requires` will always take precedence.

So if I were to do
```
git clone https://github.com/diana-hep/pyhf.git && cd pyhf
sed -i -e 's/numpy<=1.14.5,>=1.14.3/numpy>=1.14.0/' setup.py
pip install -e .[tensorflow]
```
then during the install you get the warning
```
tensorflow 1.10.1 has requirement numpy<=1.14.5,>=1.13.3, but you'll have numpy 1.15.1 which is incompatible.
```
as
```
pip freeze | grep numpy
numpy==1.15.1
```

So I guess the question here is if it is possible to tell setuptools that it should give precedence to `extras_require` and/or override `install_requires` with `extras_require`?

I've also [asked about this on SO](https://stackoverflow.com/questions/52192492/possible-to-have-setuptools-extras-require-override-requirement-from-install-req) in case that speeds things up.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -9,8 +9,7 @@
   packages = find_packages(),
   include_package_data = True,
   install_requires = [
-    'numpy<=1.14.5,>=1.14.3',  # required by tensorflow, mxnet, and us
-    'scipy',
+    'scipy',  # requires numpy, which is required by pyhf, tensorflow, and mxnet
     'click>=6.0',  # for console scripts,
     'tqdm',  # for readxml
     'six',  # for modifiers
@@ -31,7 +30,7 @@
     ],
     'tensorflow':[
        'tensorflow>=1.10.0',
-       'numpy<=1.14.5,>=1.13.3',
+       'numpy<=1.14.5,>=1.14.0',  # Lower of 1.14.0 instead of 1.13.3 to ensure doctest pass
        'setuptools<=39.1.0',
     ],
     'develop': [


Test patch: