Merge branch 'master' of github.com:kennethreitz/pipenv

This commit is contained in:
2017-09-27 09:27:10 -04:00
6 changed files with 46 additions and 22 deletions
+1
View File
@@ -12,3 +12,4 @@ build
test_project
Pipfile.lock
/.vscode/
.idea
+1
View File
@@ -16,6 +16,7 @@ environment:
- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.x"
PYTHON_ARCH: "64"
- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.x"
+17 -8
View File
@@ -46,7 +46,7 @@ from .environments import (
PIPENV_COLORBLIND, PIPENV_NOSPIN, PIPENV_SHELL_FANCY,
PIPENV_VENV_IN_PROJECT, PIPENV_USE_SYSTEM, PIPENV_TIMEOUT,
PIPENV_SKIP_VALIDATION, PIPENV_HIDE_EMOJIS, PIPENV_INSTALL_TIMEOUT,
PYENV_INSTALLED, PIPENV_YES, PIPENV_DONT_LOAD_ENV,
PYENV_ROOT, PYENV_INSTALLED, PIPENV_YES, PIPENV_DONT_LOAD_ENV,
PIPENV_DEFAULT_PYTHON_VERSION, PIPENV_MAX_SUBPROCESS,
PIPENV_DONT_USE_PYENV, SESSION_IS_INTERACTIVE, PIPENV_USE_SYSTEM,
PIPENV_DOTENV_LOCATION
@@ -122,7 +122,6 @@ urllib3.disable_warnings(InsecureRequestWarning)
project = Project()
def load_dot_env():
if not PIPENV_DONT_LOAD_ENV:
denv = dotenv.find_dotenv(PIPENV_DOTENV_LOCATION or os.sep.join([project.project_directory, '.env']))
@@ -390,13 +389,23 @@ def ensure_python(three=None, python=None):
def activate_pyenv():
"""Adds all pyenv installations to the PATH."""
if PYENV_INSTALLED:
for found in glob(
'{0}{1}versions{1}*{1}bin'.format(
os.environ.get('PYENV_ROOT'),
os.sep
if PYENV_ROOT:
for found in glob(
'{0}{1}versions{1}*{1}bin'.format(
PYENV_ROOT,
os.sep
)
):
add_to_path(found)
else:
click.echo(
'{0}: PYENV_ROOT is not set. New python paths will '
'probably not be exported properly after installation.'
''.format(
crayons.red('Warning', bold=True),
), err=True
)
):
add_to_path(found)
global USING_DEFAULT_PYTHON
+3 -1
View File
@@ -78,6 +78,8 @@ PIPENV_INSTALL_TIMEOUT = 60 * 15
PIPENV_DONT_USE_PYENV = os.environ.get('PIPENV_DONT_USE_PYENV')
PYENV_INSTALLED = (bool(os.environ.get('PYENV_SHELL')) or bool(os.environ.get('PYENV_ROOT')))
PYENV_ROOT = os.environ.get('PYENV_ROOT')
PYENV_INSTALLED = (bool(os.environ.get('PYENV_SHELL')) or bool(PYENV_ROOT))
SESSION_IS_INTERACTIVE = bool(os.isatty(sys.stdout.fileno()))
+1 -1
View File
@@ -132,7 +132,7 @@ packages = [
'multi-key-dict', 'fuzzywuzzy', 'fasteners', 'youtube-dl',
'pycryptodome', 'smmap', 'gitdb', 'setuptools-git', 'pager',
'python-subunit', 'warlock', 'extras', 'capstone', 'httpretty',
'factory-boy', 'webtest', 'django-cors-headers', 'codeintel', 'suds',
'factory_boy', 'webtest', 'django-cors-headers', 'codeintel', 'suds',
'pyodbc', 'geoip2', 'filechunkio', 'fixtures', 'pysocks', 'statsmodels',
'google-auth-httplib2', 'kafka-python', 'applicationinsights', 'yarl',
'cassandra-driver', 'azure-mgmt-compute', 'pathlib', 'python-jwt', 'sh',
+23 -12
View File
@@ -132,20 +132,32 @@ class TestPipenv:
with PipenvInstance() as p:
assert p.pipenv('--help').out
@pytest.mark.cli
def test_completion(self):
with PipenvInstance() as p:
assert p.pipenv('--completion').out
@pytest.mark.cli
def test_man(self):
with PipenvInstance() as p:
c = p.pipenv('--man')
assert c.return_code == 0 or c.err
@pytest.mark.install
@pytest.mark.setup
@pytest.mark.skip(reason="this doesn't work on travis")
def test_basic_setup(self):
with PipenvInstance(pipfile=False) as p:
c = p.pipenv('install requests')
assert c.return_code == 0
with PipenvInstance() as p:
with PipenvInstance(pipfile=False) as p:
c = p.pipenv('install requests')
assert c.return_code == 0
assert 'requests' in p.pipfile['packages']
assert 'requests' in p.lockfile['default']
assert 'chardet' in p.lockfile['default']
assert 'idna' in p.lockfile['default']
assert 'urllib3' in p.lockfile['default']
assert 'certifi' in p.lockfile['default']
assert 'requests' in p.pipfile['packages']
assert 'requests' in p.lockfile['default']
assert 'chardet' in p.lockfile['default']
assert 'idna' in p.lockfile['default']
assert 'urllib3' in p.lockfile['default']
assert 'certifi' in p.lockfile['default']
@pytest.mark.spelling
@pytest.mark.skip(reason="this is slightly non-deterministic")
@@ -433,7 +445,6 @@ requests = {version = "*"}
@pytest.mark.code
@pytest.mark.install
@pytest.mark.skip(reason="this doesn't work on travis")
def test_code_import_manual(self):
with PipenvInstance() as p:
@@ -511,7 +522,7 @@ requests = {version = "*"}
('/bin/csh', '.csh'),
('/bin/unknown', '')]
)
@pytest.mark.skip(reason="this doesn't work on app veyor")
@pytest.mark.skipif(os.name == 'nt', reason="Not supported to windows")
def test_activate_virtualenv(self, shell, extension):
orig_shell = os.environ['SHELL']
@@ -551,7 +562,7 @@ pytest = "==3.1.1"
req_list = ("requests==2.14.0", "flask==0.12.2", "pytest==3.1.1")
c = p.pipenv('lock -r')
c = p.pipenv('lock --requirements')
assert c.return_code == 0
for req in req_list:
assert req in c.out