This commit is contained in:
Tzu-ping Chung
2018-03-27 20:11:15 +08:00
committed by Dan Ryan
parent 67de4891a9
commit a3dcc66844
3 changed files with 23 additions and 49 deletions
+9 -1
View File
@@ -566,12 +566,20 @@ class Project(object):
if 'source' in self.parsed_pipfile:
return self.parsed_pipfile['source']
elif PIPENV_TEST_INDEX:
return [
{
u'url': PIPENV_TEST_INDEX,
u'verify_ssl': True,
u'name': u'custom',
}
]
else:
return [
{
u'url': u'https://pypi.python.org/simple',
u'verify_ssl': True,
'name': 'pypi',
u'name': u'pypi',
}
]
-11
View File
@@ -1,5 +1,4 @@
import os
import textwrap
import threading
import ssl
from wsgiref.simple_server import WSGIServer, make_server, WSGIRequestHandler
@@ -125,16 +124,6 @@ class Server(object):
def join(self, url, allow_fragments=True):
return urljoin(self.url, url, allow_fragments=allow_fragments)
def as_source_entry(self, name='custom'):
return textwrap.dedent(
"""
[[source]]
url = "{url}/simple"
verify_ssl = true
name = "{name}"
""".format(url=self.url, name=name),
).strip()
class SecureServer(Server):
port_envvar = 'HTTPBIN_HTTPS_PORT'
+14 -37
View File
@@ -308,14 +308,12 @@ class TestPipenv:
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
tablib = "*"
[dev-packages]
records = "*"
""".format(source=pypi.as_source_entry()).strip()
""".strip()
f.write(contents)
c = p.pipenv('install')
assert c.return_code == 0
@@ -334,11 +332,9 @@ records = "*"
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
tablib = "*"
""".format(source=pypi.as_source_entry()).strip()
""".strip()
f.write(contents)
c = p.pipenv('install')
assert c.return_code == 0
@@ -511,11 +507,9 @@ setup(
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
tablib = "<0.12"
""".format(source=pypi.as_source_entry()).strip()
""".strip()
f.write(contents)
c = p.pipenv('install')
assert c.return_code == 0
@@ -531,13 +525,11 @@ tablib = "<0.12"
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
requests = "*"
records = "*"
tpfd = "*"
""".format(source=pypi.as_source_entry()).strip()
""".strip()
f.write(contents)
c = p.pipenv('install')
@@ -561,13 +553,11 @@ tpfd = "*"
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
requests = "*"
records = "*"
tpfd = "*"
""".format(source=pypi.as_source_entry()).strip()
""".strip()
f.write(contents)
c = p.pipenv('install --sequential')
@@ -611,8 +601,6 @@ tpfd = "*"
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
tablib = {version = "*", markers="os_name=='splashwear'"}
""".strip()
@@ -634,11 +622,9 @@ tablib = {version = "*", markers="os_name=='splashwear'"}
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
requests = {{ version = "*", os_name = "== 'splashwear'" }}
""".format(source=pypi.as_source_entry()).strip()
requests = {version = "*", os_name = "== 'splashwear'"}
""".strip()
f.write(contents)
c = p.pipenv('install')
@@ -658,12 +644,10 @@ requests = {{ version = "*", os_name = "== 'splashwear'" }}
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
apscheduler = "*"
funcsigs = {{ version = "*", os_name = "== 'splashwear'" }}
""".format(source=pypi.as_source_entry()).strip()
funcsigs = {version = "*", os_name = "== 'splashwear'"}
""".strip()
f.write(contents)
c = p.pipenv('install')
@@ -684,12 +668,10 @@ funcsigs = {{ version = "*", os_name = "== 'splashwear'" }}
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
apscheduler = "*"
funcsigs = "*"
""".format(source=pypi.as_source_entry()).strip()
""".strip()
f.write(contents)
c = p.pipenv('install')
@@ -721,11 +703,9 @@ funcsigs = "*"
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
requests = {{version = "*"}}
""".format(source=pypi.as_source_entry()).strip()
requests = {version = "*"}
""".strip()
f.write(contents)
c = p.pipenv('install')
@@ -955,12 +935,11 @@ RandomWords = "*"
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
requests = "==2.14.0"
[dev-packages]
flask = "==0.12.2"
""".format(source=pypi.as_source_entry()).strip()
""".strip()
f.write(contents)
req_list = ("requests==2.14.0")
@@ -1040,11 +1019,9 @@ allow_prereleases = true
with PipenvInstance(pypi=pypi) as p:
with open(p.pipfile_path, 'w') as f:
contents = """
{source}
[packages]
maya = "*"
""".format(source=pypi.as_source_entry()).strip()
""".strip()
f.write(contents)
c = p.pipenv('lock')