github
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/simonw/datasette/issues/14#issuecomment-381450394 | https://api.github.com/repos/simonw/datasette/issues/14 | 381450394 | MDEyOklzc3VlQ29tbWVudDM4MTQ1MDM5NA== | 9599 | 2018-04-16T00:27:23Z | 2018-04-16T00:27:23Z | OWNER | I created https://github.com/simonw/datasette-plugin-demos which is now published to PyPI and can be installed with `pip install datasette-plugin-demos` - I've confirmed that if you DO install it my Datasette `plugins` branch picks up the plugins, and `select random_integer(1, 4)` works as it should. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 267707940 | |
https://github.com/simonw/datasette/issues/14#issuecomment-381450591 | https://api.github.com/repos/simonw/datasette/issues/14 | 381450591 | MDEyOklzc3VlQ29tbWVudDM4MTQ1MDU5MQ== | 9599 | 2018-04-16T00:30:22Z | 2018-04-16T00:34:42Z | OWNER | Slight code design problem... when I tried installing my branch in a fresh virtual environment I got this error, because `setup.py` now depends on `pluggy` (from importing `__version__`): ``` File "/private/var/folders/jj/fngnv0810tn2lt_kd3911pdc0000gp/T/pip-req-build-dftqdezt/setup.py", line 2, in <module> from datasette import __version__ File "/private/var/folders/jj/fngnv0810tn2lt_kd3911pdc0000gp/T/pip-req-build-dftqdezt/datasette/__init__.py", line 2, in <module> from .hookspecs import hookimpl # noqa File "/private/var/folders/jj/fngnv0810tn2lt_kd3911pdc0000gp/T/pip-req-build-dftqdezt/datasette/hookspecs.py", line 1, in <module> from pluggy import HookimplMarker ModuleNotFoundError: No module named 'pluggy' ``` Looks like I've run into point 6 on https://packaging.python.org/guides/single-sourcing-package-version/ : ![2018-04-15 at 5 34 pm](https://user-images.githubusercontent.com/9599/38785314-403ce86a-40d3-11e8-8542-ba426eddf4ac.png) | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 267707940 | |
https://github.com/simonw/datasette/issues/14#issuecomment-381611738 | https://api.github.com/repos/simonw/datasette/issues/14 | 381611738 | MDEyOklzc3VlQ29tbWVudDM4MTYxMTczOA== | 9599 | 2018-04-16T14:07:30Z | 2018-04-16T14:07:30Z | OWNER | I should check if it's possible to have two template registration function plugins in a single plugin module. If it isn't maybe I should use class plugins instead of module plugins. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 267707940 | |
https://github.com/simonw/datasette/issues/14#issuecomment-381621338 | https://api.github.com/repos/simonw/datasette/issues/14 | 381621338 | MDEyOklzc3VlQ29tbWVudDM4MTYyMTMzOA== | 9599 | 2018-04-16T14:36:27Z | 2018-04-16T14:36:27Z | OWNER | Annoyingly, the following only results in the last of the two `prepare_connection` hooks being registered: ``` from datasette import hookimpl import pint import random ureg = pint.UnitRegistry() @hookimpl def prepare_connection(conn): def convert_units(amount, from_, to_): "select convert_units(100, 'm', 'ft');" return (amount * ureg(from_)).to(to_).to_tuple()[0] conn.create_function('convert_units', 3, convert_units) @hookimpl def prepare_connection(conn): conn.create_function('random_integer', 2, random.randint) ``` | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 267707940 | |
https://github.com/simonw/datasette/issues/14#issuecomment-381622793 | https://api.github.com/repos/simonw/datasette/issues/14 | 381622793 | MDEyOklzc3VlQ29tbWVudDM4MTYyMjc5Mw== | 9599 | 2018-04-16T14:40:39Z | 2018-04-17T01:47:15Z | OWNER | I think that's OK. The two plugins I've implemented so far (`prepare_connection` and `prepare_jinja2_environment`) both make sense if they can only be defined once-per-plugin. For the moment I'll assume I can define future hooks to work well with the same limitation. The syntactic sugar idea in #220 can help here too. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 267707940 |