Closed nbraud closed 3 years ago
@nbraud this looks really good so far! feel free to poke me on Signal if you want me to look at something. :heart:
@duckinator I fixed most of the linting issues; the rest are things I didn't touch, except for one (no-else-return
) where I weakly disagree with the linter and I'd leave it up to you whether to fix the linter's config.
Regarding the test failure in CI, I suspect there's something very wonky going on:
ImportError: cannot import name 'cache' from 'functools'
PS: Nevermind, it seems functools.cache
was introduced in Py3.9 >_>'
... except for one (
no-else-return
) where I weakly disagree with the linter and I'd leave it up to you whether to fix the linter's config.
Totally agree with you there. It's a dumb rule.
Found some little warts, will fix them ASAP.
Done :)
@duckinator I ended up taking care of testing, in no small part thanks to Quart's testing howto... and it found me a bug in my last commit (where I tried to simplify the search template)
bors r+
aaaaa thank you so much! :purple_heart:
You are very welcome :purple_heart:
Motivation
Presumably, this could even be run with
hypercorn
or equivalent exposed directly to the Internet.async
operationThis is generally more efficient, and will make switching to an
async
search engine much easier.Drive-by changes
All those were more-or-less necessary for me to be able to hack on:
__pycache__
directoriesbin
: Make all scripts use/bin/sh
and exit on errorbin/start.sh
: Do not assume Python 3.7bin/wait-for-elasticsearch.sh
: Makecurl
actually silent unless$VERBOSE
is setbin/index.sh
: Honor$VERBOSE
Additionally, I made a few cleanups in
lib.model.Part
:get
a more Pythonic interface (not throwing on non-existent part)id
method: it's just a dict access and unused outside that class@staticmethod
decorators where relevantall
andto_dict
methodsMissing things
async
That could be nice, I just didn't bother since I'm trying to yeet ES away.
Currently, a 404 is returned for
/
or/parts
(withoutindex.html
); this is very-much a blocking bug, IMO, and I'll fix that ASAP (I asked the Quart dev how to do it, since the documentation is rather unhelpful on that topic)