News for hackers. Stuff that matters.
Re:Why should bottlepy stick to a file? by sandGorgon on Saturday January 11, 2020 @03:23AM (#22018869)
The singlefile-ness of Bottle is no longer unique. For example, the modern day Fastapi built on async ASGI (and ranks top in framework benchmarks) is also single file.

https://github.com/tiangolo/fastapi

or Fastapi for that matter - https://github.com/encode/starlette

However, it is a bit tricky to run Bottle with production grade servers like gunicorn/uwsgi.

Re:Why should bottlepy stick to a file? by oefrha on Saturday January 11, 2020 @03:38AM (#22018915)
What? FastAPI is certainly not single file: https://github.com/tiangolo/fastapi/tree/master/fastapi

The issue is talking about Bottle the framework itself being a single file, bottle.py.

Re:Why should bottlepy stick to a file? by sandGorgon on Saturday January 11, 2020 @03:44AM (#22018932)
oh my bad. That's interesting, but im not sure about utility.

Because everyone literally uses package management to install and maintain bottle.

Bottle has code like this - https://github.com/bottlepy/bottle/blob/master/bottle.py#L81... - which does check for external dependencies (which predicate a package manager)

Re:Why should bottlepy stick to a file? by jwkane on Saturday January 11, 2020 @12:08PM (#22020933)
not really.. it uses ujson if it is installed and falls back to the built in json. Hard to call something a dependency when you don't depend on it.
Re:Why should bottlepy stick to a file? by rejschaap on Saturday January 11, 2020 @01:09PM (#22021323)
Those are often called optional dependencies. Which is of course an oxymoron.
Re:Why should bottlepy stick to a file? by Kwpolska on Saturday January 11, 2020 @03:43AM (#22018931)
FastAPI and Starlette both have tons of files, and even subpackages. Bottle ships as only a single bottle.py file, with no external dependencies (only Python standard library). FastAPI depends on Starlette, and both have a set of optional external dependencies.

> However, it is a bit tricky to run Bottle with production grade servers like gunicorn/uwsgi.

Uh, no? Bottle has docs for deployment: https://bottlepy.org/docs/dev/deployment.html#switching-the-...

They have automated support for gunicorn. uWSGI requires adding one line (`app = bottle.default_app()`) and pointing uWSGI at that.

Re:Why should bottlepy stick to a file? by oefrha on Saturday January 11, 2020 @03:57AM (#22018968)
It’s indeed strange to call any WSGI-capable framework (all of them?) tricky to deploy with gunicorn/uwsgi. All you need to do is expose the WSGI object.