-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update python-dephell to version 0.8.3 / rev 17 via SR 844696
https://build.opensuse.org/request/show/844696 by user jayvdb + dimstar_suse - Support newer pip version * dephell-pr473-pip-20-2.patch gh#dephell/dephell#473 - Support newer bowler version using a different patch lib * dephell-pr474-bowler-09.patch gh#dephell/dephell#474
- Loading branch information
1 parent
4996245
commit bd9e43f
Showing
6 changed files
with
108 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
From a3872e15312d8382017fbd6888744f4025cae5ac Mon Sep 17 00:00:00 2001 | ||
From: Ben Greiner <[email protected]> | ||
Date: Tue, 27 Oct 2020 22:18:42 +0100 | ||
Subject: [PATCH] support changed pip parser api | ||
|
||
--- | ||
dephell/converters/pip.py | 18 +++++++++++++++++- | ||
1 file changed, 17 insertions(+), 1 deletion(-) | ||
|
||
Index: dephell-0.8.3/dephell/converters/pip.py | ||
=================================================================== | ||
--- dephell-0.8.3.orig/dephell/converters/pip.py | ||
+++ dephell-0.8.3/dephell/converters/pip.py | ||
@@ -9,6 +9,7 @@ import attr | ||
from dephell_discover import Root as PackageRoot | ||
from dephell_links import DirLink, FileLink | ||
from pip._internal.req import parse_requirements | ||
+from pip._internal.req.req_install import InstallRequirement | ||
|
||
# app | ||
from ..context_tools import chdir | ||
@@ -33,6 +34,14 @@ except ImportError: | ||
except ImportError: | ||
from pip._internal.network.session import PipSession | ||
|
||
+try: | ||
+ # pip >= 20.2 | ||
+ from pip._internal.req.req_file import ParsedRequirement | ||
+ from pip._internal.req.constructors import \ | ||
+ install_req_from_parsed_requirement | ||
+except ImportError: | ||
+ ParsedRequirement = None | ||
+ | ||
|
||
@attr.s() | ||
class PIPConverter(BaseConverter): | ||
@@ -93,8 +102,15 @@ class PIPConverter(BaseConverter): | ||
) | ||
|
||
deps = [] | ||
- for req in reqs: | ||
+ for ireq in reqs: | ||
# https://github.com/pypa/pip/blob/master/src/pip/_internal/req/req_install.py | ||
+ if isinstance(ireq, InstallRequirement): | ||
+ req = ireq | ||
+ elif isinstance(ireq, ParsedRequirement): | ||
+ req = install_req_from_parsed_requirement(ireq) | ||
+ else: | ||
+ raise Exception("Another internal API change, why do you " | ||
+ "keep using internal APIs?") | ||
if req.req is None: | ||
req.req = SimpleNamespace( | ||
name=req.link.url.split('/')[-1], |
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,29 @@ | ||
From 46b11204afc2b26e33164705519af47980023b95 Mon Sep 17 00:00:00 2001 | ||
From: Ben Greiner <[email protected]> | ||
Date: Tue, 27 Oct 2020 22:23:50 +0100 | ||
Subject: [PATCH] add trailing newline for patch test | ||
|
||
--- | ||
tests/test_commands/test_vendor_import.py | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/tests/test_commands/test_vendor_import.py b/tests/test_commands/test_vendor_import.py | ||
index 995a9b93..3f6a00ac 100644 | ||
--- a/tests/test_commands/test_vendor_import.py | ||
+++ b/tests/test_commands/test_vendor_import.py | ||
@@ -16,7 +16,7 @@ | ||
@pytest.mark.skipif(IS_WINDOWS, reason='unsupported on windows') | ||
def test_patch_imports(temp_path: Path): | ||
(temp_path / 'project').mkdir() | ||
- (temp_path / 'project' / '__init__.py').write_text('import requests\nimport django') | ||
+ (temp_path / 'project' / '__init__.py').write_text('import requests\nimport django\n') | ||
(temp_path / 'project' / 'vendor' / 'requests').mkdir(parents=True) | ||
(temp_path / 'project' / 'vendor' / 'requests' / '__init__.py').touch() | ||
|
||
@@ -34,5 +34,5 @@ def test_patch_imports(temp_path: Path): | ||
output_path=temp_path / 'project' / 'vendor', | ||
) | ||
|
||
- expected = 'import project.vendor.requests as requests\nimport django' | ||
+ expected = 'import project.vendor.requests as requests\nimport django\n' | ||
assert (temp_path / 'project' / '__init__.py').read_text() == expected |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
------------------------------------------------------------------- | ||
Tue Oct 27 21:13:39 UTC 2020 - Benjamin Greiner <[email protected]> | ||
|
||
- Support newer pip version | ||
* dephell-pr473-pip-20-2.patch gh#dephell/dephell#473 | ||
- Support newer bowler version using a different patch lib | ||
* dephell-pr474-bowler-09.patch gh#dephell/dephell#474 | ||
|
||
------------------------------------------------------------------- | ||
Wed Sep 2 13:04:24 UTC 2020 - Benjamin Greiner <[email protected]> | ||
|
||
|
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