diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2020-06-26 09:18:43 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-30 23:03:02 +0100 |
commit | 407b8e2344dc036350959c5e7d27c121dbaa797e (patch) | |
tree | e337e54d8ddaf47fa1a748b81582335048e19908 | |
parent | 62931865d5dc02b7f3029b85c7d76401acf2d8d8 (diff) | |
download | poky-407b8e2344dc036350959c5e7d27c121dbaa797e.tar.gz |
Revert "python3-setuptools: patch entrypoints for faster initialization"
Apologies, but the patch is not possible to rebase onto the new setuptools,
as the code has changed too much. Please get it accepted upstream first.
(From OE-Core rev: f2feb53c967256431f03a07c1b4b9a0d8568d9b5)
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2 files changed, 1 insertions, 65 deletions
diff --git a/meta/recipes-devtools/python/python-setuptools.inc b/meta/recipes-devtools/python/python-setuptools.inc index 3222de7079..9322ca9a05 100644 --- a/meta/recipes-devtools/python/python-setuptools.inc +++ b/meta/recipes-devtools/python/python-setuptools.inc | |||
@@ -10,9 +10,7 @@ inherit pypi | |||
10 | 10 | ||
11 | SRC_URI_append_class-native = " file://0001-conditionally-do-not-fetch-code-by-easy_install.patch" | 11 | SRC_URI_append_class-native = " file://0001-conditionally-do-not-fetch-code-by-easy_install.patch" |
12 | 12 | ||
13 | SRC_URI += "file://0001-change-shebang-to-python3.patch \ | 13 | SRC_URI += "file://0001-change-shebang-to-python3.patch" |
14 | file://0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch \ | ||
15 | " | ||
16 | 14 | ||
17 | SRC_URI[md5sum] = "6e9de90b242fdd60ef59f497424ce13a" | 15 | SRC_URI[md5sum] = "6e9de90b242fdd60ef59f497424ce13a" |
18 | SRC_URI[sha256sum] = "145fa62b9d7bb544fce16e9b5a9bf4ab2032d2f758b7cd674af09a92736aff74" | 16 | SRC_URI[sha256sum] = "145fa62b9d7bb544fce16e9b5a9bf4ab2032d2f758b7cd674af09a92736aff74" |
diff --git a/meta/recipes-devtools/python/python3-setuptools/0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch b/meta/recipes-devtools/python/python3-setuptools/0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch deleted file mode 100644 index 7e931c845c..0000000000 --- a/meta/recipes-devtools/python/python3-setuptools/0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | From aae8cd3de3f289cea3db01212579913c925191e8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Lauri Tirkkonen <lauri.tirkkonen.ext@nokia.com> | ||
3 | Date: Thu, 26 Mar 2020 14:24:25 +0000 | ||
4 | Subject: [PATCH] ScriptWriter: create more efficient /usr/bin wrappers | ||
5 | |||
6 | Upstream setuptools writes scripts to /usr/bin that do insanely much | ||
7 | stuff at runtime. https://github.com/pypa/setuptools/issues/510 | ||
8 | |||
9 | Since the script entry points are already known at build time, we can | ||
10 | just write those directly into the /usr/bin wrapper, avoiding the | ||
11 | expensive 'pkg_resources' import at runtime. The idea is from | ||
12 | https://github.com/ninjaaron/fast-entry_points but patched directly into | ||
13 | the native build of setuptools here, so that all Python modules under | ||
14 | bitbake automatically use it without needing additional build time | ||
15 | dependencies. | ||
16 | |||
17 | Upstream-Status: Pending | ||
18 | |||
19 | Signed-off-by: Lauri Tirkkonen <lauri.tirkkonen.ext@nokia.com> | ||
20 | Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com> | ||
21 | --- | ||
22 | setuptools/command/easy_install.py | 14 ++++++-------- | ||
23 | 1 file changed, 6 insertions(+), 8 deletions(-) | ||
24 | |||
25 | diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py | ||
26 | index 8fba7b41..03a72714 100755 | ||
27 | --- a/setuptools/command/easy_install.py | ||
28 | +++ b/setuptools/command/easy_install.py | ||
29 | @@ -2023,17 +2023,12 @@ class ScriptWriter(object): | ||
30 | """ | ||
31 | |||
32 | template = textwrap.dedent(r""" | ||
33 | - # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r | ||
34 | - __requires__ = %(spec)r | ||
35 | - import re | ||
36 | import sys | ||
37 | - from pkg_resources import load_entry_point | ||
38 | + | ||
39 | + from %(module)s import %(ep0)s | ||
40 | |||
41 | if __name__ == '__main__': | ||
42 | - sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | ||
43 | - sys.exit( | ||
44 | - load_entry_point(%(spec)r, %(group)r, %(name)r)() | ||
45 | - ) | ||
46 | + sys.exit(%(entrypoint)s()) | ||
47 | """).lstrip() | ||
48 | |||
49 | command_spec_class = CommandSpec | ||
50 | @@ -2068,6 +2063,9 @@ class ScriptWriter(object): | ||
51 | for type_ in 'console', 'gui': | ||
52 | group = type_ + '_scripts' | ||
53 | for name, ep in dist.get_entry_map(group).items(): | ||
54 | + module = ep.module_name | ||
55 | + ep0 = ep.attrs[0] | ||
56 | + entrypoint = '.'.join(ep.attrs) | ||
57 | cls._ensure_safe_name(name) | ||
58 | script_text = cls.template % locals() | ||
59 | args = cls._get_script_args(type_, name, header, script_text) | ||
60 | -- | ||
61 | 2.24.1 | ||
62 | |||