]> git.ipfire.org Git - thirdparty/babel.git/log
thirdparty/babel.git
2 years agoBecome 2.12.0 v2.12.0
Aarni Koskela [Tue, 28 Feb 2023 07:17:25 +0000 (09:17 +0200)] 
Become 2.12.0

2 years agoTox: also test with pytz installed (#974)
Aarni Koskela [Tue, 28 Feb 2023 07:40:35 +0000 (09:40 +0200)] 
Tox: also test with pytz installed (#974)

* Tox: also test with pytz installed
* Tox: return to tox-gh-actions (which now supports Tox 4)

2 years agoRenovate CI tools a bit (#972)
Aarni Koskela [Mon, 20 Feb 2023 15:27:36 +0000 (17:27 +0200)] 
Renovate CI tools a bit (#972)

* Update GitHub Actions versions

* Update pre-commit tools

2 years agoMerge pull request #970 from jeanas/autojunk
Aarni Koskela [Mon, 20 Feb 2023 13:49:35 +0000 (15:49 +0200)] 
Merge pull request #970 from jeanas/autojunk

Fix two issues with fuzzy matching

2 years agoTurn off difflib "autojunk" heuristic in fuzzy matching 970/head
Jean Abou Samra [Sun, 12 Feb 2023 01:49:28 +0000 (02:49 +0100)] 
Turn off difflib "autojunk" heuristic in fuzzy matching

difflib has a heuristic that used to make fuzzy matching unreliable for
>200char strings.  See

https://github.com/python/cpython/issues/90825

Fixes #969

2 years agoIn fuzzy matching, also .lower().strip() fuzzy candidates
Jean Abou Samra [Sun, 12 Feb 2023 01:46:30 +0000 (02:46 +0100)] 
In fuzzy matching, also .lower().strip() fuzzy candidates

This seems intended at easing fuzzy matching with trivial edits in the
msgstr (changing case and adding whitespace), but it was only done on
the new msgstr, not on the old mgstr candidates, so it was possible for
merging catalogs to miss messages.

2 years agoReplace babel.localedata.locale_identifiers cache with LRU cache
Aarni Koskela [Tue, 7 Feb 2023 14:00:41 +0000 (16:00 +0200)] 
Replace babel.localedata.locale_identifiers cache with LRU cache

2 years agoReplace babel.dates._pattern_cache with an LRU cache
Aarni Koskela [Tue, 7 Feb 2023 13:58:00 +0000 (15:58 +0200)] 
Replace babel.dates._pattern_cache with an LRU cache

Fixes #962

2 years agoMerge pull request #966 from DenverCoderOne/number-type-improvements
Aarni Koskela [Tue, 7 Feb 2023 13:52:18 +0000 (15:52 +0200)] 
Merge pull request #966 from DenverCoderOne/number-type-improvements

Numbers and core type fixes

2 years agoType fixes from 961 966/head
Jonah Lawrence [Fri, 3 Feb 2023 15:42:23 +0000 (08:42 -0700)] 
Type fixes from 961

2 years agoNumbers and core type fixes
Jonah Lawrence [Fri, 3 Feb 2023 15:35:09 +0000 (08:35 -0700)] 
Numbers and core type fixes

2 years agoAdd two new options in cmdline.rst docs (#963)
Maciej Olko [Fri, 3 Feb 2023 09:34:35 +0000 (10:34 +0100)] 
Add two new options in cmdline.rst docs (#963)

Added in #720 and #832.

2 years agoKeep @modifiers when parsing locales (#947)
martin f. krafft [Thu, 26 Jan 2023 17:46:06 +0000 (18:46 +0100)] 
Keep @modifiers when parsing locales (#947)

Locale modifiers ("@variants") are described in the GNU gettext
documentation like this:

> The ‘@variant’ can denote any kind of characteristics that is not
> already implied by the language ll and the country CC. […] It can also
> denote a dialect of the language, …

Wherein Babel previously would discard these, this patch stores the
modifier information in the `Locale` objects, handling string
representation accordingly.

Resolves: #946
Signed-off-by: martin f. krafft <madduck@madduck.net>
Co-authored-by: Aarni Koskela <akx@iki.fi>
2 years agoModernize some string formatting
Aarni Koskela [Wed, 25 Jan 2023 20:08:33 +0000 (22:08 +0200)] 
Modernize some string formatting

2 years agoApply some simplification fixes courtesy of Ruff
Aarni Koskela [Wed, 25 Jan 2023 19:51:37 +0000 (21:51 +0200)] 
Apply some simplification fixes courtesy of Ruff

2 years agoFinally remove get_next_timezone_transition (#958)
Aarni Koskela [Wed, 25 Jan 2023 19:46:40 +0000 (21:46 +0200)] 
Finally remove get_next_timezone_transition (#958)

2 years agoFix unbound `exc` in babel.dates (#959)
Aarni Koskela [Wed, 25 Jan 2023 19:44:22 +0000 (21:44 +0200)] 
Fix unbound `exc` in babel.dates (#959)

See https://stackoverflow.com/a/24271786/51685

2 years agoUse standard library UTC (#957)
Aarni Koskela [Wed, 25 Jan 2023 19:43:16 +0000 (21:43 +0200)] 
Use standard library UTC (#957)

2 years agoClean up babel.localtime (#952)
Aarni Koskela [Wed, 25 Jan 2023 18:37:51 +0000 (20:37 +0200)] 
Clean up babel.localtime (#952)

* Remove vestigial babel.localtime cache bits
* Give _FallbackLocalTimezone its own module

2 years agoSupport for formatting NaN, Infinity (#955)
Jonah Lawrence [Wed, 25 Jan 2023 18:17:24 +0000 (11:17 -0700)] 
Support for formatting NaN, Infinity (#955)

2 years agoRemove redundant tests for babel.support (#954)
Aarni Koskela [Fri, 20 Jan 2023 16:53:47 +0000 (18:53 +0200)] 
Remove redundant tests for babel.support (#954)

The doctests test the exact same things.

2 years agoUpdate test dependencies (tox v4) (#953)
Jonah Lawrence [Fri, 20 Jan 2023 16:41:39 +0000 (09:41 -0700)] 
Update test dependencies (tox v4) (#953)

2 years agoMerge pull request #951 from python-babel/cldr-42
Aarni Koskela [Fri, 20 Jan 2023 15:17:20 +0000 (17:17 +0200)] 
Merge pull request #951 from python-babel/cldr-42

Upgrade to CLDR 42

2 years agoAdjust tests for CLDR 42 951/head
Aarni Koskela [Fri, 20 Jan 2023 14:55:38 +0000 (16:55 +0200)] 
Adjust tests for CLDR 42

The space changes around English seem to be on purpose, see:

* https://unicode-org.atlassian.net/browse/CLDR-14032
* https://github.com/unicode-org/cldr/commit/a83026ab8c8fa6ed88f1047c4d0c6089f88b7e5d

2 years agoAdd test for #942
Aarni Koskela [Fri, 20 Jan 2023 14:24:59 +0000 (16:24 +0200)] 
Add test for #942

2 years agoImport CLDR 42
Aarni Koskela [Fri, 20 Jan 2023 14:24:51 +0000 (16:24 +0200)] 
Import CLDR 42

2 years agoMerge pull request #949 from python-babel/ruffify
Aarni Koskela [Thu, 19 Jan 2023 08:43:08 +0000 (10:43 +0200)] 
Merge pull request #949 from python-babel/ruffify

Add ruff for linting

2 years agoEnable E741 (ambiguous variable name) lint 949/head
Aarni Koskela [Wed, 18 Jan 2023 18:30:25 +0000 (20:30 +0200)] 
Enable E741 (ambiguous variable name) lint

2 years agoApply some small miscellaneous formatting fixes
Aarni Koskela [Wed, 18 Jan 2023 18:27:44 +0000 (20:27 +0200)] 
Apply some small miscellaneous formatting fixes

2 years agoApply ruff UP (Pyupgrade) fixes
Aarni Koskela [Wed, 18 Jan 2023 19:00:31 +0000 (21:00 +0200)] 
Apply ruff UP (Pyupgrade) fixes

2 years agoApply ruff UP025 (unicode literal prefix) fix
Aarni Koskela [Wed, 18 Jan 2023 18:59:35 +0000 (20:59 +0200)] 
Apply ruff UP025 (unicode literal prefix) fix

2 years agoApply ruff SIM300 (de-yoda) fixes
Aarni Koskela [Wed, 18 Jan 2023 18:08:59 +0000 (20:08 +0200)] 
Apply ruff SIM300 (de-yoda) fixes

2 years agoApply ruff I category fixes
Aarni Koskela [Wed, 18 Jan 2023 18:07:31 +0000 (20:07 +0200)] 
Apply ruff I category fixes

2 years agoApply ruff F category fixes
Aarni Koskela [Wed, 18 Jan 2023 18:07:05 +0000 (20:07 +0200)] 
Apply ruff F category fixes

2 years agoApply ruff E category fixes
Aarni Koskela [Wed, 18 Jan 2023 18:04:18 +0000 (20:04 +0200)] 
Apply ruff E category fixes

2 years agoApply ruff C category fixes
Aarni Koskela [Wed, 18 Jan 2023 18:01:47 +0000 (20:01 +0200)] 
Apply ruff C category fixes

2 years agoApply ruff B category fixes
Aarni Koskela [Wed, 18 Jan 2023 18:01:03 +0000 (20:01 +0200)] 
Apply ruff B category fixes

2 years agoAdd baseline ruff configuration
Aarni Koskela [Wed, 18 Jan 2023 17:52:05 +0000 (19:52 +0200)] 
Add baseline ruff configuration

2 years agoEnsure `path` is correctly bound for extract callback (flake8 B023)
Aarni Koskela [Wed, 11 Jan 2023 10:49:43 +0000 (12:49 +0200)] 
Ensure `path` is correctly bound for extract callback (flake8 B023)

2 years agoRenovate formatting in test_checkers and test_frontend (#950)
Aarni Koskela [Wed, 18 Jan 2023 19:07:37 +0000 (21:07 +0200)] 
Renovate formatting in test_checkers and test_frontend (#950)

2 years agoMinor cleanups (#948)
Aarni Koskela [Wed, 18 Jan 2023 17:47:43 +0000 (19:47 +0200)] 
Minor cleanups (#948)

* Add __all__s to be cleaner about re-exports
* Move timezone_getter to conftest
* Apply spelling corrections suggested by codespell

2 years agoUnify datetime imports (#945)
Aarni Koskela [Wed, 18 Jan 2023 09:01:11 +0000 (11:01 +0200)] 
Unify datetime imports (#945)

Co-authored-by: Jonah Lawrence <jonah@freshidea.com>
2 years agoImplement zoneinfo support and make pytz optional (#940)
DS/Charlie [Wed, 11 Jan 2023 10:34:43 +0000 (11:34 +0100)] 
Implement zoneinfo support and make pytz optional (#940)

2 years agoAdd type annotations (#934)
Jonah Lawrence [Wed, 11 Jan 2023 08:54:11 +0000 (01:54 -0700)] 
Add type annotations (#934)

Refs e.g. https://github.com/python/typeshed/pull/9455

Co-authored-by: Spencer Brown <spencerb21@live.com>
Co-authored-by: Aarni Koskela <akx@iki.fi>
2 years agoEnable pre-commit (#943)
Aarni Koskela [Wed, 11 Jan 2023 08:42:08 +0000 (10:42 +0200)] 
Enable pre-commit (#943)

* Update pre-commit config syntax

* CI: run pre-commit

* CI: set up pip caching

2 years agofix typo (#941)
lilinjie [Mon, 9 Jan 2023 17:54:42 +0000 (17:54 +0000)] 
fix typo (#941)

Signed-off-by: lilinjie <lilinjie@uniontech.com>
2 years agoFix compact singular formats and patterns with no numbers (#932)
Jonah Lawrence [Fri, 6 Jan 2023 20:21:58 +0000 (13:21 -0700)] 
Fix compact singular formats and patterns with no numbers (#932)

2 years agoImproved javascript template string expression extracting (#939)
Johannes Wilm [Fri, 6 Jan 2023 20:18:35 +0000 (21:18 +0100)] 
Improved javascript template string expression extracting (#939)

Co-authored-by: Rik <gitaarik@posteo.net>
Co-authored-by: Aarni Koskela <akx@iki.fi>
2 years agoci: Fix testing dependencies (#936)
Jonah Lawrence [Mon, 26 Dec 2022 22:22:08 +0000 (15:22 -0700)] 
ci: Fix testing dependencies (#936)

2 years agoReplace %/.format/concatenation with f-strings where feasible (#927)
Aarni Koskela [Wed, 23 Nov 2022 11:33:10 +0000 (13:33 +0200)] 
Replace %/.format/concatenation with f-strings where feasible (#927)

Original conversion suggestions via flynt, edited by hand.

2 years agoCast number to Decimal in _get_compact_format (#930)
Jonah Lawrence [Wed, 23 Nov 2022 11:25:49 +0000 (04:25 -0700)] 
Cast number to Decimal in _get_compact_format (#930)

* fix rounding modes by using Decimal instead of float

2 years agoDrop support for EOL Python 3.6 (#919)
Aarni Koskela [Wed, 23 Nov 2022 11:22:01 +0000 (13:22 +0200)] 
Drop support for EOL Python 3.6 (#919)

2 years agofeat: Support for short compact currency formats (#926)
Jonah Lawrence [Fri, 4 Nov 2022 15:16:24 +0000 (09:16 -0600)] 
feat: Support for short compact currency formats (#926)

Co-authored-by: Jun Omae (大前 潤) <42682+jun66j5@users.noreply.github.com>
2 years agoRemove vestigial Python 2 `long` check (#925)
Aarni Koskela [Wed, 2 Nov 2022 06:36:42 +0000 (08:36 +0200)] 
Remove vestigial Python 2 `long` check (#925)

2 years agofeat: Add `Format.compact_decimal` utility (#921)
Jonah Lawrence [Wed, 2 Nov 2022 06:35:41 +0000 (00:35 -0600)] 
feat: Add `Format.compact_decimal` utility (#921)

2 years agoUpdate docs build configuration (#924)
Aarni Koskela [Wed, 2 Nov 2022 06:25:47 +0000 (08:25 +0200)] 
Update docs build configuration (#924)

* Use Python 3.11
* Use Sphinx 5 (and update extlinks configuration)
* Use Python 3 intersphinx mapping
* Install Babel from the build directory

Refs https://github.com/python-babel/babel/issues/920

2 years agodocs(changes): Fix broken issue links
Jonah Lawrence [Wed, 2 Nov 2022 02:53:12 +0000 (02:53 +0000)] 
docs(changes): Fix broken issue links

2 years agoBecome 2.11.0 v2.11.0
Aarni Koskela [Tue, 1 Nov 2022 10:30:55 +0000 (12:30 +0200)] 
Become 2.11.0

2 years agoQuiesce pytest warnings (#916)
Aarni Koskela [Tue, 1 Nov 2022 10:16:04 +0000 (12:16 +0200)] 
Quiesce pytest warnings (#916)

* Skip doctest of deprecated format_number

* Don't return from test_compatible_classes_in_global_and_localedata

* Renovate conftest (and require pytest 6+)

2 years agoSetup: mark as compatible with Python 3.11
Aarni Koskela [Mon, 31 Oct 2022 09:56:57 +0000 (11:56 +0200)] 
Setup: mark as compatible with Python 3.11

2 years agoCI: test on Python 3.11
Aarni Koskela [Mon, 31 Oct 2022 09:56:30 +0000 (11:56 +0200)] 
CI: test on Python 3.11

2 years agoUse `ast` instead of `eval` for string extraction
Aarni Koskela [Mon, 31 Oct 2022 11:05:00 +0000 (13:05 +0200)] 
Use `ast` instead of `eval` for string extraction

This is safer (as we don't actually execute anything),
and allows us to parse f-strings too.

Closes #769 (supersedes it)
Refs #715 (doesn't add an error yet, but doesn't crash on f-strings)

2 years agoAdapt parse_date to handle ISO dates in ASCII format
Eric L [Sun, 20 Feb 2022 09:35:01 +0000 (10:35 +0100)] 
Adapt parse_date to handle ISO dates in ASCII format

2 years agoAdd support for compact decimal formats (#909)
Jonah Lawrence [Mon, 31 Oct 2022 15:29:23 +0000 (09:29 -0600)] 
Add support for compact decimal formats (#909)

2 years agoRemove determining time zone via systemsetup on macOS
Aarni Koskela [Mon, 31 Oct 2022 10:47:23 +0000 (12:47 +0200)] 
Remove determining time zone via systemsetup on macOS

According to https://truesecdev.wordpress.com/2015/04/09/hidden-backdoor-api-to-root-privileges-in-apple-os-x/comment-page-1/
the `systemsetup` command has required superuser privileges since
macOS 10.8.5 (which has been EOL for over 6 years at the time of writing).
We shouldn't expect to use a codepath that requires a helper tool
that requires su in any regular use; IOW, _if_ a Babel user had ever
reached this path without having been superuser, it would have failed anyway
on any currently supported version of macOS.

Closes #895 (supersedes it).

2 years agoSupport for hex escapes in JavaScript string literals
Przemyslaw Wegrzyn [Thu, 12 May 2022 22:15:48 +0000 (00:15 +0200)] 
Support for hex escapes in JavaScript string literals

2 years agoalign license with OSI template (#912)
Lukas Kahwe Smith [Mon, 31 Oct 2022 10:11:19 +0000 (11:11 +0100)] 
align license with OSI template (#912)

Remove errant "All rights reserved." from license and update to use modern contributor wording.

2 years agoRemove superfluous `__unicode__` declarations
Lukas Juhrich [Fri, 23 Sep 2022 14:49:49 +0000 (16:49 +0200)] 
Remove superfluous `__unicode__` declarations

The `__unicode__` protocol is not used in python3,
and furthermore the `unicode()` builtin does not exist anymore.

2 years agoRemove `__nonzero__` methods (#896)
Nikita Sobolev [Sun, 21 Aug 2022 19:34:02 +0000 (22:34 +0300)] 
Remove `__nonzero__` methods (#896)

2 years agoUpdate Python versions in dev docs
Raphael Nestler [Tue, 9 Aug 2022 13:13:40 +0000 (15:13 +0200)] 
Update Python versions in dev docs

Also remove mentions of Python 2 workarounds, since they aren't applicable anymore.

2 years agoMerge pull request #894 from python-babel/downloader-improvements
Aarni Koskela [Thu, 14 Jul 2022 08:55:37 +0000 (11:55 +0300)] 
Merge pull request #894 from python-babel/downloader-improvements

Small downloader improvements

2 years agoDownloader: use f-strings 894/head
Aarni Koskela [Wed, 13 Jul 2022 11:30:45 +0000 (14:30 +0300)] 
Downloader: use f-strings

2 years agoDownloader: download to temporary file, then replace
Aarni Koskela [Wed, 13 Jul 2022 11:28:25 +0000 (14:28 +0300)] 
Downloader: download to temporary file, then replace

2 years agoDownloader: use shutil.get_terminal_size()
Aarni Koskela [Wed, 13 Jul 2022 11:24:52 +0000 (14:24 +0300)] 
Downloader: use shutil.get_terminal_size()

2 years agoRemove some deprecated ImportError guards
Aarni Koskela [Wed, 13 Jul 2022 11:24:40 +0000 (14:24 +0300)] 
Remove some deprecated ImportError guards

2 years agoMerge branch '2.10-maint'
Aarni Koskela [Thu, 16 Jun 2022 07:12:56 +0000 (10:12 +0300)] 
Merge branch '2.10-maint'

2 years agoMerge pull request #889 from python-babel/become-2.10.3 2.10-maint
Aarni Koskela [Thu, 16 Jun 2022 06:27:57 +0000 (09:27 +0300)] 
Merge pull request #889 from python-babel/become-2.10.3

Become 2.10.3

2 years agoBecome 2.10.3 889/head v2.10.3
Aarni Koskela [Thu, 16 Jun 2022 05:53:51 +0000 (08:53 +0300)] 
Become 2.10.3

2 years agoCI: include maint branches in actions
Aarni Koskela [Thu, 16 Jun 2022 05:56:07 +0000 (08:56 +0300)] 
CI: include maint branches in actions

2 years agoDelete legacy release scripts
Aarni Koskela [Thu, 16 Jun 2022 05:33:00 +0000 (08:33 +0300)] 
Delete legacy release scripts

2 years agosetup.cfg: switch to metadata.license_files
Aarni Koskela [Thu, 16 Jun 2022 05:40:15 +0000 (08:40 +0300)] 
setup.cfg: switch to metadata.license_files

See https://github.com/pypa/setuptools/pull/2620

2 years agoAdd GitHub Actions workflow for building packages
Aarni Koskela [Thu, 16 Jun 2022 05:29:29 +0000 (08:29 +0300)] 
Add GitHub Actions workflow for building packages

2 years agoMerge pull request #888 from python-babel/build-in-ci
Aarni Koskela [Thu, 16 Jun 2022 05:47:39 +0000 (08:47 +0300)] 
Merge pull request #888 from python-babel/build-in-ci

Build packages in CI

2 years agosetup.cfg: switch to metadata.license_files 888/head
Aarni Koskela [Thu, 16 Jun 2022 05:40:15 +0000 (08:40 +0300)] 
setup.cfg: switch to metadata.license_files

See https://github.com/pypa/setuptools/pull/2620

2 years agoDelete legacy release scripts
Aarni Koskela [Thu, 16 Jun 2022 05:33:00 +0000 (08:33 +0300)] 
Delete legacy release scripts

2 years agoAdd GitHub Actions workflow for building packages
Aarni Koskela [Thu, 16 Jun 2022 05:29:29 +0000 (08:29 +0300)] 
Add GitHub Actions workflow for building packages

2 years agoBecome 2.10.2
Aarni Koskela [Tue, 14 Jun 2022 07:03:09 +0000 (10:03 +0300)] 
Become 2.10.2

2 years agoBecome 2.10.2 884/head v2.10.2
Aarni Koskela [Tue, 14 Jun 2022 07:03:09 +0000 (10:03 +0300)] 
Become 2.10.2

3 years agoUse email.Message for pofile header parsing
Aarni Koskela [Tue, 10 May 2022 12:36:47 +0000 (15:36 +0300)] 
Use email.Message for pofile header parsing

cgi.parse_header is due to be deprecated

Fixes #873

3 years agoMerge pull request #875 from akx/asserts
Aarni Koskela [Tue, 10 May 2022 12:59:53 +0000 (14:59 +0200)] 
Merge pull request #875 from akx/asserts

tests: Use bare asserts and pytest.raises

3 years agotests: Use pytest.raises() decorator where applicable 875/head
Aarni Koskela [Tue, 10 May 2022 10:36:00 +0000 (13:36 +0300)] 
tests: Use pytest.raises() decorator where applicable

3 years agotests: Use regular asserts instead of unittest functions
Aarni Koskela [Tue, 10 May 2022 08:52:35 +0000 (11:52 +0300)] 
tests: Use regular asserts instead of unittest functions

Automated conversion initially applied with
https://github.com/warlo/codemod-unittest-to-pytest-asserts,
followed by some manual changes for brevity.

3 years agoMerge pull request #869 from jun66j5/date-period-symbols
Aarni Koskela [Tue, 10 May 2022 11:55:39 +0000 (13:55 +0200)] 
Merge pull request #869 from jun66j5/date-period-symbols

Add support for `b` and `B` period symbols in time format

3 years agoFix up some Python2-isms using pyupgrade
Aarni Koskela [Tue, 10 May 2022 07:51:08 +0000 (10:51 +0300)] 
Fix up some Python2-isms using pyupgrade

3 years agoImprove doctest for `DateTimeFormat.format_period` 869/head
Jun Omae [Tue, 10 May 2022 10:22:55 +0000 (19:22 +0900)] 
Improve doctest for `DateTimeFormat.format_period`

3 years agoUse `... if expr else ...`
Jun Omae [Tue, 10 May 2022 08:01:45 +0000 (17:01 +0900)] 
Use `... if expr else ...`

3 years agoFix get_period_id() with `dayPeriodRule` across 0:00
Jun Omae [Sun, 1 May 2022 07:33:41 +0000 (16:33 +0900)] 
Fix get_period_id() with `dayPeriodRule` across 0:00

3 years agoFallback count="other" format in format_currency()
Jun Omae [Sat, 7 May 2022 15:50:21 +0000 (00:50 +0900)] 
Fallback count="other" format in format_currency()

3 years agoAdd support for `b` and `B` period symbols in time format
Jun Omae [Fri, 29 Apr 2022 01:54:44 +0000 (10:54 +0900)] 
Add support for `b` and `B` period symbols in time format

3 years agochore(docs/typo): Fixes a minor typo in a function comment
Frank Harrison [Mon, 25 Apr 2022 14:24:00 +0000 (15:24 +0100)] 
chore(docs/typo): Fixes a minor typo in a function comment