from setuptools import setup

extras_require = {
    'shellcomplete': ['click_completion'],
    'tensorflow': [
        'tensorflow~=2.2.0',  # TensorFlow minor releases are as volatile as major
        'tensorflow-probability~=0.10.0',
    ],
    'torch': ['torch~=1.2'],
    'jax': ['jax~=0.2.4', 'jaxlib~=0.1.56'],
    'xmlio': [
        'uproot3~=3.14',
        'uproot~=4.0',
    ],  # uproot3 required until writing to ROOT supported in uproot4
    'minuit': ['iminuit~=2.1'],
}
extras_require['backends'] = sorted(
    set(
        extras_require['tensorflow']
        + extras_require['torch']
        + extras_require['jax']
        + extras_require['minuit']
    )
)
extras_require['contrib'] = sorted({'matplotlib', 'requests'})
extras_require['lint'] = sorted({'flake8', 'black'})

extras_require['test'] = sorted(
    set(
        extras_require['backends']
        + extras_require['xmlio']
        + extras_require['contrib']
        + extras_require['shellcomplete']
        + [
            'pytest~=6.0',
            'pytest-cov>=2.5.1',
            'pytest-mock',
            'pytest-benchmark[histogram]',
            'pytest-console-scripts',
            'pytest-mpl',
            'pydocstyle',
            'coverage>=4.0',  # coveralls
            'papermill~=2.0',
            'nteract-scrapbook~=0.2',
            'jupyter',
            'graphviz',
            'jsonpatch',
        ]
    )
)
extras_require['docs'] = sorted(
    set(
        extras_require['xmlio']
        + [
            'sphinx>=3.1.2',
            'sphinxcontrib-bibtex~=2.1',
            'sphinx-click',
            'sphinx_rtd_theme',
            'nbsphinx',
            'ipywidgets',
            'sphinx-issues',
            'sphinx-copybutton>0.2.9',
        ]
    )
)
extras_require['develop'] = sorted(
    set(
        extras_require['docs']
        + extras_require['lint']
        + extras_require['test']
        + [
            'nbdime',
            'bump2version',
            'ipython',
            'pre-commit',
            'check-manifest',
            'codemetapy>=0.3.4',
            'twine',
        ]
    )
)
extras_require['complete'] = sorted(set(sum(extras_require.values(), [])))


setup(
    extras_require=extras_require,
    use_scm_version=lambda: {'local_scheme': lambda version: ''},
)

setup.py
from setuptools import setup

extras_require = {
    'shellcomplete': ['click_completion'],
    'tensorflow': [
        'tensorflow~=2.2.0',  # TensorFlow minor releases are as volatile as major
        'tensorflow-probability~=0.10.0',
    ],
    'torch': ['torch~=1.2'],
    'jax': ['jax~=0.2.4', 'jaxlib~=0.1.56'],
    'xmlio': [
        'uproot3~=3.14',
        'uproot~=4.0',
    ],  # uproot3 required until writing to ROOT supported in uproot4
    'minuit': ['iminuit~=2.1'],
}
extras_require['backends'] = sorted(
    set(
        extras_require['tensorflow']
        + extras_require['torch']
        + extras_require['jax']
        + extras_require['minuit']
    )
)
extras_require['contrib'] = sorted({'matplotlib', 'requests'})
extras_require['lint'] = sorted({'flake8', 'black'})

extras_require['test'] = sorted(
    set(
        extras_require['backends']
        + extras_require['xmlio']
        + extras_require['contrib']
        + extras_require['shellcomplete']
        + [
            'pytest~=6.0',
            'pytest-cov>=2.5.1',
            'pytest-mock',
            'pytest-benchmark[histogram]',
            'pytest-console-scripts',
            'pytest-mpl',
            'pydocstyle',
            'papermill~=2.0',
            'nteract-scrapbook~=0.2',
            'jupyter',
            'graphviz',
        ]
    )
)
extras_require['docs'] = sorted(
    set(
        extras_require['xmlio']
        + [
            'sphinx>=3.1.2',
            'sphinxcontrib-bibtex~=2.1',
            'sphinx-click',
            'sphinx_rtd_theme',
            'nbsphinx',
            'ipywidgets',
            'sphinx-issues',
            'sphinx-copybutton>0.2.9',
        ]
    )
)
extras_require['develop'] = sorted(
    set(
        extras_require['docs']
        + extras_require['lint']
        + extras_require['test']
        + [
            'nbdime',
            'bump2version',
            'ipython',
            'pre-commit',
            'check-manifest',
            'codemetapy>=0.3.4',
            'twine',
        ]
    )
)
extras_require['complete'] = sorted(set(sum(extras_require.values(), [])))


setup(
    extras_require=extras_require,
    use_scm_version=lambda: {'local_scheme': lambda version: ''},
)

setup.py
diff --git a/setup.py b/setup.py
index 735722f91b..d2f6a27400 100644
--- a/setup.py
+++ b/setup.py
@@ -39,12 +39,10 @@
             'pytest-console-scripts',
             'pytest-mpl',
             'pydocstyle',
-            'coverage>=4.0',  # coveralls
             'papermill~=2.0',
             'nteract-scrapbook~=0.2',
             'jupyter',
             'graphviz',
-            'jsonpatch',
         ]
     )
 )

Remove duplicated libraries in setup.py
# Description

In `setup.py` and `setup.cfg` there are some duplicated libraries that should be removed from `setup.py`.

https://github.com/scikit-hep/pyhf/blob/75f3cd350ed3986d16d680fbb83f312791aafd68/setup.py#L47

already exists as a core requirement in `setup.cfg`

https://github.com/scikit-hep/pyhf/blob/75f3cd350ed3986d16d680fbb83f312791aafd68/setup.cfg#L45

and so should be removed from `setup.py`.

It also isn't clear if 

https://github.com/scikit-hep/pyhf/blob/75f3cd350ed3986d16d680fbb83f312791aafd68/setup.py#L42

is still required, given that it was added back in PR #186 when we still used Coveralls for coverage.

