diff --git a/python/sites/build.txt b/python/sites/build.txt index 18ed54c6a645..b13faa47db1b 100644 --- a/python/sites/build.txt +++ b/python/sites/build.txt @@ -28,9 +28,10 @@ vendored:third_party/python/frozenlist vendored:third_party/python/giturlparse vendored:third_party/python/glean_parser vendored:third_party/python/gyp/pylib -vendored:third_party/python/jinja2_time vendored:third_party/python/json_e vendored:third_party/python/Mako +vendored:third_party/python/markdown_it_py +vendored:third_party/python/mdurl vendored:third_party/python/mohawk vendored:third_party/python/mozilla_repo_urls vendored:third_party/python/multidict @@ -38,11 +39,13 @@ vendored:third_party/python/pathspec vendored:third_party/python/ply vendored:third_party/python/pyasn1 vendored:third_party/python/pyasn1_modules +vendored:third_party/python/pygments vendored:third_party/python/pylru vendored:third_party/python/python_dateutil vendored:third_party/python/python_slugify vendored:third_party/python/redo vendored:third_party/python/requests_unixsocket +vendored:third_party/python/rich vendored:third_party/python/rsa vendored:third_party/python/slugid vendored:third_party/python/taskcluster @@ -50,6 +53,7 @@ vendored:third_party/python/taskcluster_taskgraph vendored:third_party/python/taskcluster_urls vendored:third_party/python/text_unidecode vendored:third_party/python/toml +vendored:third_party/python/types_python_dateutil vendored:third_party/python/voluptuous vendored:third_party/python/yamllint vendored:third_party/python/yarl diff --git a/python/sites/common.txt b/python/sites/common.txt index aef64e570d77..d4336462b76f 100644 --- a/python/sites/common.txt +++ b/python/sites/common.txt @@ -31,8 +31,9 @@ vendored:third_party/python/frozenlist vendored:third_party/python/giturlparse vendored:third_party/python/glean_parser vendored:third_party/python/gyp/pylib -vendored:third_party/python/jinja2_time vendored:third_party/python/json_e +vendored:third_party/python/markdown_it_py +vendored:third_party/python/mdurl vendored:third_party/python/mohawk vendored:third_party/python/mozilla_repo_urls vendored:third_party/python/multidict @@ -40,12 +41,14 @@ vendored:third_party/python/pathspec vendored:third_party/python/ply vendored:third_party/python/pyasn1 vendored:third_party/python/pyasn1_modules +vendored:third_party/python/pygments vendored:third_party/python/pylru vendored:third_party/python/python_dateutil vendored:third_party/python/python_slugify vendored:third_party/python/redo vendored:third_party/python/requests_unixsocket vendored:third_party/python/responses +vendored:third_party/python/rich vendored:third_party/python/rsa vendored:third_party/python/slugid vendored:third_party/python/taskcluster @@ -53,6 +56,7 @@ vendored:third_party/python/taskcluster_taskgraph vendored:third_party/python/taskcluster_urls vendored:third_party/python/text_unidecode vendored:third_party/python/toml +vendored:third_party/python/types_python_dateutil vendored:third_party/python/voluptuous vendored:third_party/python/yamllint vendored:third_party/python/yarl diff --git a/python/sites/docs.txt b/python/sites/docs.txt index e5d0b95c3fb9..ec15a1bb94b9 100644 --- a/python/sites/docs.txt +++ b/python/sites/docs.txt @@ -37,16 +37,20 @@ vendored:third_party/python/fluent.syntax vendored:third_party/python/frozenlist vendored:third_party/python/giturlparse vendored:third_party/python/gyp/pylib -vendored:third_party/python/jinja2_time vendored:third_party/python/json_e +vendored:third_party/python/markdown_it_py +vendored:third_party/python/mdurl vendored:third_party/python/mohawk vendored:third_party/python/mozilla_repo_urls +vendored:third_party/python/pygments vendored:third_party/python/pylru vendored:third_party/python/redo vendored:third_party/python/requests_unixsocket vendored:third_party/python/responses +vendored:third_party/python/rich vendored:third_party/python/slugid vendored:third_party/python/taskcluster vendored:third_party/python/taskcluster_taskgraph vendored:third_party/python/taskcluster_urls +vendored:third_party/python/types_python_dateutil vendored:third_party/python/voluptuous diff --git a/python/sites/lint.txt b/python/sites/lint.txt index 50eda55eba33..788c74ce25f0 100644 --- a/python/sites/lint.txt +++ b/python/sites/lint.txt @@ -13,22 +13,26 @@ vendored:third_party/python/esprima vendored:third_party/python/fluent.syntax vendored:third_party/python/frozenlist vendored:third_party/python/giturlparse -vendored:third_party/python/jinja2_time vendored:third_party/python/json_e +vendored:third_party/python/markdown_it_py +vendored:third_party/python/mdurl vendored:third_party/python/mohawk vendored:third_party/python/mozilla_repo_urls vendored:third_party/python/multidict vendored:third_party/python/pathspec +vendored:third_party/python/pygments vendored:third_party/python/python_dateutil vendored:third_party/python/python_slugify vendored:third_party/python/redo vendored:third_party/python/requests_unixsocket +vendored:third_party/python/rich vendored:third_party/python/slugid vendored:third_party/python/taskcluster vendored:third_party/python/taskcluster_taskgraph vendored:third_party/python/taskcluster_urls vendored:third_party/python/text_unidecode vendored:third_party/python/toml +vendored:third_party/python/types_python_dateutil vendored:third_party/python/voluptuous vendored:third_party/python/yamllint vendored:third_party/python/yarl diff --git a/python/sites/python-test.txt b/python/sites/python-test.txt index 58ad4f5efbce..e67f63643f41 100644 --- a/python/sites/python-test.txt +++ b/python/sites/python-test.txt @@ -39,8 +39,9 @@ vendored:third_party/python/frozenlist vendored:third_party/python/giturlparse vendored:third_party/python/glean_parser vendored:third_party/python/gyp/pylib -vendored:third_party/python/jinja2_time vendored:third_party/python/json_e +vendored:third_party/python/markdown_it_py +vendored:third_party/python/mdurl vendored:third_party/python/mohawk vendored:third_party/python/mozilla_repo_urls vendored:third_party/python/multidict @@ -48,12 +49,14 @@ vendored:third_party/python/pathspec vendored:third_party/python/ply vendored:third_party/python/pyasn1 vendored:third_party/python/pyasn1_modules +vendored:third_party/python/pygments vendored:third_party/python/pylru vendored:third_party/python/python_dateutil vendored:third_party/python/python_slugify vendored:third_party/python/redo vendored:third_party/python/requests_unixsocket vendored:third_party/python/responses +vendored:third_party/python/rich vendored:third_party/python/rsa vendored:third_party/python/slugid vendored:third_party/python/taskcluster @@ -61,6 +64,7 @@ vendored:third_party/python/taskcluster_taskgraph vendored:third_party/python/taskcluster_urls vendored:third_party/python/text_unidecode vendored:third_party/python/toml +vendored:third_party/python/types_python_dateutil vendored:third_party/python/voluptuous vendored:third_party/python/yamllint vendored:third_party/python/yarl diff --git a/python/sites/try.txt b/python/sites/try.txt index 9607d5687cbc..d2538c7bee93 100644 --- a/python/sites/try.txt +++ b/python/sites/try.txt @@ -31,9 +31,10 @@ vendored:third_party/python/frozenlist vendored:third_party/python/giturlparse vendored:third_party/python/glean_parser vendored:third_party/python/gyp/pylib -vendored:third_party/python/jinja2_time vendored:third_party/python/json_e vendored:third_party/python/jsonschema +vendored:third_party/python/markdown_it_py +vendored:third_party/python/mdurl vendored:third_party/python/mohawk vendored:third_party/python/mozilla_repo_urls vendored:third_party/python/multidict @@ -42,6 +43,7 @@ vendored:third_party/python/pkgutil_resolve_name vendored:third_party/python/ply vendored:third_party/python/pyasn1 vendored:third_party/python/pyasn1_modules +vendored:third_party/python/pygments vendored:third_party/python/pylru vendored:third_party/python/pyrsistent vendored:third_party/python/python_dateutil @@ -49,6 +51,7 @@ vendored:third_party/python/python_slugify vendored:third_party/python/redo vendored:third_party/python/requests_unixsocket vendored:third_party/python/responses +vendored:third_party/python/rich vendored:third_party/python/rsa vendored:third_party/python/slugid vendored:third_party/python/taskcluster @@ -56,6 +59,7 @@ vendored:third_party/python/taskcluster_taskgraph vendored:third_party/python/taskcluster_urls vendored:third_party/python/text_unidecode vendored:third_party/python/toml +vendored:third_party/python/types_python_dateutil vendored:third_party/python/voluptuous vendored:third_party/python/yamllint vendored:third_party/python/yarl diff --git a/third_party/python/arrow/arrow-1.2.3.dist-info/RECORD b/third_party/python/arrow/arrow-1.2.3.dist-info/RECORD deleted file mode 100644 index 62e73a16f59e..000000000000 --- a/third_party/python/arrow/arrow-1.2.3.dist-info/RECORD +++ /dev/null @@ -1,16 +0,0 @@ -arrow/__init__.py,sha256=HxsSJGl56GoeHB__No-kdGmC_Wes_Ttf0ohOy7OoFig,872 -arrow/_version.py,sha256=C-D_WWrVkBDmQmApLcm0sWNh2CgIrwWfc8_sB5vvU-Q,22 -arrow/api.py,sha256=6tdqrG0NjrKO22_eWHU4a5xerfR6IrZPY-yynGpnvTM,2755 -arrow/arrow.py,sha256=CnSXk3GCi1DroUvElSxlwQy9Y-2lCUSV5GKLLrBFmRA,63570 -arrow/constants.py,sha256=y3scgWgxiFuQg4DeFlhmexy1BA7K8LFNZyqK-VWPQJs,3238 -arrow/factory.py,sha256=dWP3XIYfYjqp7DCOdEYAD7PQfsbpQE70Ph9OS1A1LnE,11435 -arrow/formatter.py,sha256=YpYY8jeGZH0sgjc23PBm8HKf-EMHLp-8Ua52XfrVgPQ,5271 -arrow/locales.py,sha256=QSi6FJTVdmxDxAUIDMhUp3sJ13tHhF2tB50fA_mve0I,156276 -arrow/parser.py,sha256=ingY4axAO40kEYUL8MwqTIhFegCAVouDZk3c4YOs9aI,25720 -arrow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -arrow/util.py,sha256=xnDevqRyNeYWbl3x-n_Tyo4cOgHcdgbxFECFsJ1XoEc,3679 -arrow-1.2.3.dist-info/LICENSE,sha256=QNbhJV1xUfXwQaUUcl08lP-owYgeWgwptr6pPwPi47s,11341 -arrow-1.2.3.dist-info/METADATA,sha256=gg8GFdfHjX15F_yMrLsluJwKUXTaQi5ECUvwBlZYe9o,6938 -arrow-1.2.3.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92 -arrow-1.2.3.dist-info/top_level.txt,sha256=aCBThK2RIB824ctI3l9i6z94l8UYpFF-BC4m3dDzFFo,6 -arrow-1.2.3.dist-info/RECORD,, diff --git a/third_party/python/arrow/arrow-1.2.3.dist-info/top_level.txt b/third_party/python/arrow/arrow-1.2.3.dist-info/top_level.txt deleted file mode 100644 index e2dc7471c204..000000000000 --- a/third_party/python/arrow/arrow-1.2.3.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -arrow diff --git a/third_party/python/arrow/arrow-1.2.3.dist-info/LICENSE b/third_party/python/arrow/arrow-1.3.0.dist-info/LICENSE similarity index 99% rename from third_party/python/arrow/arrow-1.2.3.dist-info/LICENSE rename to third_party/python/arrow/arrow-1.3.0.dist-info/LICENSE index 4f9eea5d1493..ff864f3ba15d 100644 --- a/third_party/python/arrow/arrow-1.2.3.dist-info/LICENSE +++ b/third_party/python/arrow/arrow-1.3.0.dist-info/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2021 Chris Smith + Copyright 2023 Chris Smith Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/third_party/python/arrow/arrow-1.2.3.dist-info/METADATA b/third_party/python/arrow/arrow-1.3.0.dist-info/METADATA similarity index 84% rename from third_party/python/arrow/arrow-1.2.3.dist-info/METADATA rename to third_party/python/arrow/arrow-1.3.0.dist-info/METADATA index b3f89db32091..94b7642bdea0 100644 --- a/third_party/python/arrow/arrow-1.2.3.dist-info/METADATA +++ b/third_party/python/arrow/arrow-1.3.0.dist-info/METADATA @@ -1,31 +1,43 @@ Metadata-Version: 2.1 Name: arrow -Version: 1.2.3 +Version: 1.3.0 Summary: Better dates & times for Python -Home-page: https://arrow.readthedocs.io -Author: Chris Smith -Author-email: crsmithdev@gmail.com -License: Apache 2.0 -Project-URL: Repository, https://github.com/arrow-py/arrow -Project-URL: Bug Reports, https://github.com/arrow-py/arrow/issues -Project-URL: Documentation, https://arrow.readthedocs.io -Keywords: arrow date time datetime timestamp timezone humanize +Keywords: arrow,date,time,datetime,timestamp,timezone,humanize +Author-email: Chris Smith +Requires-Python: >=3.8 +Description-Content-Type: text/x-rst Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Information Technology Classifier: License :: OSI Approved :: Apache Software License Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 -Requires-Python: >=3.6 -Description-Content-Type: text/x-rst -License-File: LICENSE -Requires-Dist: python-dateutil (>=2.7.0) -Requires-Dist: typing-extensions ; python_version < "3.8" +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Operating System :: OS Independent +Requires-Dist: python-dateutil>=2.7.0 +Requires-Dist: types-python-dateutil>=2.8.10 +Requires-Dist: doc8 ; extra == "doc" +Requires-Dist: sphinx>=7.0.0 ; extra == "doc" +Requires-Dist: sphinx-autobuild ; extra == "doc" +Requires-Dist: sphinx-autodoc-typehints ; extra == "doc" +Requires-Dist: sphinx_rtd_theme>=1.3.0 ; extra == "doc" +Requires-Dist: dateparser==1.* ; extra == "test" +Requires-Dist: pre-commit ; extra == "test" +Requires-Dist: pytest ; extra == "test" +Requires-Dist: pytest-cov ; extra == "test" +Requires-Dist: pytest-mock ; extra == "test" +Requires-Dist: pytz==2021.1 ; extra == "test" +Requires-Dist: simplejson==3.* ; extra == "test" +Project-URL: Documentation, https://arrow.readthedocs.io +Project-URL: Issues, https://github.com/arrow-py/arrow/issues +Project-URL: Source, https://github.com/arrow-py/arrow +Provides-Extra: doc +Provides-Extra: test Arrow: Better dates & times for Python ====================================== @@ -161,3 +173,4 @@ Support Arrow ------------- `Open Collective `_ is an online funding platform that provides tools to raise money and share your finances with full transparency. It is the platform of choice for individuals and companies to make one-time or recurring donations directly to the project. If you are interested in making a financial contribution, please visit the `Arrow collective `_. + diff --git a/third_party/python/arrow/arrow-1.3.0.dist-info/RECORD b/third_party/python/arrow/arrow-1.3.0.dist-info/RECORD new file mode 100644 index 000000000000..6b7ca331e4af --- /dev/null +++ b/third_party/python/arrow/arrow-1.3.0.dist-info/RECORD @@ -0,0 +1,15 @@ +arrow/__init__.py,sha256=HxsSJGl56GoeHB__No-kdGmC_Wes_Ttf0ohOy7OoFig,872 +arrow/_version.py,sha256=F5mW07pSyGrqDNY2Ehr-UpDzpBtN-FsYU0QGZWf6PJE,22 +arrow/api.py,sha256=6tdqrG0NjrKO22_eWHU4a5xerfR6IrZPY-yynGpnvTM,2755 +arrow/arrow.py,sha256=m9XvNnpQ1aTHZWXPud3W2-QMfilgWXnUCnuZInwf27g,63517 +arrow/constants.py,sha256=y3scgWgxiFuQg4DeFlhmexy1BA7K8LFNZyqK-VWPQJs,3238 +arrow/factory.py,sha256=qiDSokfcVWJhiJbIkOcU1Ohh4N0PdKxghsJzBnI8AUo,11432 +arrow/formatter.py,sha256=0D0-AjBZwuay9312KvY0UnaVBfAZj-vEIqWcG0_3ZDQ,5267 +arrow/locales.py,sha256=6g5xHq5UkIAZPF8N2PvzN_xoUvsfNcPhNfJw0TUi8tw,156894 +arrow/parser.py,sha256=FO6NWpzjvZcsMhIck6pd7hKe1ijlKUZE9l_OFlyskyw,25790 +arrow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +arrow/util.py,sha256=xnDevqRyNeYWbl3x-n_Tyo4cOgHcdgbxFECFsJ1XoEc,3679 +arrow-1.3.0.dist-info/LICENSE,sha256=tIH4cpbLCr2xP9jLuUsUwyi-iA7J5oVHphuE2s_9Bno,11341 +arrow-1.3.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81 +arrow-1.3.0.dist-info/METADATA,sha256=P7gh6Gt6pIqBLBP577OoTZWFhRmAOpMyiwpuNEeklac,7534 +arrow-1.3.0.dist-info/RECORD,, diff --git a/third_party/python/build/build-1.2.1.dist-info/WHEEL b/third_party/python/arrow/arrow-1.3.0.dist-info/WHEEL similarity index 100% rename from third_party/python/build/build-1.2.1.dist-info/WHEEL rename to third_party/python/arrow/arrow-1.3.0.dist-info/WHEEL diff --git a/third_party/python/arrow/arrow/_version.py b/third_party/python/arrow/arrow/_version.py index 10aa336ce071..67bc602abf06 100644 --- a/third_party/python/arrow/arrow/_version.py +++ b/third_party/python/arrow/arrow/_version.py @@ -1 +1 @@ -__version__ = "1.2.3" +__version__ = "1.3.0" diff --git a/third_party/python/arrow/arrow/arrow.py b/third_party/python/arrow/arrow/arrow.py index 1ede107f5632..8d329efd8145 100644 --- a/third_party/python/arrow/arrow/arrow.py +++ b/third_party/python/arrow/arrow/arrow.py @@ -168,9 +168,9 @@ class Arrow: isinstance(tzinfo, dt_tzinfo) and hasattr(tzinfo, "localize") and hasattr(tzinfo, "zone") - and tzinfo.zone # type: ignore[attr-defined] + and tzinfo.zone ): - tzinfo = parser.TzinfoParser.parse(tzinfo.zone) # type: ignore[attr-defined] + tzinfo = parser.TzinfoParser.parse(tzinfo.zone) elif isinstance(tzinfo, str): tzinfo = parser.TzinfoParser.parse(tzinfo) @@ -495,7 +495,7 @@ class Arrow: yield current values = [getattr(current, f) for f in cls._ATTRS] - current = cls(*values, tzinfo=tzinfo).shift( # type: ignore + current = cls(*values, tzinfo=tzinfo).shift( # type: ignore[misc] **{frame_relative: relative_steps} ) @@ -578,7 +578,7 @@ class Arrow: for _ in range(3 - len(values)): values.append(1) - floor = self.__class__(*values, tzinfo=self.tzinfo) # type: ignore + floor = self.__class__(*values, tzinfo=self.tzinfo) # type: ignore[misc] if frame_absolute == "week": # if week_start is greater than self.isoweekday() go back one week by setting delta = 7 @@ -792,7 +792,6 @@ class Arrow: return self._datetime.isoformat() def __format__(self, formatstr: str) -> str: - if len(formatstr) > 0: return self.format(formatstr) @@ -804,7 +803,6 @@ class Arrow: # attributes and properties def __getattr__(self, name: str) -> int: - if name == "week": return self.isocalendar()[1] @@ -965,7 +963,6 @@ class Arrow: absolute_kwargs = {} for key, value in kwargs.items(): - if key in self._ATTRS: absolute_kwargs[key] = value elif key in ["week", "quarter"]: @@ -1022,7 +1019,6 @@ class Arrow: additional_attrs = ["weeks", "quarters", "weekday"] for key, value in kwargs.items(): - if key in self._ATTRS_PLURAL or key in additional_attrs: relative_kwargs[key] = value else: @@ -1259,11 +1255,10 @@ class Arrow: ) if trunc(abs(delta)) != 1: - granularity += "s" # type: ignore + granularity += "s" # type: ignore[assignment] return locale.describe(granularity, delta, only_distance=only_distance) else: - if not granularity: raise ValueError( "Empty granularity list provided. " @@ -1314,7 +1309,7 @@ class Arrow: def dehumanize(self, input_string: str, locale: str = "en_us") -> "Arrow": """Returns a new :class:`Arrow ` object, that represents - the time difference relative to the attrbiutes of the + the time difference relative to the attributes of the :class:`Arrow ` object. :param timestring: a ``str`` representing a humanized relative time. @@ -1367,7 +1362,6 @@ class Arrow: # Search input string for each time unit within locale for unit, unit_object in locale_obj.timeframes.items(): - # Need to check the type of unit_object to create the correct dictionary if isinstance(unit_object, Mapping): strings_to_search = unit_object @@ -1378,7 +1372,6 @@ class Arrow: # Needs to cycle all through strings as some locales have strings that # could overlap in a regex match, since input validation isn't being performed. for time_delta, time_string in strings_to_search.items(): - # Replace {0} with regex \d representing digits search_string = str(time_string) search_string = search_string.format(r"\d+") @@ -1419,7 +1412,7 @@ class Arrow: # Assert error if string does not modify any units if not any([True for k, v in unit_visited.items() if v]): raise ValueError( - "Input string not valid. Note: Some locales do not support the week granulairty in Arrow. " + "Input string not valid. Note: Some locales do not support the week granularity in Arrow. " "If you are attempting to use the week granularity on an unsupported locale, this could be the cause of this error." ) @@ -1718,7 +1711,6 @@ class Arrow: # math def __add__(self, other: Any) -> "Arrow": - if isinstance(other, (timedelta, relativedelta)): return self.fromdatetime(self._datetime + other, self._datetime.tzinfo) @@ -1736,7 +1728,6 @@ class Arrow: pass # pragma: no cover def __sub__(self, other: Any) -> Union[timedelta, "Arrow"]: - if isinstance(other, (timedelta, relativedelta)): return self.fromdatetime(self._datetime - other, self._datetime.tzinfo) @@ -1749,7 +1740,6 @@ class Arrow: return NotImplemented def __rsub__(self, other: Any) -> timedelta: - if isinstance(other, dt_datetime): return other - self._datetime @@ -1758,42 +1748,36 @@ class Arrow: # comparisons def __eq__(self, other: Any) -> bool: - if not isinstance(other, (Arrow, dt_datetime)): return False return self._datetime == self._get_datetime(other) def __ne__(self, other: Any) -> bool: - if not isinstance(other, (Arrow, dt_datetime)): return True return not self.__eq__(other) def __gt__(self, other: Any) -> bool: - if not isinstance(other, (Arrow, dt_datetime)): return NotImplemented return self._datetime > self._get_datetime(other) def __ge__(self, other: Any) -> bool: - if not isinstance(other, (Arrow, dt_datetime)): return NotImplemented return self._datetime >= self._get_datetime(other) def __lt__(self, other: Any) -> bool: - if not isinstance(other, (Arrow, dt_datetime)): return NotImplemented return self._datetime < self._get_datetime(other) def __le__(self, other: Any) -> bool: - if not isinstance(other, (Arrow, dt_datetime)): return NotImplemented @@ -1865,7 +1849,6 @@ class Arrow: def _get_iteration_params(cls, end: Any, limit: Optional[int]) -> Tuple[Any, int]: """Sets default end and limit values for range method.""" if end is None: - if limit is None: raise ValueError("One of 'end' or 'limit' is required.") diff --git a/third_party/python/arrow/arrow/factory.py b/third_party/python/arrow/arrow/factory.py index aad4af8bdec2..f35085f1c6bd 100644 --- a/third_party/python/arrow/arrow/factory.py +++ b/third_party/python/arrow/arrow/factory.py @@ -267,11 +267,9 @@ class ArrowFactory: raise TypeError(f"Cannot parse single argument of type {type(arg)!r}.") elif arg_count == 2: - arg_1, arg_2 = args[0], args[1] if isinstance(arg_1, datetime): - # (datetime, tzinfo/str) -> fromdatetime @ tzinfo if isinstance(arg_2, (dt_tzinfo, str)): return self.type.fromdatetime(arg_1, tzinfo=arg_2) @@ -281,7 +279,6 @@ class ArrowFactory: ) elif isinstance(arg_1, date): - # (date, tzinfo/str) -> fromdate @ tzinfo if isinstance(arg_2, (dt_tzinfo, str)): return self.type.fromdate(arg_1, tzinfo=arg_2) diff --git a/third_party/python/arrow/arrow/formatter.py b/third_party/python/arrow/arrow/formatter.py index 728bea1aafc6..d45f7153921f 100644 --- a/third_party/python/arrow/arrow/formatter.py +++ b/third_party/python/arrow/arrow/formatter.py @@ -29,7 +29,6 @@ FORMAT_W3C: Final[str] = "YYYY-MM-DD HH:mm:ssZZ" class DateTimeFormatter: - # This pattern matches characters enclosed in square brackets are matched as # an atomic group. For more info on atomic groups and how to they are # emulated in Python's re library, see https://stackoverflow.com/a/13577411/2701578 @@ -41,18 +40,15 @@ class DateTimeFormatter: locale: locales.Locale def __init__(self, locale: str = DEFAULT_LOCALE) -> None: - self.locale = locales.get_locale(locale) def format(cls, dt: datetime, fmt: str) -> str: - # FIXME: _format_token() is nullable return cls._FORMAT_RE.sub( lambda m: cast(str, cls._format_token(dt, m.group(0))), fmt ) def _format_token(self, dt: datetime, token: Optional[str]) -> Optional[str]: - if token and token.startswith("[") and token.endswith("]"): return token[1:-1] diff --git a/third_party/python/arrow/arrow/locales.py b/third_party/python/arrow/arrow/locales.py index 3627497f57b9..34b2a0986e0c 100644 --- a/third_party/python/arrow/arrow/locales.py +++ b/third_party/python/arrow/arrow/locales.py @@ -129,7 +129,6 @@ class Locale: _locale_map[locale_name.lower().replace("_", "-")] = cls def __init__(self) -> None: - self._month_name_to_ordinal = None def describe( @@ -174,7 +173,7 @@ class Locale: # Needed to determine the correct relative string to use timeframe_value = 0 - for _unit_name, unit_value in timeframes: + for _, unit_value in timeframes: if trunc(unit_value) != 0: timeframe_value = trunc(unit_value) break @@ -285,7 +284,6 @@ class Locale: timeframe: TimeFrameLiteral, delta: Union[float, int], ) -> str: - if timeframe == "now": return humanized @@ -425,7 +423,7 @@ class ItalianLocale(Locale): "hours": "{0} ore", "day": "un giorno", "days": "{0} giorni", - "week": "una settimana,", + "week": "una settimana", "weeks": "{0} settimane", "month": "un mese", "months": "{0} mesi", @@ -867,14 +865,16 @@ class FinnishLocale(Locale): timeframes: ClassVar[Mapping[TimeFrameLiteral, Union[str, Mapping[str, str]]]] = { "now": "juuri nyt", - "second": "sekunti", - "seconds": {"past": "{0} muutama sekunti", "future": "{0} muutaman sekunnin"}, + "second": {"past": "sekunti", "future": "sekunnin"}, + "seconds": {"past": "{0} sekuntia", "future": "{0} sekunnin"}, "minute": {"past": "minuutti", "future": "minuutin"}, "minutes": {"past": "{0} minuuttia", "future": "{0} minuutin"}, "hour": {"past": "tunti", "future": "tunnin"}, "hours": {"past": "{0} tuntia", "future": "{0} tunnin"}, - "day": "päivä", + "day": {"past": "päivä", "future": "päivän"}, "days": {"past": "{0} päivää", "future": "{0} päivän"}, + "week": {"past": "viikko", "future": "viikon"}, + "weeks": {"past": "{0} viikkoa", "future": "{0} viikon"}, "month": {"past": "kuukausi", "future": "kuukauden"}, "months": {"past": "{0} kuukautta", "future": "{0} kuukauden"}, "year": {"past": "vuosi", "future": "vuoden"}, @@ -1887,7 +1887,7 @@ class GermanBaseLocale(Locale): future = "in {0}" and_word = "und" - timeframes = { + timeframes: ClassVar[Dict[TimeFrameLiteral, str]] = { "now": "gerade eben", "second": "einer Sekunde", "seconds": "{0} Sekunden", @@ -1982,7 +1982,9 @@ class GermanBaseLocale(Locale): return super().describe(timeframe, delta, only_distance) # German uses a different case without 'in' or 'ago' - humanized = self.timeframes_only_distance[timeframe].format(trunc(abs(delta))) + humanized: str = self.timeframes_only_distance[timeframe].format( + trunc(abs(delta)) + ) return humanized @@ -2547,6 +2549,8 @@ class ArabicLocale(Locale): "hours": {"2": "ساعتين", "ten": "{0} ساعات", "higher": "{0} ساعة"}, "day": "يوم", "days": {"2": "يومين", "ten": "{0} أيام", "higher": "{0} يوم"}, + "week": "اسبوع", + "weeks": {"2": "اسبوعين", "ten": "{0} أسابيع", "higher": "{0} اسبوع"}, "month": "شهر", "months": {"2": "شهرين", "ten": "{0} أشهر", "higher": "{0} شهر"}, "year": "سنة", @@ -3709,6 +3713,8 @@ class HungarianLocale(Locale): "hours": {"past": "{0} órával", "future": "{0} óra"}, "day": {"past": "egy nappal", "future": "egy nap"}, "days": {"past": "{0} nappal", "future": "{0} nap"}, + "week": {"past": "egy héttel", "future": "egy hét"}, + "weeks": {"past": "{0} héttel", "future": "{0} hét"}, "month": {"past": "egy hónappal", "future": "egy hónap"}, "months": {"past": "{0} hónappal", "future": "{0} hónap"}, "year": {"past": "egy évvel", "future": "egy év"}, @@ -3934,7 +3940,6 @@ class ThaiLocale(Locale): class LaotianLocale(Locale): - names = ["lo", "lo-la"] past = "{0} ກ່ອນຫນ້ານີ້" @@ -4119,6 +4124,7 @@ class BengaliLocale(Locale): return f"{n}র্থ" if n == 6: return f"{n}ষ্ঠ" + return "" class RomanshLocale(Locale): @@ -4137,6 +4143,8 @@ class RomanshLocale(Locale): "hours": "{0} ura", "day": "in di", "days": "{0} dis", + "week": "in'emna", + "weeks": "{0} emnas", "month": "in mais", "months": "{0} mais", "year": "in onn", @@ -5399,7 +5407,7 @@ class LuxembourgishLocale(Locale): future = "an {0}" and_word = "an" - timeframes = { + timeframes: ClassVar[Dict[TimeFrameLiteral, str]] = { "now": "just elo", "second": "enger Sekonn", "seconds": "{0} Sekonnen", @@ -5487,7 +5495,9 @@ class LuxembourgishLocale(Locale): return super().describe(timeframe, delta, only_distance) # Luxembourgish uses a different case without 'in' or 'ago' - humanized = self.timeframes_only_distance[timeframe].format(trunc(abs(delta))) + humanized: str = self.timeframes_only_distance[timeframe].format( + trunc(abs(delta)) + ) return humanized diff --git a/third_party/python/arrow/arrow/parser.py b/third_party/python/arrow/arrow/parser.py index e95d78b0d6eb..645e3da74141 100644 --- a/third_party/python/arrow/arrow/parser.py +++ b/third_party/python/arrow/arrow/parser.py @@ -159,7 +159,6 @@ class DateTimeParser: _input_re_map: Dict[_FORMAT_TYPE, Pattern[str]] def __init__(self, locale: str = DEFAULT_LOCALE, cache_size: int = 0) -> None: - self.locale = locales.get_locale(locale) self._input_re_map = self._BASE_INPUT_RE_MAP.copy() self._input_re_map.update( @@ -196,7 +195,6 @@ class DateTimeParser: def parse_iso( self, datetime_string: str, normalize_whitespace: bool = False ) -> datetime: - if normalize_whitespace: datetime_string = re.sub(r"\s+", " ", datetime_string.strip()) @@ -236,13 +234,14 @@ class DateTimeParser: ] if has_time: - if has_space_divider: date_string, time_string = datetime_string.split(" ", 1) else: date_string, time_string = datetime_string.split("T", 1) - time_parts = re.split(r"[\+\-Z]", time_string, 1, re.IGNORECASE) + time_parts = re.split( + r"[\+\-Z]", time_string, maxsplit=1, flags=re.IGNORECASE + ) time_components: Optional[Match[str]] = self._TIME_RE.match(time_parts[0]) @@ -303,7 +302,6 @@ class DateTimeParser: fmt: Union[List[str], str], normalize_whitespace: bool = False, ) -> datetime: - if normalize_whitespace: datetime_string = re.sub(r"\s+", " ", datetime_string) @@ -341,12 +339,11 @@ class DateTimeParser: f"Unable to find a match group for the specified token {token!r}." ) - self._parse_token(token, value, parts) # type: ignore + self._parse_token(token, value, parts) # type: ignore[arg-type] return self._build_datetime(parts) def _generate_pattern_re(self, fmt: str) -> Tuple[List[_FORMAT_TYPE], Pattern[str]]: - # fmt is a string of tokens like 'YYYY-MM-DD' # we construct a new string by replacing each # token by its pattern: @@ -498,7 +495,6 @@ class DateTimeParser: value: Any, parts: _Parts, ) -> None: - if token == "YYYY": parts["year"] = int(value) @@ -508,7 +504,7 @@ class DateTimeParser: elif token in ["MMMM", "MMM"]: # FIXME: month_number() is nullable - parts["month"] = self.locale.month_number(value.lower()) # type: ignore + parts["month"] = self.locale.month_number(value.lower()) # type: ignore[typeddict-item] elif token in ["MM", "M"]: parts["month"] = int(value) @@ -588,7 +584,6 @@ class DateTimeParser: weekdate = parts.get("weekdate") if weekdate is not None: - year, week = int(weekdate[0]), int(weekdate[1]) if weekdate[2] is not None: @@ -712,7 +707,6 @@ class DateTimeParser: ) def _parse_multiformat(self, string: str, formats: Iterable[str]) -> datetime: - _datetime: Optional[datetime] = None for fmt in formats: @@ -740,12 +734,11 @@ class DateTimeParser: class TzinfoParser: _TZINFO_RE: ClassVar[Pattern[str]] = re.compile( - r"^([\+\-])?(\d{2})(?:\:?(\d{2}))?$" + r"^(?:\(UTC)*([\+\-])?(\d{2})(?:\:?(\d{2}))?" ) @classmethod def parse(cls, tzinfo_string: str) -> dt_tzinfo: - tzinfo: Optional[dt_tzinfo] = None if tzinfo_string == "local": @@ -755,7 +748,6 @@ class TzinfoParser: tzinfo = tz.tzutc() else: - iso_match = cls._TZINFO_RE.match(tzinfo_string) if iso_match: diff --git a/third_party/python/build/build-1.2.1.dist-info/LICENSE b/third_party/python/build/build-1.2.2.dist-info/LICENSE similarity index 100% rename from third_party/python/build/build-1.2.1.dist-info/LICENSE rename to third_party/python/build/build-1.2.2.dist-info/LICENSE diff --git a/third_party/python/build/build-1.2.1.dist-info/METADATA b/third_party/python/build/build-1.2.2.dist-info/METADATA similarity index 68% rename from third_party/python/build/build-1.2.1.dist-info/METADATA rename to third_party/python/build/build-1.2.2.dist-info/METADATA index 98c8cd2ab5bf..5c798844127f 100644 --- a/third_party/python/build/build-1.2.1.dist-info/METADATA +++ b/third_party/python/build/build-1.2.2.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: build -Version: 1.2.1 +Version: 1.2.2 Summary: A simple, correct Python build frontend Author-email: Filipe Laíns , Bernát Gábor , layday , Henry Schreiner Requires-Python: >= 3.8 @@ -86,10 +86,67 @@ This will build the package in an isolated environment, generating a source-distribution and wheel in the directory `dist/`. See the [documentation](https://build.pypa.io) for full information. +### Common arguments + +- `--sdist` (`-s`): Produce just an SDist +- `--wheel` (`-w`): Produce just a wheel +- `-C