TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

We Have to Talk About Flask

43 点作者 carc1n0gen超过 1 年前

19 条评论

usrbinbash超过 1 年前
<a href="https:&#x2F;&#x2F;semver.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;semver.org&#x2F;</a><p><pre><code> Given a version number MAJOR.MINOR.PATCH, increment the: 1. MAJOR version when you make incompatible API changes </code></pre> So what exactly is the issue here?
评论 #37945581 未加载
评论 #37945440 未加载
评论 #37956131 未加载
评论 #37953636 未加载
评论 #37946325 未加载
评论 #37945555 未加载
dekhn超过 1 年前
I have long advocated the idea that online tutorials should have unit tests: there should be a daily build that loads the tutorial, extracts the code bits, runs them, and reports a failure if a dependency broke the tutorial.<p>And those tutorials should have the ability to force rollbacks of minor point releases that break backwards compatibility.<p>Tutorials should be pinned to major point releases.
评论 #37945431 未加载
评论 #37945524 未加载
评论 #37945564 未加载
评论 #37946418 未加载
mmnfrdmcx超过 1 年前
The flask-login package should have limited its dependencies to flask&lt;3.0, that&#x27;s what major versions are for.
评论 #37945541 未加载
sergioisidoro超过 1 年前
The problem stems from how fragmented dependency management in python is. Most tutorials use `pip install something` without much care for pinning versions.<p>Yes, it makes it easier for new programmers: They can skip learning a dependency management tool like poetry, or pipenv. But then these things happen.<p>Blame the tutorial makers and the dependency maintainers, not the Flask team.
评论 #37945678 未加载
评论 #37946229 未加载
评论 #37946280 未加载
评论 #37945677 未加载
pil0u超过 1 年前
Despite the &quot;it&#x27;s your fault&quot; vibe towards Miguel, I have to say: thank you Miguel!!<p>Your tutorial was a turning point for me 4 years ago, the care you take to write and help people is very precious. My ability to write modest web apps takes its roots in your free online materials, I am grateful for that.
JoeAltmaier超过 1 年前
Any older product will fall into disrepair, simply due to the decreased attention old features get. Plus the years of accumulated of references to any particular feature, that would take years to track and put right whenever it changes.<p>Not sure there&#x27;s any cure.<p>I hit this (OP) issue myself. Solved it somehow, don&#x27;t remember, just another glitch in the neverending series of glitches that are open-source lack-of-support and obsolete documentation.<p>Just today, noticed Steam tutorial videos generally use some obsolete version of their website tools. Have to fish around, find where the menus etc are, they sure aren&#x27;t where the video says they are.<p>Business as usual.
评论 #37945531 未加载
pphysch超过 1 年前
It seems unreasonable to expect <i>anything</i> that relies on &quot;version:latest&quot; to not break upon a major version change.<p>What makes a tutorial different than any other software process, in this context?<p>Your tutorial was written and functions for a particular version of a software. Pin that version. It&#x27;s the straightforward thing to do.<p>Frankly, I would be insulted if I was miseducated by a tutorial that purports to be up to date, but was actually written for a old major version. Learning obsolete techniques, missing best-practices.
评论 #37945629 未加载
nickjj超过 1 年前
I&#x27;ve been maintaining my Build a SAAS App with Flask video course[0] for 8 years. It has gone from Flask pre-1.0 to 2.3 and has been recorded twice with tons of incremental updates added over the years to keep things current.<p>In my opinion tutorial creators should pin their versions so that anyone taking the course or going through the tutorial will have a working set up that matches the video or written material.<p>I&#x27;m all for keeping things up to date and do update things every few months but expecting anyone can install any version doesn&#x27;t tend to work well for tutorials because sometimes bumping a minor version requires a code change or covering new concepts. As a tutorial consumer it&#x27;s frustrating when the content doesn&#x27;t match the source code unless it&#x27;s something simple like a version bump.<p>As a tutorial creator it&#x27;s your responsibility to ensure things work which ultimately leads to doing everything in your power to remove time as a variable. You can commit a frozen dependency file which locks everything. I sleep pretty well at night knowing things will work tomorrow. Before I did that I had all sorts of things break over the years due to some dependency of a dependency introducing a backwards incompatible change. Now it&#x27;s predictable and I can control when it&#x27;s safe to update a set of packages.<p>I&#x27;ve held off upgrading Flask to 3.0 and Python 3.12 due to these open issues with popular 3rd party packages <a href="https:&#x2F;&#x2F;github.com&#x2F;nickjj&#x2F;docker-flask-example&#x2F;issues&#x2F;17">https:&#x2F;&#x2F;github.com&#x2F;nickjj&#x2F;docker-flask-example&#x2F;issues&#x2F;17</a>. I&#x27;m sure new releases will get pushed in due time. When they are good to go then I&#x27;ll add a new video update and all is well for everyone. Maintainers can work at their own pace, I can verify everything works in production and then roll it into the course and folks taking the course get an up to date version that&#x27;s been proven to work.<p>[0]: <a href="https:&#x2F;&#x2F;buildasaasappwithflask.com&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;buildasaasappwithflask.com&#x2F;</a>
paulddraper超过 1 年前
This article uses such odd phrasing.<p>&gt; Flask 3.0 was released on September 30th, 2023, along with a parallel 3.0 release of Werkzeug<p>&gt; That day, the Flask-Login extension, one of the most popular of all Flask extensions, stopped working<p>Every major release BY DEFINITION will break things.<p>And breaking &quot;that day&quot;? It&#x27;s really &quot;that second&quot; or &quot;that nanosecond&quot; by the same standard.<p>---<p>You can complain about one of two things:<p>1. Flask did not need to developed a backwards incompatible 3.0 release, but could have developed a backwards compatible 2.* release.<p>2. Flask-login is too slow to release a version compatible with the newest version of Flask released 3 weeks ago.<p>But this blog post presents it in...such a weird way.
amanzi超过 1 年前
This is a wider issue with Flask and the surrounding ecosystem, and is also why I switched to Django a couple of years ago. I don&#x27;t recall which package it was specifically, but there was a commonly used security package that was recommended by lots of blogs and tutorials, but the maintainer no longer wanted to maintain it but also didn&#x27;t want to let anyone else contribute. So it led to another developer forking it and adding a &#x27;2&#x27; to the end of the name just to keep it current. This wouldn&#x27;t have been such a big issue if the package didn&#x27;t add really important security features to Flask, but due to the minimal nature of Flask it really depends on having a well-managed ecosystem of packages. My takeaway was that I felt I couldn&#x27;t rely on Flask for an application that required features that weren&#x27;t in the main Flask package itself.<p>But just wanted to also say, that the main reason I enjoyed working with Flask at the time, was due to Miguel&#x27;s excellent mega-tutorial. Again, that speaks to the value of having a good ecosystem to support your solution. Flask have ultimately shot themselves in the foot by releasing something they must have known would break a huge number of sites, without bringing the community along with them on the journey.
hiatus超过 1 年前
Shouldn&#x27;t the tutorial author be specifying a version in the tutorial?
评论 #37944593 未加载
nicoz3超过 1 年前
By reading many of the comments here, it looks like that you are missing the point (maybe you are not a Flask user): it would be great if Flask would only introduce breaking changes in major releases. Unfortunately, many things break with minor releases too. We develop a framework built with Flask, and it is very painful. We always pin Flask&lt; minor version (not major). This is unfortunately happening with other software too. The community should really align and stick to SemVer.
评论 #37948013 未加载
regularfry超过 1 年前
It seems to me that the problem here is that everyone directly depends on pypi. The Debian model would be to introduce another repository layer, explicitly to say &quot;everything you install from this repository will work together&quot;. Hoping to achieve the same effect with version numbers is a fool&#x27;s errand, especially when nobody agrees what version numbers <i>mean</i>.
Saphyel超过 1 年前
So this is yet another post about how terrible is the python ecosystem with the versions.<p>The author of the post seems unfamiliar with the meaning of a major release.<p>maxcountryman (author of flask-login) doesn&#x27;t know how to pin down versions.<p>I&#x27;m not a big fan of Flask to be honest but this doesn&#x27;t seem a problem from them. I&#x27;d rather blame maxcountryman , the author of the post or pip for this case
评论 #37946239 未加载
jollyllama超过 1 年前
Can anyone challenge the author&#x27;s assertion that the 3.0 release doesn&#x27;t bring any improvements?
评论 #37945583 未加载
rs_rs_rs_rs_rs超过 1 年前
&quot;Don&#x27;t make breaking changes because they break my book&quot; is peak entitlement.
JodieBenitez超过 1 年前
Hence why I prefer Django over Flask any day. Less moving parts, more stability. I even upgraded Django apps from one major version to another with little to no change to the apps.
bigdog42超过 1 年前
Looks like the changes are already in FlaskLogin<p><a href="https:&#x2F;&#x2F;github.com&#x2F;wangsha&#x2F;flask-login&#x2F;commit&#x2F;6d1b352dd5106ebdee5d784017c2513591c68db6#diff-cebbed5b3a6ea1d4cdbac299e8472381a0c9e41ce2b9831f6497d7dfc6998bd9L14">https:&#x2F;&#x2F;github.com&#x2F;wangsha&#x2F;flask-login&#x2F;commit&#x2F;6d1b352dd5106e...</a><p>but not yet released.<p>This is more an issue with versioning
Forgotthepass8超过 1 年前
This occurs all the time when using LLMs for code due to the variety of versions of each lib in their training data (which is typically years old already)<p>Some sort of automatic functionality to find deltas in libraries (even just crude function inspection between versions) and detect&#x2F;remap them (or roll back versions) might solve that and issues like this.