Skip to content

Commit

Permalink
Update python-dephell to version 0.8.3 / rev 17 via SR 844696
Browse files Browse the repository at this point in the history
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
jayvdb authored and bmwiedemann committed Oct 29, 2020
1 parent 4996245 commit bd9e43f
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 4 deletions.
Binary file modified packages/p/python-dephell/.files
Binary file not shown.
12 changes: 12 additions & 0 deletions packages/p/python-dephell/.rev
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,16 @@
<comment></comment>
<requestid>831466</requestid>
</revision>
<revision rev="17" vrev="5">
<srcmd5>60c902ad35039d669fcb2e235ec6c6e2</srcmd5>
<version>0.8.3</version>
<time>1603961351</time>
<user>dimstar_suse</user>
<comment>- 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
</comment>
<requestid>844696</requestid>
</revision>
</revisionlist>
53 changes: 53 additions & 0 deletions packages/p/python-dephell/dephell-pr473-pip-20-2.patch
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],
29 changes: 29 additions & 0 deletions packages/p/python-dephell/dephell-pr474-bowler-09.patch
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
8 changes: 8 additions & 0 deletions packages/p/python-dephell/python-dephell.changes
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]>

Expand Down
10 changes: 6 additions & 4 deletions packages/p/python-dephell/python-dephell.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ Source: https://files.pythonhosted.org/packages/source/d/dephell/dephell
Source1: macros.py-dephell
# PATCH-FIX-OPENSUSE we don't pin package versions
Patch0: never-pin-deps.patch
# PATCH-FIX-UPSTREAM support the pytest 6 entrypoints. Part of https://github.com/dephell/dephell/pull/458
# PATCH-FIX-UPSTREAM dephell-pytest6.patch -- support the pytest 6 entrypoints. Part of gh#dephell/dephell#458
Patch1: https://github.com/dephell/dephell/commit/b34011c04e49562b5afe3e946f01024ad5629ac1.patch#/dephell-pytest6.patch
# PATCH-FIX-UPSTREAM dephell-pr473-pip-20-2.patch gh#dephell#dephell#473 -- support pip 20.2 changed internal API (rebased because of patch1)
Patch2: dephell-pr473-pip-20-2.patch
# PATCH-FIX-UPSTREAM dephell-pr474-bowler-09.patch gh#dephell#dephell#474 -- support updated bowler 0.9
Patch3: https://patch-diff.githubusercontent.com/raw/dephell/dephell/pull/474.patch#/dephell-pr474-bowler-09.patch
BuildRequires: %{python_module base >= 3.5}
BuildRequires: %{python_module setuptools}
BuildRequires: bash
Expand Down Expand Up @@ -143,9 +147,7 @@ Manage packages: convert between formats, lock, install, resolve, isolate,
test, build graph, show outdated, audit. Manage venvs, build package, bump version.

%prep
%setup -q -n dephell-%{version}
%patch0 -p1
%patch1 -p1
%autosetup -p1 -n dephell-%{version}

sed -i -e '1i #!/bin/sh' dephell/templates/docker_prepare.sh

Expand Down

0 comments on commit bd9e43f

Please sign in to comment.