mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
@@ -1,6 +1,8 @@
|
||||
9.0.4:
|
||||
- Add --system flag to $ pipenv check.
|
||||
- Removal of package name suggestions.
|
||||
- Support for [scripts] in Pipfile.
|
||||
- Updated patched version of dotenv.
|
||||
9.0.3:
|
||||
- v9.0.1.
|
||||
9.0.2:
|
||||
|
||||
@@ -12,3 +12,8 @@ pytest-xdist = "*"
|
||||
[packages]
|
||||
|
||||
"e1839a8" = {path = ".", editable = true}
|
||||
|
||||
|
||||
[scripts]
|
||||
|
||||
tests = "pytest tests"
|
||||
+8
-2
@@ -5,6 +5,7 @@ import codecs
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import shlex
|
||||
import signal
|
||||
import time
|
||||
import tempfile
|
||||
@@ -1974,6 +1975,10 @@ def do_run(command, args, three=None, python=False):
|
||||
|
||||
load_dot_env()
|
||||
|
||||
# Script was found…
|
||||
if command in project.scripts:
|
||||
command = ' '.join(project.scripts[command])
|
||||
|
||||
# Separate out things that were passed in as a string.
|
||||
_c = list(command.split())
|
||||
command = _c.pop(0)
|
||||
@@ -1995,11 +2000,12 @@ def do_run(command, args, three=None, python=False):
|
||||
command_path = system_which(command)
|
||||
if not command_path:
|
||||
click.echo(
|
||||
'{0}: the command {1} could not be found within {2}.'
|
||||
'{0}: the command {1} could not be found within {2} or Pipfile\'s {3}.'
|
||||
''.format(
|
||||
crayons.red('Error', bold=True),
|
||||
crayons.red(command),
|
||||
crayons.normal('PATH', bold=True)
|
||||
crayons.normal('PATH', bold=True),
|
||||
crayons.normal('[scripts]', bold=True)
|
||||
), err=True
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
@@ -3,6 +3,7 @@ import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import shlex
|
||||
import base64
|
||||
import hashlib
|
||||
|
||||
@@ -292,6 +293,15 @@ class Project(object):
|
||||
"""A dictionary of the settings added to the Pipfile."""
|
||||
return self.parsed_pipfile.get('pipenv', {})
|
||||
|
||||
@property
|
||||
def scripts(self):
|
||||
scripts = self.parsed_pipfile.get('scripts', {})
|
||||
for (k, v) in scripts.items():
|
||||
scripts[k] = shlex.split(v, posix=True)
|
||||
|
||||
return scripts
|
||||
|
||||
|
||||
def update_settings(self, d):
|
||||
settings = self.settings
|
||||
|
||||
|
||||
Reference in New Issue
Block a user