diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3bfe4e0d..5ad4fcd8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,5 @@ -2018.05.18 (2018-06-17) -======================= +2018.6.0.dev0 (2018-06-18) +========================== Features & Improvements @@ -78,6 +78,10 @@ Bug Fixes - VCS dependencies are now manually obtained only if they do not match the requested ref. `#2304 `_ +- Added error handling functionality to properly cope with single-digit ``Requires-Python`` metatdata with no specifiers. `#2377 `_ + +- ``pipenv update`` will now always run the resolver and lock before ensuring your dependencies are in sync with your lockfile. `#2379 `_ + Vendored Libraries ------------------ diff --git a/news/2386.bugfix b/news/2386.bugfix new file mode 100644 index 00000000..ae0e87c7 --- /dev/null +++ b/news/2386.bugfix @@ -0,0 +1 @@ +Patched ``python-dotenv`` to ensure that environment variables always get encoded to the filesystem encoding. diff --git a/news/2386.vendor b/news/2386.vendor new file mode 100644 index 00000000..ae0e87c7 --- /dev/null +++ b/news/2386.vendor @@ -0,0 +1 @@ +Patched ``python-dotenv`` to ensure that environment variables always get encoded to the filesystem encoding. diff --git a/news/2388.feature b/news/2388.feature new file mode 100644 index 00000000..2286baf7 --- /dev/null +++ b/news/2388.feature @@ -0,0 +1 @@ +Massive internal improvements to requirements parsing codebase, resolver, and error messaging. diff --git a/pipenv/core.py b/pipenv/core.py index 0610e214..3bc5e6af 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -1889,13 +1889,19 @@ def do_install( # Capture -e argument and assign it to following package_name. more_packages = list(more_packages) if package_name == '-e': + if not more_packages: + raise click.BadArgumentUsage('Please provide path to editable package') package_name = ' '.join([package_name, more_packages.pop(0)]) # capture indexes and extra indexes line = [package_name] + more_packages + line = ' '.join(str(s) for s in line).strip() index_indicators = ['-i', '--index', '--extra-index-url'] index, extra_indexes = None, None - if more_packages and any(more_packages[0].startswith(s) for s in index_indicators): - line, index = split_argument(' '.join(line), short='i', long_='index', num=1) + if any(line.endswith(s) for s in index_indicators): + # check if cli option is not end of command + raise click.BadArgumentUsage('Please provide index value') + if any(s in line for s in index_indicators): + line, index = split_argument(line, short='i', long_='index', num=1) line, extra_indexes = split_argument(line, long_='extra-index-url') package_names = line.split() package_name = package_names[0] diff --git a/pipenv/vendor/dotenv/main.py b/pipenv/vendor/dotenv/main.py index 3d1bd72f..75f49c4a 100644 --- a/pipenv/vendor/dotenv/main.py +++ b/pipenv/vendor/dotenv/main.py @@ -94,6 +94,13 @@ class DotEnv(): for k, v in self.dict().items(): if k in os.environ and not override: continue + # With Python 2 on Windows, ensuree environment variables are + # system strings to avoid "TypeError: environment can only contain + # strings" in Python's subprocess module. + if sys.version_info.major < 3 and sys.platform == 'win32': + from pipenv.utils import fs_str + k = fs_str(k) + v = fs_str(v) os.environ[k] = v return True diff --git a/tasks/release.py b/tasks/release.py index 78d0ace6..260e46ac 100644 --- a/tasks/release.py +++ b/tasks/release.py @@ -53,10 +53,14 @@ def upload_dists(ctx): @invoke.task -def generate_changelog(ctx, commit=False): +def generate_changelog(ctx, commit=False, draft=False): log('Generating changelog...') - ctx.run('towncrier') + if draft: + commit = False + log('Writing draft to file...') + ctx.run('towncrier --draft > CHANGELOG.rst') if commit: + ctx.run('towncrier') log('Committing...') ctx.run('git add .') ctx.run('git commit -m "Update changelog."') diff --git a/tasks/vendoring/patches/vendor/dotenv-windows-unicode.patch b/tasks/vendoring/patches/vendor/dotenv-windows-unicode.patch new file mode 100644 index 00000000..c090e885 --- /dev/null +++ b/tasks/vendoring/patches/vendor/dotenv-windows-unicode.patch @@ -0,0 +1,18 @@ +diff --git a/pipenv/vendor/dotenv/main.py b/pipenv/vendor/dotenv/main.py +index 3d1bd72f..75f49c4a 100644 +--- a/pipenv/vendor/dotenv/main.py ++++ b/pipenv/vendor/dotenv/main.py +@@ -94,6 +94,13 @@ class DotEnv(): + for k, v in self.dict().items(): + if k in os.environ and not override: + continue ++ # With Python 2 on Windows, ensuree environment variables are ++ # system strings to avoid "TypeError: environment can only contain ++ # strings" in Python's subprocess module. ++ if sys.version_info.major < 3 and sys.platform == 'win32': ++ from pipenv.utils import fs_str ++ k = fs_str(k) ++ v = fs_str(v) + os.environ[k] = v + + return True diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index bd0b96c3..a6798aa3 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -299,3 +299,13 @@ name = 'mockpi' assert c.return_code == 0 assert p.pipfile['source'][0]['url'] == '${PYPI_URL}/simple' assert p.lockfile['_meta']['sources'][0]['url'] == '${PYPI_URL}/simple' + + +@pytest.mark.editable +@pytest.mark.badparameter +@pytest.mark.install +def test_editable_no_args(PipenvInstance): + with PipenvInstance() as p: + c = p.pipenv('install -e') + assert c.return_code != 0 + assert 'Please provide path to editable package' in c.err