Skip to content

Commit

Permalink
Update vendored dependency pins
Browse files Browse the repository at this point in the history
- Update gitignore entries for mypy config
- Update release task to add version after bumping but before release
- Fixes #3326 (going forward at least)
- Split out patching from vendoring so it can be done as a separate step
  if needed
- Update patches to account for updated packages
- Fixes #3432
- Fixes #2757
- Fixes #3305
- Fixes #2914
- Fixes #3439
- Fixes #3422
- Fixes #3378
- Fixes #3376
- Fixes #3315

Signed-off-by: Dan Ryan <[email protected]>
  • Loading branch information
techalchemy committed Jan 21, 2019
1 parent 44db5dd commit ed3f206
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,8 @@ venv.bak/

# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
.vs/slnx.sqlite

# mypy/typing section
typeshed/
.dmypy.json
mypyhtml/
34 changes: 17 additions & 17 deletions pipenv/vendor/vendor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,48 @@ blindspin==2.0.1
click==7.0
click-completion==0.5.0
click-didyoumean==0.0.3
colorama==0.3.9
colorama==0.4.1
delegator.py==0.1.1
pexpect==4.6.0
ptyprocess==0.6.0
python-dotenv==0.9.1
python-dotenv==0.10.1
first==2.0.1
iso8601==0.1.12
jinja2==2.10
markupsafe==1.0
parse==1.9.0
pathlib2==2.3.2
pathlib2==2.3.3
scandir==1.9
pipdeptree==0.13.0
pipdeptree==0.13.1
pipreqs==0.4.9
docopt==0.6.2
yarg==0.1.9
pythonfinder==1.1.10
requests==2.20.1
requests==2.21.0
chardet==3.0.4
idna==2.7
urllib3==1.24
certifi==2018.10.15
requirementslib==1.3.3
idna==2.8
urllib3==1.24.1
certifi==2018.11.29
requirementslib==1.4.0
attrs==18.2.0
distlib==0.2.8
packaging==18.0
pyparsing==2.2.2
packaging==19.0
pyparsing==2.3.1
git+https://github.com/sarugaku/plette.git@master#egg=plette
tomlkit==0.5.2
shellingham==1.2.7
six==1.11.0
tomlkit==0.5.3
shellingham==1.2.8
six==1.12.0
semver==2.8.1
shutilwhich==1.1.0
toml==0.10.0
cached-property==1.4.3
vistir==0.2.5
cached-property==1.5.1
vistir==0.3.0
pip-shims==0.3.2
ptyprocess==0.6.0
enum34==1.1.6
yaspin==0.14.0
cerberus==1.2
git+https://github.com/sarugaku/passa.git@master#egg=passa
cursor==1.2.0
resolvelib==0.2.2
backports.functools_lru_cache==1.5
pep517==0.5.0
2 changes: 1 addition & 1 deletion tasks/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def release(ctx, dry_run=False):
log(f'Would commit with message: "Release v{version}"')
else:
ctx.run('towncrier')
ctx.run("git add CHANGELOG.rst news/")
ctx.run("git add CHANGELOG.rst news/ {0}".format(get_version_file(ctx).as_posix()))
ctx.run("git rm CHANGELOG.draft.rst")
ctx.run(f'git commit -m "Release v{version}"')

Expand Down
31 changes: 22 additions & 9 deletions tasks/vendoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,26 @@ def post_install_cleanup(ctx, vendor_dir):
remove_all(vendor_dir.glob('toml.py'))


@invoke.task
def apply_patches(ctx, patched=False, pre=False):
if patched:
vendor_dir = _get_patched_dir(ctx)
else:
vendor_dir = _get_vendor_dir(ctx)
log("Applying pre-patches...")
patch_dir = Path(__file__).parent / 'patches' / vendor_dir.name
if pre:
if not patched:
pass
for patch in patch_dir.glob('*.patch'):
if not patch.name.startswith('_post'):
apply_patch(ctx, patch)
else:
patches = patch_dir.glob('*.patch' if not patched else '_post*.patch')
for patch in patches:
apply_patch(ctx, patch)


def vendor(ctx, vendor_dir, package=None, rewrite=True):
log('Reinstalling vendored libraries')
is_patched = vendor_dir.name == 'patched'
Expand All @@ -359,12 +379,8 @@ def vendor(ctx, vendor_dir, package=None, rewrite=True):

# Apply pre-patches
log("Applying pre-patches...")
patch_dir = Path(__file__).parent / 'patches' / vendor_dir.name
if is_patched:
for patch in patch_dir.glob('*.patch'):
if not patch.name.startswith('_post'):
apply_patch(ctx, patch)

apply_patches(ctx, patched=is_patched, pre=True)
log("Removing scandir library files...")
remove_all(vendor_dir.glob('*.so'))
drop_dir(vendor_dir / 'setuptools')
Expand All @@ -385,10 +401,7 @@ def vendor(ctx, vendor_dir, package=None, rewrite=True):
rewrite_file_imports(item, vendored_libs, vendor_dir)
write_backport_imports(ctx, vendor_dir)
if not package:
log('Applying post-patches...')
patches = patch_dir.glob('*.patch' if not is_patched else '_post*.patch')
for patch in patches:
apply_patch(ctx, patch)
apply_patches(ctx, patched=is_patched, pre=False)
if is_patched:
piptools_vendor = vendor_dir / 'piptools' / '_vendored'
if piptools_vendor.exists():
Expand Down
18 changes: 0 additions & 18 deletions tasks/vendoring/patches/vendor/dotenv-windows-unicode.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index 7820aa5..2082fc8 100644
from ordereddict import OrderedDict

-try:
- from pipenv.patched.notpip._internal import get_installed_distributions
- from pipenv.patched.notpip._internal.utils.misc import get_installed_distributions
- from pipenv.patched.notpip._internal.operations.freeze import FrozenRequirement
-except ImportError:
- from pipenv.patched.notpip import get_installed_distributions, FrozenRequirement
Expand All @@ -17,3 +17,4 @@ index 7820aa5..2082fc8 100644

import pkg_resources
# inline:

4 changes: 3 additions & 1 deletion tasks/vendoring/patches/vendor/tomlkit-fix.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ diff --git a/pipenv/vendor/tomlkit/container.py b/pipenv/vendor/tomlkit/containe
index cb8af1d5..9b5db5cb 100644
--- a/pipenv/vendor/tomlkit/container.py
+++ b/pipenv/vendor/tomlkit/container.py
@@ -1,13 +1,5 @@
@@ -1,15 +1,7 @@
from __future__ import unicode_literals

import copy

-from typing import Any
-from typing import Dict
Expand Down
8 changes: 4 additions & 4 deletions tasks/vendoring/patches/vendor/vistir-imports.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ diff --git a/pipenv/vendor/vistir/compat.py b/pipenv/vendor/vistir/compat.py
index 9ae33fdc..ec3b65cb 100644
--- a/pipenv/vendor/vistir/compat.py
+++ b/pipenv/vendor/vistir/compat.py
@@ -31,11 +31,11 @@ if sys.version_info >= (3, 5):
@@ -43,11 +43,11 @@ if sys.version_info >= (3, 5):
from functools import lru_cache
else:
from pathlib2 import Path
Expand All @@ -29,12 +29,12 @@ index 9ae33fdc..ec3b65cb 100644
NamedTemporaryFile = _NamedTemporaryFile
else:
from tempfile import NamedTemporaryFile
@@ -44,7 +44,7 @@ else:
@@ -56,7 +56,7 @@ else:
try:
from weakref import finalize
except ImportError:
- from backports.weakref import finalize
+ from pipenv.vendor.backports.weakref import finalize
- from backports.weakref import finalize # type: ignore
+ from pipenv.vendor.backports.weakref import finalize # type: ignore

try:
from functools import partialmethod

0 comments on commit ed3f206

Please sign in to comment.