mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Fix edge cases for pipenv run
- Use os.path.join instead of os.path.sep.join - This prevents strange test errors when there are slashes in either parts - Better test reporting - Cleanup
This commit is contained in:
@@ -52,7 +52,9 @@ def _validate_specifiers(instance, attr_, value):
|
||||
except InvalidMarker:
|
||||
raise ValueError('Invalid Specifiers {0}'.format(value))
|
||||
|
||||
_optional_instance_of = lambda cls: validators.optional(validators.instance_of(cls))
|
||||
|
||||
def _optional_instance_of(cls):
|
||||
return validators.optional(validators.instance_of(cls))
|
||||
|
||||
|
||||
@attrs
|
||||
@@ -516,7 +518,6 @@ class PipenvRequirement(object):
|
||||
line = line.split(' ', 1)[1]
|
||||
line, markers = cls._split_markers(line)
|
||||
line, extras = _strip_extras(line)
|
||||
req_dict = defaultdict(None)
|
||||
vcs = None
|
||||
if is_installable_file(line):
|
||||
req_dict = cls._prep_path(line)
|
||||
@@ -785,8 +786,10 @@ def _extras_to_string(extras):
|
||||
|
||||
|
||||
def build_vcs_link(
|
||||
vcs, uri, name=None, ref=None, subdirectory=None, extras= []
|
||||
vcs, uri, name=None, ref=None, subdirectory=None, extras=None
|
||||
):
|
||||
if extras is None:
|
||||
extras = []
|
||||
vcs_start = '{0}+'.format(vcs)
|
||||
if not uri.startswith(vcs_start):
|
||||
uri = '{0}{1}'.format(vcs_start, uri)
|
||||
|
||||
+2
-3
@@ -60,7 +60,7 @@ if six.PY2:
|
||||
specifiers = [k for k in lookup.keys()]
|
||||
# List of version control systems we support.
|
||||
VCS_LIST = ('git', 'svn', 'hg', 'bzr')
|
||||
SCHEME_LIST = ('http://', 'https://', 'ftp://', 'file://')
|
||||
SCHEME_LIST = ('http://', 'https://', 'ftp://', 'ftps://', 'file://')
|
||||
requests = requests.Session()
|
||||
|
||||
|
||||
@@ -442,7 +442,6 @@ def multi_split(s, split):
|
||||
def convert_deps_from_pip(dep):
|
||||
""""Converts a pip-formatted dependency to a Pipfile-formatted one."""
|
||||
from .requirements import PipenvRequirement
|
||||
dependency = {}
|
||||
req = PipenvRequirement.from_line(dep)
|
||||
return req.as_pipfile()
|
||||
|
||||
@@ -1001,7 +1000,7 @@ class TemporaryDirectory(object):
|
||||
import uuid
|
||||
|
||||
name = uuid.uuid4().hex
|
||||
dir_name = os.path.sep.join([os.environ['RAM_DISK'].strip(), name])
|
||||
dir_name = os.path.join(os.environ['RAM_DISK'].strip(), name)
|
||||
os.mkdir(dir_name)
|
||||
self.name = dir_name
|
||||
else:
|
||||
|
||||
@@ -1084,16 +1084,13 @@ requests = "==2.14.0"
|
||||
with PipenvInstance(pypi=pypi) as p:
|
||||
|
||||
c = p.pipenv('install https://github.com/divio/django-cms/archive/release/3.4.x.zip')
|
||||
key = [k for k in p.pipfile['packages'].keys()][0]
|
||||
dep = p.pipfile['packages'][key]
|
||||
|
||||
assert 'file' in dep
|
||||
assert c.return_code == 0
|
||||
|
||||
key = [k for k in p.lockfile['default'].keys()][0]
|
||||
dep = p.lockfile['default'][key]
|
||||
dep = list(p.pipfile['packages'].values())[0]
|
||||
assert 'file' in dep, p.pipfile
|
||||
|
||||
assert 'file' in dep
|
||||
dep = list(p.lockfile['default'].values())[0]
|
||||
assert 'file' in dep, p.lockfile
|
||||
|
||||
@pytest.mark.install
|
||||
@pytest.mark.files
|
||||
|
||||
Reference in New Issue
Block a user