python-babel / flask-babel

i18n and l10n support for Flask based on Babel and pytz
https://python-babel.github.io/flask-babel/
Other
432 stars 159 forks source link

Remove incorrect upper bound from `pytz` dependency #225

Closed mgorny closed 1 year ago

mgorny commented 1 year ago

Change the pytz dependency to use the >= operator rather than ^, in order to allow installing newer versions. pytz uses calendar versioning rather than semantic versioning, so the ^ operator is meaningless there. Furthermore, since pytz version corresponds to the timezone data release, allowing the newest version is important to permit using up-to-date tzinfo.

mgorny commented 1 year ago

Hmm, I don't seem to be able to reproduce these test failures.

mgorny commented 1 year ago

Hmm, rebasing seems to have helped (or rerunning).

TkTech commented 1 year ago

There was another PR included in v3.1.0 that fixed the tests. The latest version of babel changed format strings to use a non-breaking-space before PM/AM. So the test failures are confusing because there's no visible difference :)

ThiefMaster commented 1 year ago

A fixed release containing this PR would be great.

ThiefMaster commented 1 year ago

Also, please consider not pinning any upper versions - flask-babel is a library and it should be up to the application to pin its transitive dependencies. As an application developer I do not want to wait for a library release in order to update e.g. flask, even if everything might still be compatible!

cc @davidism since you know some nice blog post links on this topic ;)

davidism commented 1 year ago

When writing a library, you should only use lower bounds for install dependencies. This allows people writing applications to use a tool like pip-tools to pin their full dependency tree. If libraries use restrictive bounds unnecessarily, it makes it impossible to pin to newer versions without a new release, whereas lower bounds can always be pinned more specifically in the application to work around issues.

You can review any of the following for more information about not relying on any particular semantics in version numbers, and avoiding creating version conflicts:

TkTech commented 1 year ago

A PR with these changes would be accepted.

My city currently has no power and my area will likely not get power for several more days. I can accept a PR and make a release, but any code changes will have to wait until I can recharge a laptop.

kamyar commented 1 year ago

@TkTech Any chance you can take a look if https://github.com/python-babel/flask-babel/pull/227 looks complete / good?

davidism commented 1 year ago

This was already a PR, am I missing something?

jwag956 commented 1 year ago

@davidism I think the confusing part is that 'master' isn't up to date with the 3.1.0 branch - so folks trying to 'test with latest' are in fact getting an older version....

mgorny commented 1 year ago

Thank you!