diff --git a/HISTORY.txt b/HISTORY.txt index 66e4fe5e..a2106db9 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -1,5 +1,7 @@ 3.2.5: - Significant speed improvements for pipenv run and pipenv shell. + - Shell completion via click-completion. + - Perform package name normalization as best effort attempt. 3.2.4: - $ pipenv uninstall --all - Don't uninstall setuptools, wheel, pip, or six. diff --git a/Pipfile b/Pipfile index 394700d3..f6aee2a7 100644 --- a/Pipfile +++ b/Pipfile @@ -1,6 +1,3 @@ -[dev-packages] -pytest = "*" - [packages] click = "*" crayons = "*" diff --git a/README.rst b/README.rst index c22281da..d69a56d7 100644 --- a/README.rst +++ b/README.rst @@ -58,6 +58,16 @@ Other Commands - ``run`` will run a given command from the virtualenv, with any arguments forwarded (e.g. ``$ pipenv run python``). - ``check`` asserts that PEP 508 requirements are being met by the current environment. +Shell Completion +//////////////// + +Set ``_PIPENV_COMPLETE`` and then source the output of the program. For example, with fish, put this +in your ``~/.config/fish/completions/pipenv.fish``:: + + eval (env _PIPENV_COMPLETE=source-fish pipenv) + +Magic shell completions are now enabled! + Caveats /////// diff --git a/pipenv/__version__.py b/pipenv/__version__.py index f8b8c35f..0223f2dc 100644 --- a/pipenv/__version__.py +++ b/pipenv/__version__.py @@ -1 +1 @@ -__version__ = '3.2.TEST' +__version__ = '3.2.5' diff --git a/pipenv/cli.py b/pipenv/cli.py index d166f7c7..fce1cfa5 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -8,6 +8,7 @@ import shutil import signal import click +import click_completion import crayons import delegator import parse @@ -32,6 +33,8 @@ if sys.version_info < (3, 3): else: from shutil import get_terminal_size +# Enable shell completion. +click_completion.init() # Disable warnings for Python 2.6. requests.packages.urllib3.disable_warnings(InsecureRequestWarning) @@ -106,8 +109,14 @@ def ensure_proper_casing(): # Replace each package with proper casing. for dep in p[section].keys(): - # Get new casing for package name. - new_casing = proper_case(dep) + # Attempt to normalize name from PyPI. + # Use provided name if better one can't be found. + try: + # Get new casing for package name. + new_casing = proper_case(dep) + except IOError: + # Unable to normalize package name. + continue if new_casing == dep: continue diff --git a/setup.py b/setup.py index 7dfb10bc..fc09882a 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,8 @@ if sys.argv[-1] == "publish": required = [ 'crayons', 'toml', - 'click', + 'click>=6.7', + 'click-completion', 'pip', 'parse', 'virtualenv', @@ -34,7 +35,7 @@ required = [ 'requirements-parser', 'pexpect', 'pipfile==0.0.1', - 'requests' + 'requests>=2.4.0' ] # Backport required for earlier versions of Python. diff --git a/tests/requirements_requests.txt b/tests/requirements_requests.txt index f2293605..ff02e683 100644 --- a/tests/requirements_requests.txt +++ b/tests/requirements_requests.txt @@ -1 +1 @@ -requests +requests>2.3.0