mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 14:50:16 +00:00
Remove unused patch files
This commit is contained in:
@@ -1,88 +0,0 @@
|
||||
diff --git a/pipenv/vendor/delegator.py b/pipenv/vendor/delegator.py
|
||||
index d15aeb97..cf6f91c8 100644
|
||||
--- a/pipenv/vendor/delegator.py
|
||||
+++ b/pipenv/vendor/delegator.py
|
||||
@@ -7,6 +7,8 @@ import locale
|
||||
import errno
|
||||
|
||||
from pexpect.popen_spawn import PopenSpawn
|
||||
+import pexpect
|
||||
+pexpect.EOF.__module__ = "pexpect.exceptions"
|
||||
|
||||
# Include `unicode` in STR_TYPES for Python 2.X
|
||||
try:
|
||||
@@ -110,8 +112,11 @@ class Command(object):
|
||||
if self.subprocess.before:
|
||||
result += self.subprocess.before
|
||||
|
||||
- if self.subprocess.after:
|
||||
- result += self.subprocess.after
|
||||
+ if self.subprocess.after and self.subprocess.after not in (pexpect.EOF, pexpect.TIMEOUT):
|
||||
+ try:
|
||||
+ result += self.subprocess.after
|
||||
+ except (pexpect.EOF, pexpect.TIMEOUT):
|
||||
+ pass
|
||||
|
||||
result += self.subprocess.read()
|
||||
return result
|
||||
@@ -178,6 +183,7 @@ class Command(object):
|
||||
# Use subprocess.
|
||||
if self.blocking:
|
||||
popen_kwargs = self._default_popen_kwargs.copy()
|
||||
+ del popen_kwargs["stdin"]
|
||||
popen_kwargs["universal_newlines"] = not binary
|
||||
if cwd:
|
||||
popen_kwargs["cwd"] = cwd
|
||||
@@ -205,7 +211,10 @@ class Command(object):
|
||||
if self.blocking:
|
||||
raise RuntimeError("expect can only be used on non-blocking commands.")
|
||||
|
||||
- self.subprocess.expect(pattern=pattern, timeout=timeout)
|
||||
+ try:
|
||||
+ self.subprocess.expect(pattern=pattern, timeout=timeout)
|
||||
+ except pexpect.EOF:
|
||||
+ pass
|
||||
|
||||
def send(self, s, end=os.linesep, signal=False):
|
||||
"""Sends the given string or signal to std_in."""
|
||||
@@ -234,14 +243,25 @@ class Command(object):
|
||||
"""Blocks until process is complete."""
|
||||
if self._uses_subprocess:
|
||||
# consume stdout and stderr
|
||||
- try:
|
||||
- stdout, stderr = self.subprocess.communicate()
|
||||
- self.__out = stdout
|
||||
- self.__err = stderr
|
||||
- except ValueError:
|
||||
- pass # Don't read from finished subprocesses.
|
||||
+ if self.blocking:
|
||||
+ try:
|
||||
+ stdout, stderr = self.subprocess.communicate()
|
||||
+ self.__out = stdout
|
||||
+ self.__err = stderr
|
||||
+ except ValueError:
|
||||
+ pass # Don't read from finished subprocesses.
|
||||
+ else:
|
||||
+ self.subprocess.stdin.close()
|
||||
+ self.std_out.close()
|
||||
+ self.std_err.close()
|
||||
+ self.subprocess.wait()
|
||||
else:
|
||||
- self.subprocess.wait()
|
||||
+ self.subprocess.sendeof()
|
||||
+ try:
|
||||
+ self.subprocess.wait()
|
||||
+ finally:
|
||||
+ if self.subprocess.proc.stdout:
|
||||
+ self.subprocess.proc.stdout.close()
|
||||
|
||||
def pipe(self, command, timeout=None, cwd=None):
|
||||
"""Runs the current command and passes its output to the next
|
||||
@@ -263,7 +283,6 @@ class Command(object):
|
||||
c.run(block=False, cwd=cwd)
|
||||
if data:
|
||||
c.send(data)
|
||||
- c.subprocess.sendeof()
|
||||
c.block()
|
||||
return c
|
||||
|
||||
@@ -45,12 +45,12 @@ def test_pipenv_py(PipenvInstance):
|
||||
def test_pipenv_site_packages(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv('--python python --site-packages')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'Making site-packages available' in c.stderr
|
||||
|
||||
# no-global-site-packages.txt under stdlib dir should not exist.
|
||||
c = p.pipenv('run python -c "import sysconfig; print(sysconfig.get_path(\'stdlib\'))"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
stdlib_path = c.stdout.strip()
|
||||
assert not os.path.isfile(os.path.join(stdlib_path, 'no-global-site-packages.txt'))
|
||||
|
||||
@@ -105,7 +105,7 @@ def test_pipenv_graph_reverse(PipenvInstance):
|
||||
output = c.stdout
|
||||
|
||||
c = p.pipenv('graph --reverse --json')
|
||||
assert c.return_code == 1
|
||||
assert c.returncode == 1
|
||||
assert 'Warning: Using both --reverse and --json together is not supported.' in c.stderr
|
||||
|
||||
requests_dependency = [
|
||||
@@ -144,14 +144,14 @@ def test_pipenv_check(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
p.pipenv('install requests==1.0.0')
|
||||
c = p.pipenv('check')
|
||||
assert c.return_code != 0
|
||||
assert c.returncode != 0
|
||||
assert 'requests' in c.stdout
|
||||
c = p.pipenv('uninstall requests')
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('install six')
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('check --ignore 35015')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'Ignoring' in c.stderr
|
||||
|
||||
|
||||
@@ -161,11 +161,11 @@ def test_pipenv_clean_pip_no_warnings(PipenvInstance):
|
||||
with open('setup.py', 'w') as f:
|
||||
f.write('from setuptools import setup; setup(name="empty")')
|
||||
c = p.pipenv('install -e .')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv(f'run pip install -i {p.index_url} pytz')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('clean')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert c.stdout, f"{c.stdout} -- STDERR: {c.stderr}"
|
||||
|
||||
|
||||
@@ -177,9 +177,9 @@ def test_pipenv_clean_pip_warnings(PipenvInstance):
|
||||
# create a fake git repo to trigger a pip freeze warning
|
||||
os.mkdir('.git')
|
||||
c = p.pipenv(f"run pip install -i {p.index_url} -e .")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('clean')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert c.stderr
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ def test_help(PipenvInstance):
|
||||
def test_man(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv('--man')
|
||||
assert c.return_code == 0, c.stderr
|
||||
assert c.returncode == 0, c.stderr
|
||||
|
||||
|
||||
@pytest.mark.cli
|
||||
@@ -236,7 +236,7 @@ def test_install_parse_error(PipenvInstance):
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv('install requests u/\\/p@r\\$34b13+pkg')
|
||||
assert c.return_code != 0
|
||||
assert c.returncode != 0
|
||||
assert 'u/\\/p@r$34b13+pkg' not in p.pipfile['packages']
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ import flask
|
||||
def test_pipenv_clear(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv('--clear')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'Clearing caches' in c.stdout
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ def test_pipenv_clear(PipenvInstance):
|
||||
def test_pipenv_three(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv('--three')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'Successfully created virtual environment' in c.stderr
|
||||
|
||||
|
||||
@@ -289,4 +289,4 @@ sqlalchemy = "<=1.2.3"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv('update --pre --outdated')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
@@ -14,7 +14,7 @@ def test_venv_in_project(PipenvInstance):
|
||||
os.environ['PIPENV_VENV_IN_PROJECT'] = '1'
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv('install requests')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert normalize_drive(p.path) in p.pipenv('--venv').out
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ def test_venv_at_project_root(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
os.environ['PIPENV_VENV_IN_PROJECT'] = '1'
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert normalize_drive(p.path) in p.pipenv('--venv').out
|
||||
del os.environ['PIPENV_VENV_IN_PROJECT']
|
||||
os.mkdir('subdir')
|
||||
@@ -38,7 +38,7 @@ def test_reuse_previous_venv(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
os.mkdir('.venv')
|
||||
c = p.pipenv('install requests')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert normalize_drive(p.path) in p.pipenv('--venv').out
|
||||
|
||||
|
||||
@@ -61,10 +61,10 @@ def test_venv_file(venv_name, PipenvInstance):
|
||||
del os.environ['PIPENV_VENV_IN_PROJECT']
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv('--venv')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
venv_loc = Path(c.stdout.strip()).absolute()
|
||||
assert venv_loc.exists()
|
||||
assert venv_loc.joinpath('.project').exists()
|
||||
@@ -93,9 +93,9 @@ def test_venv_file_with_path(PipenvInstance):
|
||||
f.write(venv_path.name)
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('--venv')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
venv_loc = Path(c.stdout.strip())
|
||||
|
||||
assert venv_loc.joinpath('.project').exists()
|
||||
|
||||
@@ -15,7 +15,7 @@ def test_basic_setup(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
with PipenvInstance(pipfile=False) as p:
|
||||
c = p.pipenv("install requests")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
assert "requests" in p.pipfile["packages"]
|
||||
assert "requests" in p.lockfile["default"]
|
||||
@@ -32,7 +32,7 @@ def test_basic_setup(PipenvInstance):
|
||||
def test_basic_install(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv("install requests")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "requests" in p.pipfile["packages"]
|
||||
assert "requests" in p.lockfile["default"]
|
||||
assert "chardet" in p.lockfile["default"]
|
||||
@@ -53,7 +53,7 @@ def test_mirror_install(PipenvInstance):
|
||||
# This should sufficiently demonstrate the mirror functionality
|
||||
# since pypi.org is the default when PIPENV_TEST_INDEX is unset.
|
||||
c = p.pipenv(f"install requests --pypi-mirror {mirror_url}")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
# Ensure the --pypi-mirror parameter hasn't altered the Pipfile or Pipfile.lock sources
|
||||
assert len(p.pipfile["source"]) == 1
|
||||
assert len(p.lockfile["_meta"]["sources"]) == 1
|
||||
@@ -77,7 +77,7 @@ def test_bad_mirror_install(PipenvInstance):
|
||||
# This demonstrates that the mirror parameter is being used
|
||||
os.environ.pop("PIPENV_TEST_INDEX", None)
|
||||
c = p.pipenv("install requests --pypi-mirror https://pypi.example.org")
|
||||
assert c.return_code != 0
|
||||
assert c.returncode != 0
|
||||
|
||||
|
||||
@pytest.mark.lock
|
||||
@@ -86,7 +86,7 @@ def test_bad_mirror_install(PipenvInstance):
|
||||
def test_complex_lock(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv("install apscheduler")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "apscheduler" in p.pipfile["packages"]
|
||||
assert "funcsigs" in p.lockfile["default"]
|
||||
assert "futures" in p.lockfile["default"]
|
||||
@@ -98,7 +98,7 @@ def test_complex_lock(PipenvInstance):
|
||||
def test_basic_dev_install(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv("install requests --dev")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "requests" in p.pipfile["dev-packages"]
|
||||
assert "requests" in p.lockfile["develop"]
|
||||
assert "chardet" in p.lockfile["develop"]
|
||||
@@ -107,7 +107,7 @@ def test_basic_dev_install(PipenvInstance):
|
||||
assert "certifi" in p.lockfile["develop"]
|
||||
|
||||
c = p.pipenv("run python -m requests.help")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@flaky
|
||||
@@ -127,15 +127,15 @@ tablib = "*"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "six" in p.pipfile["packages"]
|
||||
assert "tablib" in p.pipfile["dev-packages"]
|
||||
assert "six" in p.lockfile["default"]
|
||||
assert "tablib" in p.lockfile["develop"]
|
||||
c = p.pipenv('run python -c "import tablib"')
|
||||
assert c.return_code != 0
|
||||
assert c.returncode != 0
|
||||
c = p.pipenv('run python -c "import six"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@flaky
|
||||
@@ -150,13 +150,13 @@ six = "*"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "six" in p.pipfile["packages"]
|
||||
assert p.pipfile.get("dev-packages", {}) == {}
|
||||
assert "six" in p.lockfile["default"]
|
||||
assert p.lockfile["develop"] == {}
|
||||
c = p.pipenv('run python -c "import six"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@flaky
|
||||
@@ -166,7 +166,7 @@ six = "*"
|
||||
def test_extras_install(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv("install requests[socks]")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "requests" in p.pipfile["packages"]
|
||||
assert "extras" in p.pipfile["packages"]["requests"]
|
||||
|
||||
@@ -190,7 +190,7 @@ requests = "==2.19.1"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "requests" in p.pipfile["packages"]
|
||||
assert "requests" in p.lockfile["default"]
|
||||
|
||||
@@ -210,7 +210,7 @@ def test_backup_resolver(PipenvInstance):
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "ibm-db-sa-py3" in p.lockfile["default"]
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ requests = {version = "*"}
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
assert "requests" in p.lockfile["default"]
|
||||
assert "idna" in p.lockfile["default"]
|
||||
@@ -236,7 +236,7 @@ requests = {version = "*"}
|
||||
assert "chardet" in p.lockfile["default"]
|
||||
|
||||
c = p.pipenv('run python -c "import requests; import idna; import certifi;"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@flaky
|
||||
@@ -252,7 +252,7 @@ version = "*"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
assert "requests" in p.lockfile["default"]
|
||||
assert "idna" in p.lockfile["default"]
|
||||
@@ -261,7 +261,7 @@ version = "*"
|
||||
assert "chardet" in p.lockfile["default"]
|
||||
|
||||
c = p.pipenv('run python -c "import requests; import idna; import certifi;"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.bad
|
||||
@@ -270,7 +270,7 @@ version = "*"
|
||||
def test_bad_packages(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv("install NotAPackage")
|
||||
assert c.return_code > 0
|
||||
assert c.returncode > 0
|
||||
|
||||
|
||||
@pytest.mark.lock
|
||||
@@ -286,7 +286,7 @@ def test_requirements_to_pipfile(PipenvInstance, pypi):
|
||||
f.write(f"-i {pypi.url}\nrequests[socks]==2.19.1\n")
|
||||
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
print(c.stdout)
|
||||
print(c.stderr)
|
||||
print(subprocess_run(["ls", "-l"]).stdout)
|
||||
@@ -317,7 +317,7 @@ def test_skip_requirements_when_pipfile(PipenvInstance):
|
||||
with open("requirements.txt", "w") as f:
|
||||
f.write("requests==2.18.1\n")
|
||||
c = p.pipenv("install six")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
with open(p.pipfile_path, "w") as f:
|
||||
contents = """
|
||||
[packages]
|
||||
@@ -340,7 +340,7 @@ fake_package = "<0.12"
|
||||
def test_clean_on_empty_venv(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv("clean")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.basic
|
||||
@@ -364,13 +364,13 @@ name = 'mockpi'
|
||||
|
||||
# Ensure simple install does not extrapolate.
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert p.pipfile["source"][0]["url"] == "${PYPI_URL}/simple"
|
||||
assert p.lockfile["_meta"]["sources"][0]["url"] == "${PYPI_URL}/simple"
|
||||
|
||||
# Ensure package install does not extrapolate.
|
||||
c = p.pipenv("install six")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert p.pipfile["source"][0]["url"] == "${PYPI_URL}/simple"
|
||||
assert p.lockfile["_meta"]["sources"][0]["url"] == "${PYPI_URL}/simple"
|
||||
|
||||
@@ -382,7 +382,7 @@ name = 'mockpi'
|
||||
def test_editable_no_args(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv("install -e")
|
||||
assert c.return_code != 0
|
||||
assert c.returncode != 0
|
||||
assert "Error: Option '-e' requires an argument" in c.stderr
|
||||
|
||||
|
||||
@@ -401,7 +401,7 @@ def test_install_venv_project_directory(PipenvInstance):
|
||||
del os.environ["PIPENV_VENV_IN_PROJECT"]
|
||||
|
||||
c = p.pipenv("install six")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
venv_loc = None
|
||||
for line in c.stderr.splitlines():
|
||||
@@ -417,15 +417,15 @@ def test_install_venv_project_directory(PipenvInstance):
|
||||
def test_system_and_deploy_work(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv("install tablib")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv("--rm")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = subprocess_run(["virtualenv", ".venv"])
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv("install --system --deploy")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv("--rm")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
Path(p.pipfile_path).write_text(
|
||||
"""
|
||||
[packages]
|
||||
@@ -433,7 +433,7 @@ tablib = "*"
|
||||
""".strip()
|
||||
)
|
||||
c = p.pipenv("install --system")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.basic
|
||||
@@ -446,7 +446,7 @@ def test_install_creates_pipfile(PipenvInstance):
|
||||
del os.environ["PIPENV_PIPFILE"]
|
||||
assert not os.path.isfile(p.pipfile_path)
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert os.path.isfile(p.pipfile_path)
|
||||
|
||||
|
||||
@@ -483,7 +483,7 @@ extras = ["socks"]
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv("install flask")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
with open(p.pipfile_path) as f:
|
||||
contents = f.read()
|
||||
assert "[packages.requests]" not in contents
|
||||
|
||||
@@ -23,12 +23,12 @@ fake_package = {version = "*", markers="os_name=='splashwear'"}
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'Ignoring' in c.stdout
|
||||
assert 'markers' in p.lockfile['default']['fake-package'], p.lockfile["default"]
|
||||
|
||||
c = p.pipenv('run python -c "import fake_package;"')
|
||||
assert c.return_code == 1
|
||||
assert c.returncode == 1
|
||||
|
||||
|
||||
@flaky
|
||||
@@ -46,7 +46,7 @@ depends-on-marked-package = "*"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
# depends-on-marked-package has an install_requires of
|
||||
# 'pytz; platform_python_implementation=="CPython"'
|
||||
@@ -71,13 +71,13 @@ fake-package = {version = "*", os_name = "== 'splashwear'"}
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
assert 'Ignoring' in c.stdout
|
||||
assert 'markers' in p.lockfile['default']['fake-package']
|
||||
|
||||
c = p.pipenv('run python -c "import fake_package;"')
|
||||
assert c.return_code == 1
|
||||
assert c.returncode == 1
|
||||
|
||||
|
||||
@flaky
|
||||
@@ -95,7 +95,7 @@ funcsigs = {version = "*", os_name = "== 'splashwear'"}
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "markers" in p.lockfile['default']['funcsigs'], p.lockfile['default']['funcsigs']
|
||||
assert p.lockfile['default']['funcsigs']['markers'] == "os_name == 'splashwear'", p.lockfile['default']['funcsigs']
|
||||
|
||||
@@ -120,7 +120,7 @@ funcsigs = "*"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
assert p.lockfile['default']['funcsigs'].get('markers', '') == ''
|
||||
|
||||
@@ -140,9 +140,9 @@ def test_resolver_unique_markers(PipenvInstance):
|
||||
"""
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv('install vcrpy==2.0.1')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'yarl' in p.lockfile['default']
|
||||
yarl = p.lockfile['default']['yarl']
|
||||
assert 'markers' in yarl
|
||||
@@ -177,14 +177,14 @@ six = "*"
|
||||
assert project.get_lockfile_hash() is None
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
lock_hash = project.get_lockfile_hash()
|
||||
assert lock_hash is not None
|
||||
assert lock_hash == project.calculate_pipfile_hash()
|
||||
|
||||
# sanity check on pytest
|
||||
assert 'PYPI_USERNAME' not in str(pipfile.load(p.pipfile_path))
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert project.get_lockfile_hash() == project.calculate_pipfile_hash()
|
||||
|
||||
os.environ['PYPI_PASSWORD'] = 'pass2'
|
||||
|
||||
@@ -45,15 +45,15 @@ testpipenv = {path = ".", editable = true, extras = ["dev"]}
|
||||
""".strip())
|
||||
# project.write_toml({"packages": pipfile, "dev-packages": {}})
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "testpipenv" in p.lockfile["default"]
|
||||
assert p.lockfile["default"]["testpipenv"]["extras"] == ["dev"]
|
||||
assert "six" in p.lockfile["default"]
|
||||
c = p.pipenv("uninstall --all")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
print(f"Current directory: {os.getcwd()}", file=sys.stderr)
|
||||
c = p.pipenv(f"install {line}")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "testpipenv" in p.pipfile["packages"]
|
||||
assert p.pipfile["packages"]["testpipenv"]["path"] == "."
|
||||
assert p.pipfile["packages"]["testpipenv"]["extras"] == ["dev"]
|
||||
@@ -92,7 +92,7 @@ setup(
|
||||
def helper_dependency_links_install_test(pipenv_instance, deplink):
|
||||
TestDirectDependencies.helper_dependency_links_install_make_setup(pipenv_instance, deplink)
|
||||
c = pipenv_instance.pipenv("install -v -e .")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "test-private-dependency" in pipenv_instance.lockfile["default"]
|
||||
|
||||
def test_https_dependency_links_install(self, PipenvInstance):
|
||||
@@ -125,7 +125,7 @@ def test_e_dot(PipenvInstance, pip_src_dir):
|
||||
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
c = p.pipenv(f"install -e '{path}' --dev")
|
||||
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
key = [k for k in p.pipfile["dev-packages"].keys()][0]
|
||||
assert "path" in p.pipfile["dev-packages"][key]
|
||||
@@ -149,14 +149,14 @@ urllib3 = "*"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
assert "pytz" in p.lockfile["default"]
|
||||
assert "six" in p.lockfile["default"]
|
||||
assert "urllib3" in p.lockfile["default"]
|
||||
|
||||
c = p.pipenv('run python -c "import six; import pytz; import urllib3;"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.install
|
||||
@@ -175,14 +175,14 @@ pytz = "*"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv("install --sequential")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
assert "six" in p.lockfile["default"]
|
||||
assert "pytz" in p.lockfile["default"]
|
||||
assert "urllib3" in p.lockfile["default"]
|
||||
|
||||
c = p.pipenv('run python -c "import six; import urllib3; import pytz;"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.run
|
||||
@@ -198,17 +198,17 @@ Requests = "==2.14.0" # Inline comment
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv("install requests")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "requests" not in p.pipfile["packages"]
|
||||
assert p.pipfile["packages"]["Requests"] == "==2.14.0"
|
||||
c = p.pipenv("install requests==2.18.4")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert p.pipfile["packages"]["Requests"] == "==2.18.4"
|
||||
c = p.pipenv("install python_DateUtil")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "python-dateutil" in p.pipfile["packages"]
|
||||
with open(p.pipfile_path) as f:
|
||||
contents = f.read()
|
||||
@@ -237,7 +237,7 @@ def test_local_package(PipenvInstance, pip_src_dir, testsroot):
|
||||
with tarfile.open(copy_to, "r:gz") as tgz:
|
||||
tgz.extractall(path=p.path)
|
||||
c = p.pipenv(f"install -e {package}")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert all(
|
||||
pkg in p.lockfile["default"]
|
||||
for pkg in ["urllib3", "idna", "certifi", "chardet"]
|
||||
@@ -257,12 +257,12 @@ def test_local_zipfiles(PipenvInstance, testsroot):
|
||||
shutil.copy(source_path, os.path.join(p.path, file_name))
|
||||
|
||||
c = p.pipenv(f"install {file_name}")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
key = [k for k in p.pipfile["packages"].keys()][0]
|
||||
dep = p.pipfile["packages"][key]
|
||||
|
||||
assert "file" in dep or "path" in dep
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
# This now gets resolved to its name correctly
|
||||
dep = p.lockfile["default"]["requests"]
|
||||
@@ -284,13 +284,13 @@ def test_relative_paths(PipenvInstance, testsroot):
|
||||
shutil.copy(source_path, os.path.join(artifact_path, file_name))
|
||||
# Test installing a relative path in a subdirectory
|
||||
c = p.pipenv(f"install {artifact_dir}/{file_name}")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
key = next(k for k in p.pipfile["packages"].keys())
|
||||
dep = p.pipfile["packages"][key]
|
||||
|
||||
assert "path" in dep
|
||||
assert Path(".", artifact_dir, file_name) == Path(dep["path"])
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.install
|
||||
@@ -304,7 +304,7 @@ def test_install_local_file_collision(PipenvInstance):
|
||||
with open(fake_file, "w") as f:
|
||||
f.write("")
|
||||
c = p.pipenv(f"install {target_package}")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert target_package in p.pipfile["packages"]
|
||||
assert p.pipfile["packages"][target_package] == "*"
|
||||
assert target_package in p.lockfile["default"]
|
||||
@@ -330,7 +330,7 @@ six = {{path = "./artifacts/{}"}}
|
||||
)
|
||||
f.write(contents.strip())
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "six" in p.lockfile["default"]
|
||||
|
||||
|
||||
@@ -365,10 +365,10 @@ def test_multiple_editable_packages_should_not_race(PipenvInstance, testsroot):
|
||||
f.write(pipfile_string.strip())
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv('run python -c "import requests, flask, six, jinja2"')
|
||||
assert c.return_code == 0, c.stderr
|
||||
assert c.returncode == 0, c.stderr
|
||||
|
||||
|
||||
@pytest.mark.outdated
|
||||
@@ -376,11 +376,11 @@ def test_multiple_editable_packages_should_not_race(PipenvInstance, testsroot):
|
||||
def test_outdated_should_compare_postreleases_without_failing(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv("install ibm-db-sa-py3==0.3.0")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv("update --outdated")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "Skipped Update" in c.stderr
|
||||
p._pipfile.update("ibm-db-sa-py3", "*")
|
||||
c = p.pipenv("update --outdated")
|
||||
assert c.return_code != 0
|
||||
assert c.returncode != 0
|
||||
assert "out-of-date" in c.stdout
|
||||
|
||||
@@ -16,10 +16,10 @@ from pipenv.utils import subprocess_run
|
||||
def test_basic_vcs_install(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv("install git+https://github.com/benjaminp/six.git@1.11.0#egg=six")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
# edge case where normal package starts with VCS name shouldn't be flagged as vcs
|
||||
c = p.pipenv("install gitdb2")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert all(package in p.pipfile["packages"] for package in ["six", "gitdb2"])
|
||||
assert "git" in p.pipfile["packages"]["six"]
|
||||
assert p.lockfile["default"]["six"] == {
|
||||
@@ -36,7 +36,7 @@ def test_basic_vcs_install(PipenvInstance):
|
||||
def test_git_vcs_install(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv("install git+git://github.com/benjaminp/six.git@1.11.0#egg=six")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "six" in p.pipfile["packages"]
|
||||
assert "git" in p.pipfile["packages"]["six"]
|
||||
assert p.lockfile["default"]["six"] == {
|
||||
@@ -54,7 +54,7 @@ def test_git_vcs_install_with_env_var(PipenvInstance):
|
||||
p._pipfile.add("six", {"git": "git://${GIT_HOST}/benjaminp/six.git", "ref": "1.11.0"})
|
||||
os.environ["GIT_HOST"] = "github.com"
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "six" in p.pipfile["packages"]
|
||||
assert "git" in p.pipfile["packages"]["six"]
|
||||
assert p.lockfile["default"]["six"] == {
|
||||
@@ -71,7 +71,7 @@ def test_git_vcs_install_with_env_var(PipenvInstance):
|
||||
def test_ssh_vcs_install(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv("install git+ssh://git@github.com/benjaminp/six.git@1.11.0#egg=six")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "six" in p.pipfile["packages"]
|
||||
assert "git" in p.pipfile["packages"]["six"]
|
||||
assert p.lockfile["default"]["six"] == {
|
||||
@@ -91,7 +91,7 @@ def test_urls_work(PipenvInstance):
|
||||
c = p.pipenv(
|
||||
"install {0}".format(path)
|
||||
)
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
dep = list(p.pipfile["packages"].values())[0]
|
||||
assert "file" in dep, p.pipfile
|
||||
@@ -114,7 +114,7 @@ def test_file_urls_work(PipenvInstance, pip_src_dir):
|
||||
whl = whl.absolute()
|
||||
wheel_url = whl.as_uri()
|
||||
c = p.pipenv('install "{0}"'.format(wheel_url))
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "six" in p.pipfile["packages"]
|
||||
assert "file" in p.pipfile["packages"]["six"]
|
||||
|
||||
@@ -132,7 +132,7 @@ def test_local_vcs_urls_work(PipenvInstance, tmpdir):
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv("install git+{0}#egg=six".format(six_path.as_uri()))
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "six" in p.pipfile["packages"]
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ def test_editable_vcs_install(PipenvInstance_NoPyPI):
|
||||
c = p.pipenv(
|
||||
"install -e git+https://github.com/kennethreitz/requests.git#egg=requests"
|
||||
)
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "requests" in p.pipfile["packages"]
|
||||
assert "git" in p.pipfile["packages"]["requests"]
|
||||
assert "editable" in p.pipfile["packages"]["requests"]
|
||||
@@ -168,7 +168,7 @@ def test_install_editable_git_tag(PipenvInstance_NoPyPI):
|
||||
c = p.pipenv(
|
||||
"install -e git+https://github.com/benjaminp/six.git@1.11.0#egg=six"
|
||||
)
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "six" in p.pipfile["packages"]
|
||||
assert "six" in p.lockfile["default"]
|
||||
assert "git" in p.lockfile["default"]["six"]
|
||||
@@ -204,7 +204,7 @@ six = "*"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv("install pipenv-test-private-package --index testpypi")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.vcs
|
||||
@@ -218,7 +218,7 @@ def test_install_local_vcs_not_in_lockfile(PipenvInstance):
|
||||
c = subprocess_run(["git", "clone", six_path, "./six"])
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv("install -e ./six")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
six_key = list(p.pipfile["packages"].keys())[0]
|
||||
# we don't need the rest of the test anymore, this just works on its own
|
||||
assert six_key == "six"
|
||||
@@ -233,7 +233,7 @@ def test_get_vcs_refs(PipenvInstance_NoPyPI):
|
||||
c = p.pipenv(
|
||||
"install -e git+https://github.com/benjaminp/six.git@1.9.0#egg=six"
|
||||
)
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "six" in p.pipfile["packages"]
|
||||
assert "six" in p.lockfile["default"]
|
||||
assert (
|
||||
@@ -244,7 +244,7 @@ def test_get_vcs_refs(PipenvInstance_NoPyPI):
|
||||
new_content = pipfile.read_text().replace(u"1.9.0", u"1.11.0")
|
||||
pipfile.write_text(new_content)
|
||||
c = p.pipenv("lock")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert (
|
||||
p.lockfile["default"]["six"]["ref"]
|
||||
== "15e31431af97e5e64b80af0a3f598d382bcdd49a"
|
||||
@@ -279,7 +279,7 @@ Jinja2 = {{ref = "2.11.0", git = "{0}"}}
|
||||
""".format(jinja2_uri).strip()
|
||||
)
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
installed_packages = ["Flask", "Jinja2"]
|
||||
assert all([k in p.pipfile["packages"] for k in installed_packages])
|
||||
assert all([k.lower() in p.lockfile["default"] for k in installed_packages])
|
||||
@@ -301,6 +301,6 @@ def test_vcs_can_use_markers(PipenvInstance):
|
||||
p._pipfile.install("six", {"git": "{0}".format(path.as_uri()), "markers": "sys_platform == 'linux'"})
|
||||
assert "six" in p.pipfile["packages"]
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "six" in p.lockfile["default"]
|
||||
assert "git" in p.lockfile["default"]["six"]
|
||||
|
||||
@@ -22,7 +22,7 @@ def test_lock_handle_eggs(PipenvInstance):
|
||||
RandomWords = "*"
|
||||
""")
|
||||
c = p.pipenv('lock --verbose')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'randomwords' in p.lockfile['default']
|
||||
assert p.lockfile['default']['randomwords']['version'] == '==0.2.1'
|
||||
|
||||
@@ -47,7 +47,7 @@ flask = "==0.12.2"
|
||||
|
||||
c = p.pipenv('lock -r')
|
||||
d = p.pipenv('lock -r -d')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert d.return_code == 0
|
||||
|
||||
for req in req_list:
|
||||
@@ -71,7 +71,7 @@ PyTest = "==3.1.0"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
lock = p.lockfile
|
||||
assert 'requests' in lock['default']
|
||||
assert lock['default']['requests']['version'] == "==2.14.0"
|
||||
@@ -87,7 +87,7 @@ PyTest = "*"
|
||||
f.write(updated_contents)
|
||||
|
||||
c = p.pipenv('lock --keep-outdated')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
lock = p.lockfile
|
||||
assert 'requests' in lock['default']
|
||||
assert lock['default']['requests']['version'] == "==2.18.4"
|
||||
@@ -192,16 +192,16 @@ requests = {git = "https://github.com/psf/requests.git"}
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
lock = p.lockfile
|
||||
assert 'requests' in lock['develop']
|
||||
assert 'click' in lock['default']
|
||||
|
||||
c = p.pipenv('run pip install -e git+https://github.com/dateutil/dateutil#egg=python_dateutil')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
lock = p.lockfile
|
||||
assert 'requests' in lock['develop']
|
||||
assert 'click' in lock['default']
|
||||
@@ -225,7 +225,7 @@ allow_prereleases = true
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert p.lockfile['default']['sqlalchemy']['version'] == '==1.2.0b3'
|
||||
|
||||
|
||||
@@ -245,10 +245,10 @@ maya = "*"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('lock --verbose')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.lock
|
||||
@@ -263,13 +263,13 @@ requests = {version = "*", extras = ["socks"]}
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "requests" in p.lockfile["default"]
|
||||
assert "pysocks" in p.lockfile["default"]
|
||||
assert "markers" not in p.lockfile["default"]['pysocks']
|
||||
|
||||
c = p.pipenv('lock -r')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "extra == 'socks'" not in c.stdout.strip()
|
||||
|
||||
|
||||
@@ -291,9 +291,9 @@ records = {extras = ["pandas"], version = "==0.5.2"}
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'tablib' in p.lockfile['default']
|
||||
assert 'pandas' in p.lockfile['default']
|
||||
|
||||
@@ -322,7 +322,7 @@ requests = "*"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv('install --skip-lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.lock
|
||||
@@ -351,9 +351,9 @@ requests = "*"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('lock -r')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert '-i https://pypi.org/simple' in c.stdout.strip()
|
||||
assert '--extra-index-url https://test.pypi.org/simple' in c.stdout.strip()
|
||||
|
||||
@@ -388,9 +388,9 @@ fake-package = "*"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv(f'install --pypi-mirror {mirror_url}')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv(f'lock -r --pypi-mirror {mirror_url}')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert f'-i {mirror_url}' in c.stdout.strip()
|
||||
assert '--extra-index-url https://test.pypi.org/simple' in c.stdout.strip()
|
||||
assert f'--extra-index-url {mirror_url}' not in c.stdout.strip()
|
||||
@@ -415,12 +415,12 @@ def test_outdated_setuptools_with_pep517_legacy_build_meta_is_updated(PipenvInst
|
||||
"""
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv('run pip install "setuptools<=40.2"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv("run python -c 'import setuptools; print(setuptools.__version__)'")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert c.stdout.strip() == "40.2.0"
|
||||
c = p.pipenv("install legacy-backend-package")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "vistir" in p.lockfile["default"]
|
||||
|
||||
|
||||
@@ -438,12 +438,12 @@ def test_outdated_setuptools_with_pep517_cython_import_in_setuppy(PipenvInstance
|
||||
"""
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv('run pip install "setuptools<=40.2"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv("run python -c 'import setuptools; print(setuptools.__version__)'")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert c.stdout.strip() == "40.2.0"
|
||||
c = p.pipenv("install cython-import-package")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "vistir" in p.lockfile["default"]
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ requests = "==2.14.0"
|
||||
with temp_environ():
|
||||
os.environ['MY_ENV_VAR'] = 'simple'
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'requests' in p.lockfile['default']
|
||||
|
||||
with open(p.pipfile_path, 'w') as f:
|
||||
@@ -479,7 +479,7 @@ requests = "==2.14.0"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'requests' in p.lockfile['default']
|
||||
|
||||
|
||||
@@ -494,12 +494,12 @@ def test_lock_editable_vcs_without_install(PipenvInstance):
|
||||
requests = {git = "https://github.com/psf/requests.git", ref = "master", editable = true}
|
||||
""".strip())
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'requests' in p.lockfile['default']
|
||||
assert 'idna' in p.lockfile['default']
|
||||
assert 'certifi' in p.lockfile['default']
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.vcs
|
||||
@@ -513,11 +513,11 @@ def test_lock_editable_vcs_with_ref_in_git(PipenvInstance):
|
||||
requests = {git = "https://github.com/psf/requests.git@883caaf", editable = true}
|
||||
""".strip())
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert p.lockfile['default']['requests']['git'] == 'https://github.com/psf/requests.git'
|
||||
assert p.lockfile['default']['requests']['ref'] == '883caaf145fbe93bd0d208a6b864de9146087312'
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.vcs
|
||||
@@ -531,11 +531,11 @@ def test_lock_editable_vcs_with_ref(PipenvInstance):
|
||||
requests = {git = "https://github.com/psf/requests.git", ref = "883caaf", editable = true}
|
||||
""".strip())
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert p.lockfile['default']['requests']['git'] == 'https://github.com/psf/requests.git'
|
||||
assert p.lockfile['default']['requests']['ref'] == '883caaf145fbe93bd0d208a6b864de9146087312'
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.vcs
|
||||
@@ -550,13 +550,13 @@ def test_lock_editable_vcs_with_extras_without_install(PipenvInstance):
|
||||
requests = {git = "https://github.com/psf/requests.git", editable = true, extras = ["socks"]}
|
||||
""".strip())
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'requests' in p.lockfile['default']
|
||||
assert 'idna' in p.lockfile['default']
|
||||
assert 'certifi' in p.lockfile['default']
|
||||
assert "socks" in p.lockfile["default"]["requests"]["extras"]
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "requests" in p.lockfile["default"]
|
||||
# For backward compatibility we want to make sure not to include the 'version' key
|
||||
assert "version" not in p.lockfile["default"]["requests"]
|
||||
@@ -573,12 +573,12 @@ def test_lock_editable_vcs_with_markers_without_install(PipenvInstance):
|
||||
requests = {git = "https://github.com/psf/requests.git", ref = "master", editable = true, markers = "python_version >= '2.6'"}
|
||||
""".strip())
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'requests' in p.lockfile['default']
|
||||
assert 'idna' in p.lockfile['default']
|
||||
assert 'certifi' in p.lockfile['default']
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.lock
|
||||
@@ -591,9 +591,9 @@ def test_lock_respecting_python_version(PipenvInstance):
|
||||
django = "*"
|
||||
""".strip())
|
||||
c = p.pipenv('install ')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('run python --version')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
py_version = c.stderr.splitlines()[-1].strip().split()[-1]
|
||||
django_version = '==2.0.6' if py_version.startswith('3') else '==1.11.13'
|
||||
assert py_version == '2.7.14'
|
||||
@@ -607,7 +607,7 @@ def test_lockfile_corrupted(PipenvInstance):
|
||||
with open(p.lockfile_path, 'w') as f:
|
||||
f.write('{corrupted}')
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'Pipfile.lock is corrupted' in c.stderr
|
||||
assert p.lockfile['_meta']
|
||||
|
||||
@@ -619,7 +619,7 @@ def test_lockfile_with_empty_dict(PipenvInstance):
|
||||
with open(p.lockfile_path, 'w') as f:
|
||||
f.write('{}')
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'Pipfile.lock is corrupted' in c.stderr
|
||||
assert p.lockfile['_meta']
|
||||
|
||||
@@ -638,9 +638,9 @@ url = "{}"
|
||||
requests = "*"
|
||||
""".format(p.index_url))
|
||||
c = p.pipenv('install --skip-lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert p.lockfile['_meta']['sources']
|
||||
|
||||
|
||||
@@ -650,9 +650,9 @@ def test_lock_no_warnings(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
os.environ["PYTHONWARNINGS"] = "once"
|
||||
c = p.pipenv("install six")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('run python -c "import warnings; warnings.warn(\\"This is a warning\\", DeprecationWarning); print(\\"hello\\")"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "Warning" in c.stderr
|
||||
assert "Warning" not in c.stdout
|
||||
assert "hello" in c.stdout
|
||||
@@ -673,9 +673,9 @@ def test_lock_missing_cache_entries_gets_all_hashes(PipenvInstance, tmpdir):
|
||||
p._pipfile.add("pathlib2", "*")
|
||||
assert "pathlib2" in p.pipfile["packages"]
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0, (c.stderr, ("\n".join([f"{k}: {v}\n" for k, v in os.environ.items()])))
|
||||
assert c.returncode == 0, (c.stderr, ("\n".join([f"{k}: {v}\n" for k, v in os.environ.items()])))
|
||||
c = p.pipenv("lock --clear")
|
||||
assert c.return_code == 0, c.stderr
|
||||
assert c.returncode == 0, c.stderr
|
||||
assert "pathlib2" in p.lockfile["default"]
|
||||
assert "scandir" in p.lockfile["default"]
|
||||
assert isinstance(p.lockfile["default"]["scandir"]["hashes"], list)
|
||||
@@ -695,7 +695,7 @@ def test_vcs_lock_respects_top_level_pins(PipenvInstance):
|
||||
})
|
||||
p._pipfile.add("urllib3", "==1.21.1")
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "requests" in p.lockfile["default"]
|
||||
assert "git" in p.lockfile["default"]["requests"]
|
||||
assert "urllib3" in p.lockfile["default"]
|
||||
@@ -717,12 +717,12 @@ six = "*"
|
||||
with open(p.pipfile_path, 'w') as f:
|
||||
f.write(contents)
|
||||
c = p.pipenv("lock")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert p.lockfile["default"]["six"]["index"] == "test"
|
||||
with open(p.pipfile_path, 'w') as f:
|
||||
f.write(contents.replace('name = "test"', 'name = "custom"'))
|
||||
c = p.pipenv("lock --clear")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "index" in p.lockfile["default"]["six"]
|
||||
assert p.lockfile["default"]["six"]["index"] == "custom", Path(p.lockfile_path).read_text()
|
||||
|
||||
@@ -736,7 +736,7 @@ def test_lock_nested_direct_url(PipenvInstance):
|
||||
"""
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv("install test_package")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "vistir" in p.lockfile["default"]
|
||||
assert "colorama" in p.lockfile["default"]
|
||||
assert "six" in p.lockfile["default"]
|
||||
@@ -752,7 +752,7 @@ def test_lock_nested_vcs_direct_url(PipenvInstance):
|
||||
"subdirectory": "parent_folder/pep508-package"
|
||||
})
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "git" in p.lockfile["default"]["pep508-package"]
|
||||
assert "sibling-package" in p.lockfile["default"]
|
||||
assert "git" in p.lockfile["default"]["sibling-package"]
|
||||
|
||||
@@ -38,12 +38,12 @@ pytest = "==4.6.9"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv('install --verbose')
|
||||
if c.return_code != 0:
|
||||
if c.returncode != 0:
|
||||
assert c.stderr == '' or c.stderr is None
|
||||
assert c.stdout == ''
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
with open(p.pipfile_path, 'w') as f:
|
||||
contents = """
|
||||
[packages]
|
||||
@@ -52,7 +52,7 @@ requests = "==2.19.1"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('install --deploy')
|
||||
assert c.return_code > 0
|
||||
assert c.returncode > 0
|
||||
|
||||
|
||||
@pytest.mark.update
|
||||
@@ -60,7 +60,7 @@ requests = "==2.19.1"
|
||||
def test_update_locks(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv('install jdcal==1.3')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert p.lockfile['default']['jdcal']['version'] == '==1.3'
|
||||
with open(p.pipfile_path) as fh:
|
||||
pipfile_contents = fh.read()
|
||||
@@ -69,10 +69,10 @@ def test_update_locks(PipenvInstance):
|
||||
with open(p.pipfile_path, 'w') as fh:
|
||||
fh.write(pipfile_contents)
|
||||
c = p.pipenv('update jdcal')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert p.lockfile['default']['jdcal']['version'] == '==1.4'
|
||||
c = p.pipenv('run pip freeze')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
lines = c.stdout.splitlines()
|
||||
assert 'jdcal==1.4' in [l.strip() for l in lines]
|
||||
|
||||
@@ -94,9 +94,9 @@ def test_directory_with_leading_dash(raw_venv, PipenvInstance):
|
||||
if "PIPENV_VENV_IN_PROJECT" in os.environ:
|
||||
del os.environ['PIPENV_VENV_IN_PROJECT']
|
||||
c = p.pipenv('run pip freeze')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('--venv')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
venv_path = c.stdout.strip()
|
||||
assert os.path.isdir(venv_path)
|
||||
# Manually clean up environment, since PipenvInstance assumes that
|
||||
|
||||
@@ -59,7 +59,7 @@ six = {{version = "*", index = "pypi"}}
|
||||
if lock_first:
|
||||
# force source to be cached
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
project = Project()
|
||||
sources = [
|
||||
['pypi', 'https://pypi.org/simple'],
|
||||
@@ -85,7 +85,7 @@ def test_maintain_file_line_endings(PipenvInstance, newlines):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
# Initial pipfile + lockfile generation
|
||||
c = p.pipenv('install pytz')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
# Rewrite each file with parameterized newlines
|
||||
for fn in [p.pipfile_path, p.lockfile_path]:
|
||||
@@ -102,7 +102,7 @@ def test_maintain_file_line_endings(PipenvInstance, newlines):
|
||||
|
||||
# Run pipenv install to programatically rewrite
|
||||
c = p.pipenv('install chardet')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
# Make sure we kept the right newlines
|
||||
for fn in [p.pipfile_path, p.lockfile_path]:
|
||||
@@ -145,7 +145,7 @@ six = {{version = "*", index = "pypi"}}
|
||||
""".format(os.environ['PIPENV_TEST_INDEX']).strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.install
|
||||
@@ -158,7 +158,7 @@ def test_include_editable_packages(PipenvInstance, testsroot, pathlib_tmpdir):
|
||||
with tarfile.open(source_path, "r:gz") as tarinfo:
|
||||
tarinfo.extractall(path=str(pathlib_tmpdir))
|
||||
c = p.pipenv(f'install -e {package.as_posix()}')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
project = Project()
|
||||
assert "tablib" in [
|
||||
package.project_name
|
||||
@@ -211,20 +211,20 @@ def test_run_in_virtualenv_with_global_context(PipenvInstance, virtualenv):
|
||||
def test_run_in_virtualenv(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv('run pip freeze')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'Creating a virtualenv' in c.stderr
|
||||
project = Project()
|
||||
c = p.pipenv("run pip install click")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv("install six")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv('run python -c "import click;print(click.__file__)"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert normalize_path(c.stdout.strip()).startswith(
|
||||
normalize_path(str(project.virtualenv_location))
|
||||
)
|
||||
c = p.pipenv("clean --dry-run")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "click" in c.stdout
|
||||
|
||||
@pytest.mark.project
|
||||
@@ -238,4 +238,4 @@ pytest = "*"
|
||||
""".format(os.environ['PIPENV_TEST_INDEX']).strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv('install --skip-lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
@@ -14,7 +14,7 @@ def test_env(PipenvInstance):
|
||||
f.write('HELLO=WORLD')
|
||||
|
||||
c = p.pipenv('run python -c "import os; print(os.environ[\'HELLO\'])"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'WORLD' in c.stdout
|
||||
|
||||
|
||||
@@ -34,15 +34,15 @@ multicommand = "bash -c \"cd docs && make html\""
|
||||
else:
|
||||
f.write('scriptwithenv = "echo $HELLO"\n')
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv('run printfoo')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert c.stdout == 'foo\n'
|
||||
assert c.stderr == ''
|
||||
|
||||
c = p.pipenv('run notfoundscript')
|
||||
assert c.return_code == 1
|
||||
assert c.returncode == 1
|
||||
assert c.stdout == ''
|
||||
if os.name != 'nt': # TODO: Implement this message for Windows.
|
||||
assert 'Error' in c.stderr
|
||||
|
||||
@@ -16,7 +16,7 @@ def test_sync_error_without_lockfile(PipenvInstance):
|
||||
""".strip())
|
||||
|
||||
c = p.pipenv('sync')
|
||||
assert c.return_code != 0
|
||||
assert c.returncode != 0
|
||||
assert 'Pipfile.lock not found!' in c.stderr
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ verify_ssl = true
|
||||
six = "*"
|
||||
""".strip())
|
||||
c = p.pipenv(f'lock --pypi-mirror {mirror_url}')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv(f'sync --pypi-mirror {mirror_url}')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.sync
|
||||
@@ -55,7 +55,7 @@ def test_sync_should_not_lock(PipenvInstance):
|
||||
|
||||
# Perform initial lock.
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
lockfile_content = p.lockfile
|
||||
assert lockfile_content
|
||||
|
||||
@@ -66,7 +66,7 @@ def test_sync_should_not_lock(PipenvInstance):
|
||||
six = "*"
|
||||
""".strip())
|
||||
c = p.pipenv('sync')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert lockfile_content == p.lockfile
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ requests = "*"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
# Force hash mismatch when installing `requests`
|
||||
lock = p.lockfile
|
||||
@@ -91,7 +91,7 @@ requests = "*"
|
||||
json.dump(lock, f)
|
||||
|
||||
c = p.pipenv('sync --sequential')
|
||||
assert c.return_code != 0
|
||||
assert c.returncode != 0
|
||||
|
||||
|
||||
@pytest.mark.sync
|
||||
@@ -106,7 +106,7 @@ requests = "*"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('lock')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv('sync --sequential --verbose')
|
||||
for package in p.lockfile['default']:
|
||||
|
||||
@@ -15,40 +15,40 @@ def test_uninstall_requests(PipenvInstance):
|
||||
# caused by devendoring
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv("install requests")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "requests" in p.pipfile["packages"]
|
||||
|
||||
c = p.pipenv("run python -m requests.help")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv("uninstall requests")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "requests" not in p.pipfile["dev-packages"]
|
||||
|
||||
c = p.pipenv("run python -m requests.help")
|
||||
assert c.return_code > 0
|
||||
assert c.returncode > 0
|
||||
|
||||
|
||||
@pytest.mark.uninstall
|
||||
def test_uninstall_django(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv("install Django==1.11.13")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "django" in p.pipfile["packages"]
|
||||
assert "django" in p.lockfile["default"]
|
||||
assert "pytz" in p.lockfile["default"]
|
||||
|
||||
c = p.pipenv("run python -m django --version")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv("uninstall Django")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "django" not in p.pipfile["dev-packages"]
|
||||
assert "django" not in p.lockfile["develop"]
|
||||
assert p.lockfile["develop"] == {}
|
||||
|
||||
c = p.pipenv("run python -m django --version")
|
||||
assert c.return_code > 0
|
||||
assert c.returncode > 0
|
||||
|
||||
|
||||
@pytest.mark.install
|
||||
@@ -62,7 +62,7 @@ def test_mirror_uninstall(PipenvInstance):
|
||||
assert "pypi.org" not in mirror_url
|
||||
|
||||
c = p.pipenv(f"install Django==1.11.13 --pypi-mirror {mirror_url}")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "django" in p.pipfile["packages"]
|
||||
assert "django" in p.lockfile["default"]
|
||||
assert "pytz" in p.lockfile["default"]
|
||||
@@ -73,10 +73,10 @@ def test_mirror_uninstall(PipenvInstance):
|
||||
assert "https://pypi.org/simple" == p.lockfile["_meta"]["sources"][0]["url"]
|
||||
|
||||
c = p.pipenv("run python -m django --version")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv(f"uninstall Django --pypi-mirror {mirror_url}")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "django" not in p.pipfile["dev-packages"]
|
||||
assert "django" not in p.lockfile["develop"]
|
||||
assert p.lockfile["develop"] == {}
|
||||
@@ -87,7 +87,7 @@ def test_mirror_uninstall(PipenvInstance):
|
||||
assert "https://pypi.org/simple" == p.lockfile["_meta"]["sources"][0]["url"]
|
||||
|
||||
c = p.pipenv("run python -m django --version")
|
||||
assert c.return_code > 0
|
||||
assert c.returncode > 0
|
||||
|
||||
|
||||
@pytest.mark.files
|
||||
@@ -102,9 +102,9 @@ def test_uninstall_all_local_files(PipenvInstance, testsroot):
|
||||
shutil.copy(source_path, os.path.join(p.path, file_name))
|
||||
os.mkdir(os.path.join(p.path, "tablib"))
|
||||
c = p.pipenv(f"install {file_name}")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv("uninstall --all")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert "tablib" in c.stdout
|
||||
# Uninstall --all is not supposed to remove things from the pipfile
|
||||
# Note that it didn't before, but that instead local filenames showed as hashes
|
||||
@@ -116,10 +116,10 @@ def test_uninstall_all_local_files(PipenvInstance, testsroot):
|
||||
def test_uninstall_all_dev(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv("install --dev Django==1.11.13 six")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv("install tablib")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
assert "tablib" in p.pipfile["packages"]
|
||||
assert "django" in p.pipfile["dev-packages"]
|
||||
@@ -129,10 +129,10 @@ def test_uninstall_all_dev(PipenvInstance):
|
||||
assert "six" in p.lockfile["develop"]
|
||||
|
||||
c = p.pipenv('run python -c "import django"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv("uninstall --all-dev")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert p.pipfile["dev-packages"] == {}
|
||||
assert "django" not in p.lockfile["develop"]
|
||||
assert "six" not in p.lockfile["develop"]
|
||||
@@ -140,10 +140,10 @@ def test_uninstall_all_dev(PipenvInstance):
|
||||
assert "tablib" in p.lockfile["default"]
|
||||
|
||||
c = p.pipenv('run python -c "import django"')
|
||||
assert c.return_code > 0
|
||||
assert c.returncode > 0
|
||||
|
||||
c = p.pipenv('run python -c "import tablib"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.uninstall
|
||||
@@ -159,7 +159,7 @@ python_DateUtil = "*"
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv("uninstall python_dateutil")
|
||||
assert "Requests" in p.pipfile["packages"]
|
||||
@@ -174,13 +174,13 @@ python_DateUtil = "*"
|
||||
def test_uninstall_all_dev_with_shared_dependencies(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv("install pytest")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv("install --dev six")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv("uninstall --all-dev")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
assert "six" in p.lockfile["develop"]
|
||||
|
||||
@@ -189,8 +189,8 @@ def test_uninstall_all_dev_with_shared_dependencies(PipenvInstance):
|
||||
def test_uninstall_missing_parameters(PipenvInstance):
|
||||
with PipenvInstance() as p:
|
||||
c = p.pipenv("install requests")
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv("uninstall")
|
||||
assert c.return_code != 0
|
||||
assert c.returncode != 0
|
||||
assert "No package provided!" in c.stderr
|
||||
|
||||
@@ -15,11 +15,11 @@ def test_case_changes_windows(PipenvInstance):
|
||||
"""
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv('install pytz')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
# Canonical venv location.
|
||||
c = p.pipenv('--venv')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
virtualenv_location = c.stdout.strip()
|
||||
|
||||
# Dance around to change the casing of the project directory.
|
||||
@@ -32,7 +32,7 @@ def test_case_changes_windows(PipenvInstance):
|
||||
|
||||
# Ensure the incorrectly-cased project can find the correct venv.
|
||||
c = p.pipenv('--venv')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert c.stdout.strip().lower() == virtualenv_location.lower()
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ def test_local_path_windows(PipenvInstance):
|
||||
whl = whl.absolute()
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv(f'install "{whl}"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.local
|
||||
@@ -65,17 +65,17 @@ def test_local_path_windows_forward_slash(PipenvInstance):
|
||||
whl = whl.absolute()
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv(f'install "{whl.as_posix()}"')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.cli
|
||||
def test_pipenv_clean_windows(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
c = p.pipenv('install requests')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
c = p.pipenv(f'run pip install -i {p.index_url} click')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
|
||||
c = p.pipenv('clean --dry-run')
|
||||
assert c.return_code == 0
|
||||
assert c.returncode == 0
|
||||
assert 'click' in c.stdout.strip()
|
||||
|
||||
Reference in New Issue
Block a user