Skip to content

Commit

Permalink
quote extras in docstrings and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfeickert committed Feb 11, 2023
1 parent d68f7a0 commit 4e30b35
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/pyhf/cli/complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def cli(shell):
@click.command(help='Generate shell completion code.', name='completions')
@click.argument('shell', default=None)
def cli(shell):
'''Placeholder for shell completion code generatioon function if necessary dependency is missing.'''
"""Placeholder for shell completion code generatioon function if necessary dependency is missing."""
click.secho(
'This requires the click_completion module.\n'
'You can install it with the shellcomplete extra:\n'
'python -m pip install pyhf[shellcomplete]'
"This requires the click_completion module.\n"
"You can install it with the shellcomplete extra:\n"
"python -m pip install 'pyhf[shellcomplete]'"
)
4 changes: 2 additions & 2 deletions src/pyhf/cli/rootio.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def xml2json(
except ImportError:
log.error(
"xml2json requires uproot, please install pyhf using the "
"xmlio extra: python -m pip install pyhf[xmlio]",
"xmlio extra: python -m pip install 'pyhf[xmlio]'",
exc_info=True,
)
from pyhf import readxml
Expand Down Expand Up @@ -86,7 +86,7 @@ def json2xml(workspace, output_dir, specroot, dataroot, resultprefix, patch):
except ImportError:
log.error(
"json2xml requires uproot, please install pyhf using the "
"xmlio extra: python -m pip install pyhf[xmlio]",
"xmlio extra: python -m pip install 'pyhf[xmlio]'",
exc_info=True,
)
from pyhf import writexml
Expand Down
4 changes: 2 additions & 2 deletions src/pyhf/contrib/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def cli():
.. code-block:: shell
$ python -m pip install pyhf[contrib]
$ python -m pip install 'pyhf[contrib]'
"""
from pyhf.contrib import utils # Guard CLI from missing extra # noqa: F401

Expand Down Expand Up @@ -72,6 +72,6 @@ def download(archive_url, output_directory, verbose, force, compress):
except AttributeError:
log.error(
"\nInstallation of the contrib extra is required to use the contrib CLI API"
+ "\nPlease install with: python -m pip install pyhf[contrib]\n",
+ "\nPlease install with: python -m pip install 'pyhf[contrib]'\n",
exc_info=True,
)
2 changes: 1 addition & 1 deletion src/pyhf/contrib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ def download(archive_url, output_directory, force=False, compress=False):
except ModuleNotFoundError:
log.error(
"\nInstallation of the contrib extra is required to use pyhf.contrib.utils.download"
+ "\nPlease install with: python -m pip install pyhf[contrib]\n",
+ "\nPlease install with: python -m pip install 'pyhf[contrib]'\n",
exc_info=True,
)
4 changes: 2 additions & 2 deletions tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ def test_missing_contrib_extra(caplog):
for line in [
"import of requests halted; None in sys.modules",
"Installation of the contrib extra is required to use pyhf.contrib.utils.download",
"Please install with: python -m pip install pyhf[contrib]",
"Please install with: python -m pip install 'pyhf[contrib]'",
]:
assert line in caplog.text
caplog.clear()
Expand Down Expand Up @@ -672,7 +672,7 @@ def test_missing_contrib_download(caplog):
for line in [
"module 'pyhf.contrib.utils' has no attribute 'download'",
"Installation of the contrib extra is required to use the contrib CLI API",
"Please install with: python -m pip install pyhf[contrib]",
"Please install with: python -m pip install 'pyhf[contrib]'",
]:
assert line in caplog.text
caplog.clear()
Expand Down

0 comments on commit 4e30b35

Please sign in to comment.