Skip to content

Commit 16fc8e7

Browse files
matthewfeickertlukasheinrich
authored andcommitted
docs: Use pip best practices with python -m pip (#730)
* Use pip best practices in the docs by using 'python -m pip'
1 parent 92750ae commit 16fc8e7

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sphinx:
1212
# Optionally build your docs in additional formats such as PDF and ePub
1313
formats: all
1414

15-
# pip install .[docs]
15+
# python -m pip install .[docs]
1616
python:
1717
version: 3.7
1818
install:

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,18 @@ bin 2: nobs = 145, b = 150, db = 20., nom_sig = 45.
9696

9797
To install `pyhf` from PyPI with the NumPy backend run
9898
```bash
99-
pip install pyhf
99+
python -m pip install pyhf
100100
```
101101

102-
and to install `pyhf` with additional backends run
102+
and to install `pyhf` with all additional backends run
103103
```bash
104-
pip install pyhf[tensorflow,torch]
104+
python -m pip install pyhf[backends]
105105
```
106106
or a subset of the options.
107107

108108
To uninstall run
109109
```bash
110-
pip uninstall pyhf
110+
python -m pip uninstall pyhf
111111
```
112112

113113
## Authors

docs/development.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and install all necessary packages for development
1111

1212
.. code-block:: console
1313
14-
pip install --ignore-installed -U -e .[complete]
14+
python -m pip install --ignore-installed -U -e .[complete]
1515
1616
Then setup the Git pre-commit hook for `Black <https://github.com/psf/black>`__ by running
1717

docs/examples/notebooks/XML_ImportExport.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"metadata": {},
1414
"outputs": [],
1515
"source": [
16-
"# NB: pip install pyhf[xmlio]\n",
16+
"# NB: python -m pip install pyhf[xmlio]\n",
1717
"import pyhf"
1818
]
1919
},

docs/installation.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,43 +29,43 @@ Install latest stable release from `PyPI <https://pypi.org/project/pyhf/>`__...
2929

3030
.. code-block:: console
3131
32-
pip install pyhf
32+
python -m pip install pyhf
3333
3434
... with TensorFlow backend
3535
+++++++++++++++++++++++++++
3636

3737
.. code-block:: console
3838
39-
pip install pyhf[tensorflow]
39+
python -m pip install pyhf[tensorflow]
4040
4141
... with PyTorch backend
4242
++++++++++++++++++++++++
4343

4444
.. code-block:: console
4545
46-
pip install pyhf[torch]
46+
python -m pip install pyhf[torch]
4747
4848
... with JAX backend
4949
++++++++++++++++++++
5050

5151
.. code-block:: console
5252
53-
pip install pyhf[jax]
53+
python -m pip install pyhf[jax]
5454
5555
... with all backends
5656
+++++++++++++++++++++
5757

5858
.. code-block:: console
5959
60-
pip install pyhf[backends]
60+
python -m pip install pyhf[backends]
6161
6262
6363
... with xml import/export functionality
6464
++++++++++++++++++++++++++++++++++++++++
6565

6666
.. code-block:: console
6767
68-
pip install pyhf[xmlio]
68+
python -m pip install pyhf[xmlio]
6969
7070
7171
Install latest development version from `GitHub <https://github.com/scikit-hep/pyhf>`__...
@@ -76,43 +76,43 @@ Install latest development version from `GitHub <https://github.com/scikit-hep/p
7676

7777
.. code-block:: console
7878
79-
pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf"
79+
python -m pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf"
8080
8181
... with TensorFlow backend
8282
+++++++++++++++++++++++++++
8383

8484
.. code-block:: console
8585
86-
pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf[tensorflow]"
86+
python -m pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf[tensorflow]"
8787
8888
... with PyTorch backend
8989
++++++++++++++++++++++++
9090

9191
.. code-block:: console
9292
93-
pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf[torch]"
93+
python -m pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf[torch]"
9494
9595
... with JAX backend
9696
++++++++++++++++++++++
9797

9898
.. code-block:: console
9999
100-
pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf[jax]"
100+
python -m pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf[jax]"
101101
102102
... with all backends
103103
+++++++++++++++++++++
104104

105105
.. code-block:: console
106106
107-
pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf[backends]"
107+
python -m pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf[backends]"
108108
109109
110110
... with xml import/export functionality
111111
++++++++++++++++++++++++++++++++++++++++
112112

113113
.. code-block:: console
114114
115-
pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf[xmlio]"
115+
python -m pip install --ignore-installed -U "git+https://github.com/scikit-hep/pyhf.git#egg=pyhf[xmlio]"
116116
117117
118118
Updating :code:`pyhf`

src/pyhf/cli/rootio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def xml2json(entrypoint_xml, basedir, output_file, track_progress):
4545
except ImportError:
4646
log.error(
4747
"xml2json requires uproot, please install pyhf using the "
48-
"xmlio extra: pip install pyhf[xmlio]"
48+
"xmlio extra: python -m pip install pyhf[xmlio]"
4949
)
5050
from .. import readxml
5151

@@ -73,7 +73,7 @@ def json2xml(workspace, output_dir, specroot, dataroot, resultprefix, patch):
7373
except ImportError:
7474
log.error(
7575
"json2xml requires uproot, please install pyhf using the "
76-
"xmlio extra: pip install pyhf[xmlio]"
76+
"xmlio extra: python -m pip install pyhf[xmlio]"
7777
)
7878
from .. import writexml
7979

0 commit comments

Comments
 (0)