[Buildroot] [PATCH v1 2/2] package/python-flask: fix runtime python modules dependencies
Peter Korsgaard
peter at korsgaard.com
Wed Apr 8 21:04:29 UTC 2020
>>>>> "Peter" == Peter Seiderer <ps.report at gmx.net> writes:
> Hello Peter,
> On Tue, 07 Apr 2020 18:55:19 +0200, Peter Korsgaard <peter at korsgaard.com> wrote:
>> >>>>> "Peter" == Peter Seiderer <ps.report at gmx.net> writes:
>>
>> > - add python setuptools runtime dependency, fixes:
>> > ModuleNotFoundError: No module named 'pkg_resources'
>>
>> Hmm, the only instance of pkg_resources I see is in src/flask/cli.py:
>>
>> def _load_plugin_commands(self):
>> if self._loaded_plugin_commands:
>> return
>> try:
>> import pkg_resources
>> except ImportError:
>> self._loaded_plugin_commands = True
>> return
>>
>> for ep in pkg_resources.iter_entry_points("flask.commands"):
>> self.add_command(ep.load(), ep.name)
>> self._loaded_plugin_commands = True
>>
>> Which seems to nicely deal with missing pkg_resources.
> Did re-run my flask test (reverted this patch) and try to run a simple hello
> world example (from [1]):
> $ cat hello.py
> from flask import Flask
> app = Flask(__name__)
> @app.route('/')
> def hello_world():
> return 'Hello, World!'
> $ env FLASK_APP=hello.py flask run --host=0.0.0.0
> Traceback (most recent call last):
> File "/usr/bin/flask", line 6, in <module>
> from pkg_resources import load_entry_point
> ModuleNotFoundError: No module named 'pkg_resources'
Ahh, indeed. The click stuff generates the flask script, so that is why
it isn't in the source tree and I didn't see it with grep.
The other feedback should be correct though.
--
Bye, Peter Korsgaard
More information about the buildroot
mailing list