17 ms·
Flask 0.11 Released
- scrollaway 10y agoThis is a big deal. For those unfamiliar with Flask, it's a great library but has been sitting on 0.10 for three years now. Blog post about it: https://www.palletsprojects.com/blog/flask-011-released/ https://www.palletsprojects.com/blog/flask-011-released/
- rxdazn 10y agoIs Pallets the new name for Pocoo?
- mgraupner 10y agoPallets is the new umbrella project for all Flask/Werkzeug related projects.
- gedrap 10y agoWhy is it a big deal? It's been sitting for three years because it was just working and given it's minimal nature, there were not many things that should be changed. So not much point to make a release.
- rattray 10y agoFor one thing, it means contributors' work sat there for up to three years – not something that would make me want to contribute. For another, any bugfixes/improvements that had been requested by the community were inaccessible on a release branch, even after they were committed – this sounds extremely frustrating. Most libraries out there are "just working" – doesn't mean they can't ship improvements, and most do – typically no more irregularly than every 6mo.
- gkya 10y agoSometimes sth. is done and no immediate improvements are needed. Furthermore, the repo is out there.
- wpietri 10y ago>Sometimes sth. is done and no immediate improvements are needed. That's a very weird thing to say in response to somebody saying, "improvements were needed and made but not released". > Furthermore, the repo is out there. Now that's just ridiculous. If somebody wants to not have releases, that's fine. E.g., rbenv plugins just seem to be "pull latest from git". But if somebody is going to have releases, then it's absurd to say: "Hey, if you want this to actually work, don't use the release that all the docs tell you to use; instead build the thing we have explicitly not given to you." Having releases: good. Not ever having releases: good. Having them but not using them: worst of both worlds.
- brbsix 10y agoIt's actually pretty easy to install directly from the repo: pip install git+https://github.com/pallets/flask.git However as you mentioned, the documentation really needs to be updated to reflect this. It's frustrating to come across this sort of thing. I've even gone so far as forking packages and releasing latest on PyPi myself (so I can easily pull in the dependency from other packages).
- gkya 10y agoA release is a logical point in a software projects history. Sometimes you have a bunch of stuff on the head waiting a release, but that point is not reached yet. The maturity of the features are not well tested, the API is not fixed, etc. Now IDK this specific case of Flask, but there is no one single release cadence that fits all, nor do the releases need be periodic.
- wpietri 10y agoYes, I think the problem here is that you're opining without understanding the specific case, a case that the rest of us are talking about. The general discussion of release philosophy could be interesting. If you would like to talk about that, you should start a new topic, or at the very least make it clear you're changing the topic. When you reply to somebody's specific statements with sweeping generalities, as you did here, it looks like contradiction.
- gkya 10y agoOut there is a certain "increasing version number fetishism".
- scrollaway 10y agoClearly the only reason people care about this is because of the bigger version number. All the new features/fixes, contributions finally being released, the increase in development activity, it's all bullshit, people only care about the digits. Sigh. You're projecting.
- StevePerkins 10y agoI know that version numbers don't necessarily mean anything. Wine took 15 years to get to 1.0, while Chrome and Firefox increment major version numbers every few weeks. But it still seems odd to have a major web framework at 0.11 after six years.
- JustSomeNobody 10y agoIf it is working like it is supposed to, I don't see what the problem is.
- michaelmior 10y agoNo real problem. But I think many can have an subconscious bias that any software at 0.x is unstable. This is how semver[0] treats 0.x releases and it was a common convention long before that. [0] http://semver.org/ http://semver.org/
- reidrac 10y agoEach project may have a different versioning scheme and that's just fine. Not everyone follows "semver" (although it sounds sensible to me).
- michaelmior 10y agoSure. Nothing wrong with whatever (sensible) versioning scheme a project decides to use. But I think version numbers do bias the perceived stability. If I had never heard of Flask and I saw that version 0.11 was released after three years of no new releases, my gut reaction would probably not be overly positive. That said, Flask is indeed a great piece of software :)
- the_mitsuhiko 10y agoThis was supposed to be 1.0 but with such a long time leading up to it i figured it's safer to wait a release to ensure nothing major regressed.
- bsaul 10y agoDidn't expect a new flask release because i had the feeling the author moved to rust development. did anything change recently ?
- mgraupner 10y agoAs far as I understood there was a delay in the release process because of documentation missing/outdated and project organization changes, not because the project itself was not moving along.
- nzjrs 10y agoI think you were mistaken.
- AtlasLion 10y agoI remember him saying that on a podcast. maybe talk python to me.
- sswaner 10y agoNo: https://github.com/mitsuhiko https://github.com/mitsuhiko
- softinio 10y agoI listened to a Podcast interview with the author. He is spending a lot less time on Python projects than he used to as he does like Rust so spends time on Rust also. https://talkpython.fm/episodes/show/13/flask-web-framework-and-much-much-more https://talkpython.fm/episodes/show/13/flask-web-framework-a...
- leejoramo 10y agoHe is still very active in Python. His recent lektor static CMS is wonderful and written in Python. http://www.getlektor.com http://www.getlektor.com
- agumonkey 10y agoTests ported to py.test. I never got a full understanding on which python unit test lib I should use ..maybe that's a hint. ps: well thanks for the hints below guys.
- afarrell 10y agopy.test is fantastic, so yes.
- scrollaway 10y agoI would highly recommend pytest. It's very simple, very pythonic. Here is for example my Hearthstone simulator, with ~600 pytest-compatible tests: https://github.com/jleclanche/fireplace/tree/master/tests https://github.com/jleclanche/fireplace/tree/master/tests It's just plain asserts. You run it with `py.test`. Nothing simpler.
- orf 10y agoNice sample of tests! I also love pytest, but one of the best things IMO is fixtures, which your tests don't seem to use? For those who don't know fixtures are a type of dependency injection. You just make a function (e.g game) in a file called conftest.py, and wrap it with a '@pytest.fixture'. Then any tests you write that have an argument named 'game' will have the result of the 'game' function passed as a value. So 'game' could return 'prepare_game()', and other fixtures can do the same with their arguments to build more complex fixtures. I find it saves a load of initialization code being repeated.
- nilliams 10y agoFixtures are considered an anti-pattern by many as they over-DRY [0] your tests and obscure them by introducing 'Mystery Guests' [1]. [0] http://stackoverflow.com/a/11837973 http://stackoverflow.com/a/11837973 [1] https://robots.thoughtbot.com/lets-not#will-our-mystery-guest-please-leave https://robots.thoughtbot.com/lets-not#will-our-mystery-gues...
- scrollaway 10y ago
- Brainix 10y agoWho's got two thumbs and has already deployed Flask 0.11 to production? This guy.
- zxcvcxz 10y agoAre there any high traffic web pages using Flask? I'm interested but when I look at job listings it's really rare I see anything for flask compared to React/Angular/RoR. If I was a python dev it seems like it might be worth learning but since I'm a web dev and already know a few frameworks I'm struggling to find a reason to teach my self flask. Does Flask have any advantage over something like Angular?
- rcarmo 10y agoYou're comparing apples to oranges here. Flask is a server-side framework and doesn't care one whit about what you put on top - it just serves up requests.
- ntietz 10y agoFlask would be more comparable to RoR than to Angular, since it is principally for backend work. (You can do server-side-rendered front-end stuff with it, with templates, but I choose not to -- currently working with Flask for my backend API, React for frontend). There are two main features of Flask for me, over something like RoR: it's Python (my preference over Ruby); and it's a very light framework with a ton of modules, compared to my perception that RoR is pretty big and heavy and opinionated. YMV, I only do this stuff in my evenings so I'm not terribly familiar with it all.
- brbsix 10y agoNot sure what kind of traffic they get, but httpbin.org uses it. Also this one site named Pinterest.
- rcarmo 10y agoThis is nice to see. I don't use anything but http://bottlepy.org http://bottlepy.org these days because I find the decorator approach to be more elegant, but I do have a few Flask-based tools I adopted, and (for instance) patching them to serialize datetimes was a pain.
- jaxondu 10y agoSwitch to use Bottle for rest API as Flask has dependencies such as Jinja2 that I don't need.
- noinsight 10y agoThere's also the Falcon framework that claims to be faster and is meant for REST APIs. http://falconframework.org/ http://falconframework.org/
- bizzleDawg 10y agoFalcon is great for making API's! I've used it on a few production sites. The main downside is the lack of middlewares for common tasks (e.g. jwt decoding) but you gain in other areas such as being able to use class inheritance to abstract out utility stuff in an elegant way.
- bigethan 10y agoTake a look at Hug - it's built on Falcon and adds all the API niceties :-) https://github.com/timothycrosley/hug https://github.com/timothycrosley/hug
- andrewstuart 10y agoYou don't need middleware to use JWT with Falcon - just import and use a jwt library.
- rcarmo 10y agoOh, I already do that. Thought my statement was plain enough.
- ThePhysicist 10y agoThey should really name it Flask 1.0 at this point, as it's a very mature library and lots of people (including me) use it in production settings. In my humble opinion, the 0.11 version number tends to shy people away from the library as it conveys the impression that it's still heavily evolving or not well-tested, which is not the case. In any case: Congrats :)
- frewsxcv 10y agoThe version number is 0.11, which is different from 0.1.
- ThePhysicist 10y agogood point, changed it :)
- gedrap 10y agoBut does it really matter now that Flask is so popular? Probably not :)
- w4 10y agoWhen I decided to learn web dev (coming from a native background), the lack of updates to Flask was more of a concern than the 0.11 version number. Everything I read online said that Flask was rock solid, so getting stuck with an abandoned framework in production was my main concern. Glad to see Flask's development is back on track, and under formal management!
- Marazan 10y agoFlask development has never not been on track, there have been plenty of commits and bug fixes in the last 3 years, theyve just never made a official release until now.
- w4 10y agoI'm aware, but a web framework going 3 years without a release renders the distinction between "no releases" and "no development" more or less meaningless from an end user's point of view.
- codegeek 10y agoLove Flask. I don't do it anymore for other reasons but flask is what got me started with web frameworks that are minimal but powerful. What I love about flask is that it does not do too much magic like django even though this is not meant to demean django of course. It makes me think and make some choices. Since the core is minimal, you still have to learn a few things to really understand how to put together a decent web app or an API but I really feel that is the strength of flask. My belief is that when you are learning, start with a minimal framework so that not everything is already done for you a.k.a magic. That will make you think and make some choices. Sure it may be amateur choices in the beginning but you will become a better developer. So if you want to learn python for web, go with Flask.
- chucksmash 10y ago"What I love about flask is that it does not do too much magic like django" So having used both, I'd nitpick you on this assertion. from flask import request to get at the individual request objects is sooooo much more magical than def my_view(request): (IMO) Nevertheless, it's a good framework!
- Svenstaro 10y agoI agree on that. The magical globals are also my biggest problem with flask. Other than that, it's a very solid framework that obviously has had lots of thought go into it.
- m_mueller 10y agoI think this is just a design choice to avoid confusion between request / session parameters in the view functions versus path parameters. It's quite nice that you can just do @route("/<post_id>") def my_view(post_id): .... never having to register anything and just decorating your functions with these path decorators gets you started really really fast. That's how a flask hello world is just 6 LOC and `python ./my_server.py`.
- gedrap 10y agoOne tip if you are about to write your first large (well, larger than 500 lines of code) Flask application: check some example applications for ideas of separation/architecture and some popular modules. The minimalist nature of Flask, not forcing you to do things in one way and one way only, gives lots of power, but also lots of chances to mess it up and end up with a totally unmaintainable crap. Great power comes with great responsibility. Personally, I quite liked https://github.com/mattupstate/overholt https://github.com/mattupstate/overholt (although some dependencies are out dated!). Also, having some starting point with the boilerplate code already in place helps you to prototype faster, etc. Speaking of modules, the Flask modules ecosystem is pretty great and familiarizing yourself with it might save plenty of time you'd spend on re-implementing them. Some popular modules that are worth mentioning: 1) Flask-assets https://flask-assets.readthedocs.io/en/latest/ https://flask-assets.readthedocs.io/en/latest/ allows to easily integrate processing of the assets (JS minification, SASS compilation, etc) into your development pipeline; 2) Flask-login https://github.com/maxcountryman/flask-login https://github.com/maxcountryman/flask-login simple users management (roles, authentication, etc.); 3) Flask-SQLAlchemy http://flask-sqlalchemy.pocoo.org/2.1/ http://flask-sqlalchemy.pocoo.org/2.1/ simple integration with SQLAlchemy 4) Flask-Script https://flask-script.readthedocs.io/en/latest/ https://flask-script.readthedocs.io/en/latest/ makes it easy to write command line tools which run in the context of Flask application (e.g. some cron jobs).
- jdnier 10y agoFrom the release notes, it appears flask.cli may be intended to replace Flask-Script (4): "Added flask and the flask.cli module to start the local debug server through the click CLI system. This is recommended over the old flask.run() method as it works faster and more reliable due to a different design and also replaces Flask-Script."
- gedrap 10y agoYeah, forgot to mention it when writing :)
- anantzoid 10y agoI also like https://github.com/svenstaro/flamejam/ https://github.com/svenstaro/flamejam/ as a good example of Flask architecture. It's simple and maintainable. I wrote a 4k+ loc app using a similar pattern and it still remains quite easy to handle.
- johnwheeler 10y agoI just released my first Flask extension called Flask-Ask for developing Amazon Echo skills https://github.com/johnwheeler/flask-ask https://github.com/johnwheeler/flask-ask Flask is a fantastic, minimal framework, and Mitsuhiko did so much to help new developers integrate into the ecosystem he created. For example, I was able to use his documentation templates https://johnwheeler.org/flask-ask/ https://johnwheeler.org/flask-ask/, and he had multiple versions for small and large projects. When you dive in it's pretty amazing what they've accomplished over the last 5 years.
- aregsarkissian 10y agoAre there any plans to integrate the flask-failsafe functionality into flask proper so that flask reloads automatically after a syntax error is corrected and the file saved?
- nathancahill 10y agoI believe the Flask development server does that already?
- ju-st 10y agoNo, the dev server can only handle runtime exceptions
- idm 10y agoI wanted to mention Flask-Diamond in this thread because it can be used to scaffold large applications quickly, sortof like Django. http://flask-diamond.org http://flask-diamond.org One reason you might use Flask-Diamond instead of Django is because you might not need everything Django provides, so you want to remove libraries one at a time. Or, perhaps, you want to upgrade libraries one at a time. I've found it's easier to start with a full-blown Flask app, then remove things, rather than starting with a barebones app that I add to.
- calypso 10y agoI used Flask a few years ago to write a rather large api server (20k lines) for a video sharing app. I learned that they give you a lot of control but it can get messy quickly if you're not careful about properly architecting first. I ended up getting the Flask Cookbook from O'reilly which helped me understand how to structure a Flask App. I also recommend Flask-SQLAlchemy as it made writing and manipulating MySQL queries really straightforward.
- ZLeviathan 10y agomoving too slow...
- level09 10y agoSomeone might find this project helpful: https://github.com/level09/enferno https://github.com/level09/enferno This is a Flask based framework designed with best practices in mind, it comes with many nice preconfigured modules and modern features: * Gulp integration (sass, minify etc ..) * Fully configured flask security out of the box (register/login/reset etc ..) * Cache, Blueprints, Mysql/Nosql, Mail, Background tasks, ORM etc .. * Debug toolbar * Command line (Flask script) to help you control your app * A deployment script that fully configures your server in minutes (Ubuntu): https://github.com/level09/enferno-ansible https://github.com/level09/enferno-ansible edit: I'll get this project upgraded to 0.11 to integrate the nice new features, any recommendations/notes are welcome.
- kayman 10y agoI love flask. web.py used to be my "go-to". But as its development has not been as active, I moved over to Flask for the community. When I know I need an admin and lots of built in items out of the box, I choose Django. But a quick prototype, always start with Flask.