-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only install packages for current python version
- Still resolve all packages to lockfile - Fixes #1952 Signed-off-by: Dan Ryan <[email protected]>
- Loading branch information
1 parent
828269f
commit 903ad38
Showing
4 changed files
with
79 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tasks/vendoring/patches/patched/_post-pip-update-repository-finder.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/pipenv/patched/notpip/index.py b/pipenv/patched/notpip/index.py | ||
index bf1cba9..42968a5 100644 | ||
--- a/pipenv/patched/notpip/index.py | ||
+++ b/pipenv/patched/notpip/index.py | ||
@@ -711,7 +711,9 @@ class PackageFinder(object): | ||
link.filename, link.requires_python) | ||
support_this_python = True | ||
|
||
- if not support_this_python and not ignore_compatibility: | ||
+ # Normally we would keep this the same, but instead we always | ||
+ # want to include only things that support this python version | ||
+ if not support_this_python: # and not ignore_compatibility: | ||
logger.debug("The package %s is incompatible with the python" | ||
"version in use. Acceptable python versions are:%s", | ||
link, link.requires_python) |
42 changes: 42 additions & 0 deletions
42
tasks/vendoring/patches/patched/piptools-update-json-search.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
diff --git a/pipenv/patched/piptools/repositories/pypi.py b/pipenv/patched/piptools/repositories/pypi.py | ||
index e503197..ce78e8a 100644 | ||
--- a/pipenv/patched/piptools/repositories/pypi.py | ||
+++ b/pipenv/patched/piptools/repositories/pypi.py | ||
@@ -168,18 +168,28 @@ class PyPIRepository(BaseRepository): | ||
def gen(ireq): | ||
if self.DEFAULT_INDEX_URL in self.finder.index_urls: | ||
|
||
- url = 'https://pypi.org/pypi/{0}/json'.format(ireq.req.name) | ||
+ url = 'https://pypi.org/pypi/{0}/{1}/json'.format( | ||
+ ireq.req.name, | ||
+ str(ireq.req.specifier), | ||
+ ) | ||
r = self.session.get(url) | ||
+ if not r: | ||
+ r = self.session.get( | ||
+ 'https://pypi.org/pypi/{0}/json'.format( | ||
+ ireq.req.name, | ||
+ ) | ||
+ ) | ||
+ json = r.json() | ||
|
||
# TODO: Latest isn't always latest. | ||
- latest = list(r.json()['releases'].keys())[-1] | ||
- if str(ireq.req.specifier) == '=={0}'.format(latest): | ||
- | ||
- for requires in r.json().get('info', {}).get('requires_dist', {}): | ||
- i = InstallRequirement.from_line(requires) | ||
- | ||
- if 'extra' not in repr(i.markers): | ||
- yield i | ||
+ version = json['version'] | ||
+ if str(ireq.req.specifier) == '=={0}'.format(version): | ||
+ dependencies = json.get('info', {}).get('requires_dist', {}) | ||
+ for dep in dependencies: | ||
+ req = InstallRequirement.from_line(dep) | ||
+ | ||
+ if 'extra' not in repr(req.markers): | ||
+ yield req | ||
|
||
try: | ||
if ireq not in self._json_dep_cache: |