Simplify prepare_command function and add deprecation warning
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
from fnmatch import fnmatch
|
||||
import warnings
|
||||
|
||||
|
||||
def prepare_command(command, python, pip, project):
|
||||
def prepare_command(command, project):
|
||||
'''
|
||||
Preprocesses a command by expanding variables like {python} or {pip}.
|
||||
Preprocesses a command by expanding variables like {project}.
|
||||
|
||||
For example, used for the before_build option, where the user would
|
||||
like to run a command like `python setup.py test`. If the command should run on
|
||||
Python 3, the user could write `{python} setup.py test`. This command would expand
|
||||
it out to python2 or python3 as appropriate.
|
||||
'''
|
||||
return command.format(python=python, pip=pip, project=project)
|
||||
if '{python}' in command or '{pip}' in command:
|
||||
warnings.warn("'{python}' and '{pip}' are no longer needed, and have been deprecated. Simply use 'python' or 'pip' instead.",
|
||||
DeprecationWarning)
|
||||
|
||||
return command.format(python='python', pip='pip', project=project)
|
||||
|
||||
|
||||
class BuildSkipper(object):
|
||||
|
||||
Reference in New Issue
Block a user