Merge branch 'master' into windows-cmder-root-space-escape-fix

This commit is contained in:
Dan Ryan
2018-05-16 00:17:16 -04:00
committed by GitHub
14 changed files with 145 additions and 4445 deletions
+29
View File
@@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
---
Be sure to check the existing issues (both open and closed!).
Describe the issue briefly here.
Please run `$ python -m pipenv.help`, and paste the results here.
If you're on MacOS, just run the following:
$ python -m pipenv.help | pbcopy
------------
##### Expected result
Describe what you expected.
##### Actual result
When possible, provide the verbose output (`--verbose`), especially for locking and dependencies resolving issues.
##### Steps to replicate
Provide the steps to replicate (which usually at least includes the commands and the Pipfile).
+7
View File
@@ -0,0 +1,7 @@
---
name: Usage / Requests for Help
about: Requests for assistance or general usage guidance.
---
Please refer to our [StackOverflow tag](https://stackoverflow.com/questions/tagged/pipenv) for more information.
+17
View File
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+25
View File
@@ -0,0 +1,25 @@
sudo: false
dist: trusty
language: python
python:
- "3.6"
- "2.7"
env:
global:
- PYPI_VENDOR_DIR='./tests/pypi/'
- GIT_ASK_YESNO='false'
- PYTHONIOENCODING='utf-8'
matrix:
- TEST_SUITE='not install'
- TEST_SUITE='install'
PYTEST_ADDOPTS='--cache-clear'
install:
- "pip install --upgrade pip"
- "pip install -e . --upgrade --upgrade-strategy=only-if-needed"
- "pipenv install --dev"
- 'pip install -e "$(pwd)" --upgrade'
- 'pipenv install --system --dev'
script:
- 'pipenv run time pytest -v -n 4 -m "$TEST_SUITE" tests'
+5 -1
View File
@@ -1,3 +1,7 @@
2018.05.12:
- Switch to calver for versioning.
11.10.4:
- Bugfix release (_mkstmp_inner backport breaks python3.4/3.5 compat)
11.10.3:
- Bugfix release (break dependency on pathlib2).
11.10.2:
@@ -49,7 +53,7 @@
- Bugfix for allow_global with new resolver fixes.
- Locally cache hashes for performance gains.
- Lock prereleases correctly.
- Add reqeuests.pem back to package.
- Add requests.pem back to package.
- Auto-toggle PIPENV_VENV_IN_PROJECT when .venv is present.
- Fix bug with pipfile casing.
- Enable environment variable interpolation in pipfiles.
+1 -1
View File
@@ -18,7 +18,7 @@ Pipenv: Python Development Workflow for Humans
---------------
**Pipenv** — the officially recommended Python packaging tool from `Python.org <https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies>`_, free (as in freedom).
**Pipenv** — the recommended tool for managing application dependencies from `packaging.python.org <https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies>`__, free (as in freedom).
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. *Windows is a firstclass citizen, in our world.*
+1 -1
View File
@@ -20,7 +20,7 @@ Pipenv: Python Dev Workflow for Humans
---------------
**Pipenv** — the officially recommended Python packaging tool from `Python.org <https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies>`_, free (as in freedom).
**Pipenv** — the recommended tool for managing application dependencies from `packaging.python.org <https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies>`__, free (as in freedom).
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. *Windows is a first-class citizen, in our world.*
+1 -1
View File
@@ -2,4 +2,4 @@
# // ) ) / / // ) ) //___) ) // ) ) || / /
# //___/ / / / //___/ / // // / / || / /
# // / / // ((____ // / / ||/ /
__version__ = '11.10.3'
__version__ = '2018.05.18'
+15 -2
View File
@@ -884,10 +884,13 @@ def do_create_virtualenv(python=None, site_packages=False):
crayons.normal(u'Creating a virtualenv for this project…', bold=True),
err=True,
)
click.echo(u'Pipfile: {0}'.format(
crayons.red(project.pipfile_location, bold=True),
), err=True)
# The user wants the virtualenv in the project.
if project.is_venv_in_project():
cmd = [
'virtualenv',
sys.executable, '-m', 'virtualenv',
project.virtualenv_location,
'--prompt=({0})'.format(project.name),
]
@@ -1346,7 +1349,9 @@ def do_init(
do_lock(system=system, pre=pre, keep_outdated=keep_outdated)
# Write out the lockfile if it doesn't exist.
if not project.lockfile_exists and not skip_lock:
if system or allow_global and not PIPENV_VIRTUALENV:
# Unless we're in a virtualenv not managed by pipenv, abort if we're
# using the system's python.
if (system or allow_global) and not PIPENV_VIRTUALENV:
click.echo(
'{0}: --system is intended to be used for Pipfile installation, '
'not installation of specific packages. Aborting.'.format(
@@ -2012,6 +2017,14 @@ def do_install(
err=True,
)
click.echo(crayons.blue(format_pip_error(c.err)), err=True)
if 'setup.py egg_info' in c.err:
click.echo(
"This is likely caused by a bug in {0}. "
"Report this to its maintainers.".format(
crayons.green(package_name),
),
err=True,
)
requirements_directory.cleanup()
sys.exit(1)
click.echo(
+2
View File
@@ -216,6 +216,8 @@ def shell(env, cwd=None):
inve(env, shell, '-c', shell_check)
except CalledProcessError:
return
if shell_name in ('Cmder', 'cmd'):
os.environ['PROMPT'] = '({0}) {1}'.format(env, os.environ['PROMPT'])
if shell_name == 'bash':
fork_bash(env, cwd)
elif shell_name == 'Cmder':
-4433
View File
File diff suppressed because it is too large Load Diff
+23 -5
View File
@@ -84,14 +84,16 @@ def log(msg):
print('[vendoring.%s] %s' % (TASK_NAME, msg))
def _get_git_root(ctx):
return Path(ctx.run('git rev-parse --show-toplevel', hide=True).stdout.strip())
def _get_vendor_dir(ctx):
git_root = ctx.run('git rev-parse --show-toplevel', hide=True).stdout
return Path(git_root.strip()) / 'pipenv' / 'vendor'
return _get_git_root(ctx) / 'pipenv' / 'vendor'
def _get_patched_dir(ctx):
git_root = ctx.run('git rev-parse --show-toplevel', hide=True).stdout
return Path(git_root.strip()) / 'pipenv' / 'patched'
return _get_git_root(ctx) / 'pipenv' / 'patched'
def clean_vendor(ctx, vendor_dir):
@@ -321,7 +323,7 @@ def vendor(ctx, vendor_dir, rewrite=True):
rewrite_file_imports(item, vendored_libs, vendor_dir)
write_backport_imports(ctx, vendor_dir)
log('Applying post-patches...')
patches = patch_dir.glob('*.patch' if not is_patched else '_post*.patch')
patches = patch_dir.glob('*.patch' if not is_patched else '_post*.patch')
for patch in patches:
apply_patch(ctx, patch)
if is_patched:
@@ -457,6 +459,22 @@ def extract_license_member(vendor_dir, tar, member, name):
dest.write_bytes(tar.read(member))
@invoke.task()
def generate_patch(ctx, package_path, patch_description, base='HEAD'):
pkg = Path(package_path)
if len(pkg.parts) != 2 or pkg.parts[0] not in ('vendor', 'patched'):
raise ValueError('example usage: generate-patch patched/pew some-description')
patch_fn = '{0}-{1}.patch'.format(pkg.parts[1], patch_description)
command = 'git diff {base} -p {root} > {out}'.format(
base=base,
root=Path('pipenv').joinpath(pkg),
out=Path(__file__).parent.joinpath('patches', pkg.parts[0], patch_fn),
)
with ctx.cd(str(_get_git_root(ctx))):
log(command)
ctx.run(command)
@invoke.task(name=TASK_NAME)
def main(ctx):
vendor_dir = _get_vendor_dir(ctx)
@@ -0,0 +1,13 @@
diff --git a/pipenv/patched/pew/pew.py b/pipenv/patched/pew/pew.py
index 2d3889a0..07dbdf4f 100644
--- a/pipenv/patched/pew/pew.py
+++ b/pipenv/patched/pew/pew.py
@@ -215,6 +215,8 @@ def shell(env, cwd=None):
inve(env, shell, '-c', shell_check)
except CalledProcessError:
return
+ if shell_name in ('Cmder', 'cmd'):
+ os.environ['PROMPT'] = '({0}) {1}'.format(env, os.environ['PROMPT'])
if shell_name == 'bash':
fork_bash(env, cwd)
elif shell_name == 'Cmder':
+6 -1
View File
@@ -10,6 +10,11 @@ from pipenv.vendor import requests
from pipenv.vendor import six
from pipenv.vendor import toml
try:
from pathlib import Path
except ImportError:
from pipenv.vendor.pathlib2 import Path
if six.PY2:
class ResourceWarning(Warning):
@@ -45,7 +50,7 @@ class _PipenvInstance(object):
self.original_umask = os.umask(0o007)
self.original_dir = os.path.abspath(os.curdir)
self._path = TemporaryDirectory(suffix='-project', prefix='pipenv-')
self.path = self._path.name
self.path = str(Path(self._path.name).resolve())
# set file creation perms
self.pipfile_path = None
self.chdir = chdir