Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix editable installs and improve logging #3810

Merged
merged 19 commits into from
Jul 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
url = https://github.com/pinax/pinax.git
[submodule "tests/test_artifacts/git/requests"]
path = tests/test_artifacts/git/requests
url = https://github.com/requests/requests.git
url = https://github.com/kennethreitz/requests.git
[submodule "tests/test_artifacts/git/six"]
path = tests/test_artifacts/git/six
url = https://github.com/benjaminp/six.git
Expand All @@ -24,7 +24,7 @@
url = https://github.com/pallets/flask.git
[submodule "tests/test_artifacts/git/requests-2.18.4"]
path = tests/test_artifacts/git/requests-2.18.4
url = https://github.com/requests/requests
url = https://github.com/kennethreitz/requests
[submodule "tests/pypi"]
path = tests/pypi
url = https://github.com/sarugaku/pipenv-test-artifacts.git
46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,50 @@
get_venv_dir:=$(shell mktemp -d 2>/dev/null || mktemp -d -t 'tmpvenv')
venv_dir := $(get_venv_dir)/pipenv_venv
venv_file := $(CURDIR)/.test_venv
get_venv_path =$(file < $(venv_file))

format:
black pipenv/*.py
test:
docker-compose up

.PHONY: ramdisk
ramdisk:
sudo mkdir -p /mnt/ramdisk
sudo mount -t tmpfs -o size=2g tmpfs /mnt/ramdisk
sudo chown -R ${USER}:${USER} /mnt/ramdisk

.PHONY: ramdisk-virtualenv
ramdisk-virtualenv: ramdisk
[ ! -e "/mnt/ramdisk/.venv/bin/activate" ] && \
python -m virtualenv /mnt/ramdisk/.venv
@echo "/mnt/ramdisk/.venv" >> $(venv_file)

.PHONY: virtualenv
virtualenv:
[ ! -e $(venv_dir) ] && rm -rf $(venv_file) && python -m virtualenv $(venv_dir)
@echo $(venv_dir) >> $(venv_file)

.PHONY: test-install
test-install: virtualenv
. $(get_venv_path)/bin/activate && \
python -m pip install --upgrade pip virtualenv -e .[tests,dev] && \
pipenv install --dev

.PHONY: submodules
submodules:
git submodule sync
git submodule update --init --recursive

.PHONY: tests
tests: virtualenv submodules test-install
. $(get_venv_path)/bin/activate && \
pipenv run pytest -ra -vvv --full-trace --tb=long

.PHONY: test-specific
test-specific: submodules virtualenv test-install
. $(get_venv_path)/bin/activate && pipenv run pytest -ra -k '$(tests)'

.PHONY: retest
retest: virtualenv submodules test-install
. $(get_venv_path)/bin/activate && pipenv run pytest -ra -k 'test_check_unused or test_install_editable_git_tag or test_get_vcs_refs or test_skip_requirements_when_pipfile or test_editable_vcs_install or test_basic_vcs_install or test_git_vcs_install or test_ssh_vcs_install or test_vcs_can_use_markers' -vvv --full-trace --tb=long
75 changes: 62 additions & 13 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions news/3809.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed several bugs which could prevent editable VCS dependencies from being installed into target environments, even when reporting successful installation.
1 change: 1 addition & 0 deletions news/3810.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved verbose logging output during ``pipenv lock`` will now stream output to the console while maintaining a spinner.
2 changes: 2 additions & 0 deletions pipenv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
pass

from pipenv.vendor.vistir.misc import get_text_stream

stdout = get_text_stream("stdout")
stderr = get_text_stream("stderr")

if os.name == "nt":
from pipenv.vendor.vistir.misc import _can_use_color, _wrap_for_color

if _can_use_color(stdout):
stdout = _wrap_for_color(stdout)
if _can_use_color(stderr):
Expand Down
6 changes: 3 additions & 3 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
argument, echo, edit, group, option, pass_context, secho, version_option
)

import click_completion
import crayons
import delegator
from ..vendor import click_completion
from ..vendor import delegator
from ..patched import crayons

from ..__version__ import __version__
from .options import (
Expand Down
Loading