aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-03-18 15:57:16 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-03-18 17:36:01 +0300
commit5f76bcc9d8a7d0ff624c12731027acf9a54dd5a8 (patch)
tree15ab8c78ee8a8e4e743139621d634551298db94e /contrib/python
parentebc6526bccdf9d2304b9eef3a0a9eaba8e7e38f7 (diff)
downloadydb-5f76bcc9d8a7d0ff624c12731027acf9a54dd5a8.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python')
-rw-r--r--contrib/python/python-dateutil/py2/.dist-info/METADATA12
-rw-r--r--contrib/python/python-dateutil/py2/AUTHORS.md3
-rw-r--r--contrib/python/python-dateutil/py2/README.rst2
-rw-r--r--contrib/python/python-dateutil/py2/dateutil/__init__.py16
-rw-r--r--contrib/python/python-dateutil/py2/dateutil/_version.py5
-rw-r--r--contrib/python/python-dateutil/py2/dateutil/parser/isoparser.py2
-rw-r--r--contrib/python/python-dateutil/py2/dateutil/relativedelta.py2
-rw-r--r--contrib/python/python-dateutil/py2/dateutil/rrule.py2
-rw-r--r--contrib/python/python-dateutil/py2/dateutil/tz/tz.py2
-rw-r--r--contrib/python/python-dateutil/py2/dateutil/zoneinfo/dateutil-zoneinfo.tar.gzbin147844 -> 156400 bytes
-rw-r--r--contrib/python/python-dateutil/py2/tests/__init__.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/__init__.py)0
-rw-r--r--contrib/python/python-dateutil/py2/tests/_common.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/_common.py)0
-rw-r--r--contrib/python/python-dateutil/py2/tests/conftest.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/conftest.py)0
-rw-r--r--contrib/python/python-dateutil/py2/tests/property/test_isoparse_prop.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/property/test_isoparse_prop.py)0
-rw-r--r--contrib/python/python-dateutil/py2/tests/property/test_parser_prop.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/property/test_parser_prop.py)0
-rw-r--r--contrib/python/python-dateutil/py2/tests/property/test_tz_prop.py35
-rw-r--r--contrib/python/python-dateutil/py2/tests/test_easter.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/test_easter.py)0
-rw-r--r--contrib/python/python-dateutil/py2/tests/test_import_star.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/test_import_star.py)0
-rw-r--r--contrib/python/python-dateutil/py2/tests/test_imports.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/test_imports.py)64
-rw-r--r--contrib/python/python-dateutil/py2/tests/test_internals.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/test_internals.py)14
-rw-r--r--contrib/python/python-dateutil/py2/tests/test_isoparser.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/test_isoparser.py)8
-rw-r--r--contrib/python/python-dateutil/py2/tests/test_parser.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/test_parser.py)0
-rw-r--r--contrib/python/python-dateutil/py2/tests/test_relativedelta.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/test_relativedelta.py)61
-rw-r--r--contrib/python/python-dateutil/py2/tests/test_rrule.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/test_rrule.py)0
-rw-r--r--contrib/python/python-dateutil/py2/tests/test_tz.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/test_tz.py)0
-rw-r--r--contrib/python/python-dateutil/py2/tests/test_utils.py (renamed from contrib/python/python-dateutil/py2/dateutil/test/test_utils.py)0
-rw-r--r--contrib/python/python-dateutil/py2/tests/ya.make2
-rw-r--r--contrib/python/python-dateutil/py2/ya.make2
28 files changed, 204 insertions, 28 deletions
diff --git a/contrib/python/python-dateutil/py2/.dist-info/METADATA b/contrib/python/python-dateutil/py2/.dist-info/METADATA
index 1e46c96a44..577f2bf2b7 100644
--- a/contrib/python/python-dateutil/py2/.dist-info/METADATA
+++ b/contrib/python/python-dateutil/py2/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: python-dateutil
-Version: 2.8.2
+Version: 2.9.0.post0
Summary: Extensions to the standard Python datetime module
Home-page: https://github.com/dateutil/dateutil
Author: Gustavo Niemeyer
@@ -10,7 +10,6 @@ Maintainer-email: dateutil@python.org
License: Dual License
Project-URL: Documentation, https://dateutil.readthedocs.io/en/stable/
Project-URL: Source, https://github.com/dateutil/dateutil
-Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
@@ -26,11 +25,14 @@ 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
+Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,>=2.7
Description-Content-Type: text/x-rst
License-File: LICENSE
-Requires-Dist: six (>=1.5)
+Requires-Dist: six >=1.5
dateutil - powerful extensions to datetime
==========================================
@@ -181,7 +183,7 @@ keys can be found below:
=========== ============================
Releases Signing key fingerprint
=========== ============================
-2.4.1-2.8.2 `6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB`_
+2.4.1-2.8.2 `6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB`_
=========== ============================
New releases *may* have signed tags, but binary and source distributions
@@ -200,5 +202,3 @@ All contributions after December 1, 2017 released under dual license - either `A
.. _6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB:
https://pgp.mit.edu/pks/lookup?op=vindex&search=0xCD54FCE3D964BEFB
-
-
diff --git a/contrib/python/python-dateutil/py2/AUTHORS.md b/contrib/python/python-dateutil/py2/AUTHORS.md
index fa9184207f..793a2fd595 100644
--- a/contrib/python/python-dateutil/py2/AUTHORS.md
+++ b/contrib/python/python-dateutil/py2/AUTHORS.md
@@ -15,6 +15,7 @@ switch, and thus all their contributions are dual-licensed.
- Adrien Cossa <cossa@MASKED>
- Alec Nikolas Reiter <alecreiter@MASKED>
- Alec Reiter <areiter@MASKED>
+- Aleksei Strizhak <alexei.mifrill.strizhak@MASKED> (gh: @Mifrill)
- Alex Chamberlain (gh: @alexchamberlain) **D**
- Alex Verdyan <verdyan@MASKED>
- Alex Willmer <alex@moreati.org.uk> (gh: @moreati) **R**
@@ -59,6 +60,7 @@ switch, and thus all their contributions are dual-licensed.
- Ionuț Ciocîrlan <jdxlark@MASKED>
- Jacqueline Chen <jacqueline415@outlook.com> (gh: @jachen20) **D**
- Jake Chorley (gh: @jakec-github) **D**
+- Jakub Kulík (gh: @kulikjak) **D**
- Jan Studený <jendas1@MASKED>
- Jay Weisskopf <jay@jayschwa.net> (gh: @jayschwa) **D**
- Jitesh <jitesh@MASKED>
@@ -108,6 +110,7 @@ switch, and thus all their contributions are dual-licensed.
- Thierry Bastian <thierryb@MASKED>
- Thomas A Caswell <tcaswell@MASKED> (gh: @tacaswell) **R**
- Thomas Achtemichuk <tom@MASKED>
+- Thomas Grainger <tagrain@gmail.com> (gh: @graingert) **D**
- Thomas Kluyver <takowl@MASKED> (gh: @takluyver)
- Tim Gates <tim.gates@iress.com> (gh: timgates42)
- Tomasz Kluczkowski (gh: @Tomasz-Kluczkowski) **D**
diff --git a/contrib/python/python-dateutil/py2/README.rst b/contrib/python/python-dateutil/py2/README.rst
index 106023b324..c9db1fd359 100644
--- a/contrib/python/python-dateutil/py2/README.rst
+++ b/contrib/python/python-dateutil/py2/README.rst
@@ -147,7 +147,7 @@ keys can be found below:
=========== ============================
Releases Signing key fingerprint
=========== ============================
-2.4.1-2.8.2 `6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB`_
+2.4.1-2.8.2 `6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB`_
=========== ============================
New releases *may* have signed tags, but binary and source distributions
diff --git a/contrib/python/python-dateutil/py2/dateutil/__init__.py b/contrib/python/python-dateutil/py2/dateutil/__init__.py
index 0defb82e21..a2c19c06fe 100644
--- a/contrib/python/python-dateutil/py2/dateutil/__init__.py
+++ b/contrib/python/python-dateutil/py2/dateutil/__init__.py
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
+import sys
+
try:
from ._version import version as __version__
except ImportError:
@@ -6,3 +8,17 @@ except ImportError:
__all__ = ['easter', 'parser', 'relativedelta', 'rrule', 'tz',
'utils', 'zoneinfo']
+
+def __getattr__(name):
+ import importlib
+
+ if name in __all__:
+ return importlib.import_module("." + name, __name__)
+ raise AttributeError(
+ "module {!r} has not attribute {!r}".format(__name__, name)
+ )
+
+
+def __dir__():
+ # __dir__ should include all the lazy-importable modules as well.
+ return [x for x in globals() if x not in sys.modules] + __all__
diff --git a/contrib/python/python-dateutil/py2/dateutil/_version.py b/contrib/python/python-dateutil/py2/dateutil/_version.py
index b723056a75..ddda980985 100644
--- a/contrib/python/python-dateutil/py2/dateutil/_version.py
+++ b/contrib/python/python-dateutil/py2/dateutil/_version.py
@@ -1,5 +1,4 @@
-# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
-version = '2.8.2'
-version_tuple = (2, 8, 2)
+__version__ = version = '2.9.0.post0'
+__version_tuple__ = version_tuple = (2, 9, 0)
diff --git a/contrib/python/python-dateutil/py2/dateutil/parser/isoparser.py b/contrib/python/python-dateutil/py2/dateutil/parser/isoparser.py
index 5d7bee3800..7060087df4 100644
--- a/contrib/python/python-dateutil/py2/dateutil/parser/isoparser.py
+++ b/contrib/python/python-dateutil/py2/dateutil/parser/isoparser.py
@@ -72,7 +72,7 @@ class isoparser(object):
Common:
- ``YYYY``
- - ``YYYY-MM`` or ``YYYYMM``
+ - ``YYYY-MM``
- ``YYYY-MM-DD`` or ``YYYYMMDD``
Uncommon:
diff --git a/contrib/python/python-dateutil/py2/dateutil/relativedelta.py b/contrib/python/python-dateutil/py2/dateutil/relativedelta.py
index a9e85f7e6c..cd323a549e 100644
--- a/contrib/python/python-dateutil/py2/dateutil/relativedelta.py
+++ b/contrib/python/python-dateutil/py2/dateutil/relativedelta.py
@@ -48,7 +48,7 @@ class relativedelta(object):
the corresponding arithmetic operation on the original datetime value
with the information in the relativedelta.
- weekday:
+ weekday:
One of the weekday instances (MO, TU, etc) available in the
relativedelta module. These instances may receive a parameter N,
specifying the Nth weekday, which could be positive or negative
diff --git a/contrib/python/python-dateutil/py2/dateutil/rrule.py b/contrib/python/python-dateutil/py2/dateutil/rrule.py
index b3203393c6..571a0d2bc8 100644
--- a/contrib/python/python-dateutil/py2/dateutil/rrule.py
+++ b/contrib/python/python-dateutil/py2/dateutil/rrule.py
@@ -182,7 +182,7 @@ class rrulebase(object):
# __len__() introduces a large performance penalty.
def count(self):
""" Returns the number of recurrences in this set. It will have go
- trough the whole recurrence, if this hasn't been done before. """
+ through the whole recurrence, if this hasn't been done before. """
if self._len is None:
for x in self:
pass
diff --git a/contrib/python/python-dateutil/py2/dateutil/tz/tz.py b/contrib/python/python-dateutil/py2/dateutil/tz/tz.py
index c67f56d465..617591446b 100644
--- a/contrib/python/python-dateutil/py2/dateutil/tz/tz.py
+++ b/contrib/python/python-dateutil/py2/dateutil/tz/tz.py
@@ -34,7 +34,7 @@ except ImportError:
from warnings import warn
ZERO = datetime.timedelta(0)
-EPOCH = datetime.datetime.utcfromtimestamp(0)
+EPOCH = datetime.datetime(1970, 1, 1, 0, 0)
EPOCHORDINAL = EPOCH.toordinal()
diff --git a/contrib/python/python-dateutil/py2/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz b/contrib/python/python-dateutil/py2/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz
index 631ab17d2d..1461f8c862 100644
--- a/contrib/python/python-dateutil/py2/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz
+++ b/contrib/python/python-dateutil/py2/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz
Binary files differ
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/__init__.py b/contrib/python/python-dateutil/py2/tests/__init__.py
index e69de29bb2..e69de29bb2 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/__init__.py
+++ b/contrib/python/python-dateutil/py2/tests/__init__.py
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/_common.py b/contrib/python/python-dateutil/py2/tests/_common.py
index b8d2047374..b8d2047374 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/_common.py
+++ b/contrib/python/python-dateutil/py2/tests/_common.py
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/conftest.py b/contrib/python/python-dateutil/py2/tests/conftest.py
index 78ed70acb3..78ed70acb3 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/conftest.py
+++ b/contrib/python/python-dateutil/py2/tests/conftest.py
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/property/test_isoparse_prop.py b/contrib/python/python-dateutil/py2/tests/property/test_isoparse_prop.py
index f8e288f3d6..f8e288f3d6 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/property/test_isoparse_prop.py
+++ b/contrib/python/python-dateutil/py2/tests/property/test_isoparse_prop.py
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/property/test_parser_prop.py b/contrib/python/python-dateutil/py2/tests/property/test_parser_prop.py
index fdfd171e86..fdfd171e86 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/property/test_parser_prop.py
+++ b/contrib/python/python-dateutil/py2/tests/property/test_parser_prop.py
diff --git a/contrib/python/python-dateutil/py2/tests/property/test_tz_prop.py b/contrib/python/python-dateutil/py2/tests/property/test_tz_prop.py
new file mode 100644
index 0000000000..ec6d271dcf
--- /dev/null
+++ b/contrib/python/python-dateutil/py2/tests/property/test_tz_prop.py
@@ -0,0 +1,35 @@
+from datetime import datetime, timedelta
+
+import pytest
+import six
+from hypothesis import assume, given
+from hypothesis import strategies as st
+
+from dateutil import tz as tz
+
+EPOCHALYPSE = datetime.fromtimestamp(2147483647)
+NEGATIVE_EPOCHALYPSE = datetime.fromtimestamp(0) - timedelta(seconds=2147483648)
+
+
+@pytest.mark.gettz
+@pytest.mark.parametrize("gettz_arg", [None, ""])
+# TODO: Remove bounds when GH #590 is resolved
+@given(
+ dt=st.datetimes(
+ min_value=NEGATIVE_EPOCHALYPSE, max_value=EPOCHALYPSE, timezones=st.just(tz.UTC),
+ )
+)
+def test_gettz_returns_local(gettz_arg, dt):
+ act_tz = tz.gettz(gettz_arg)
+ if isinstance(act_tz, tz.tzlocal):
+ return
+
+ dt_act = dt.astimezone(tz.gettz(gettz_arg))
+ if six.PY2:
+ dt_exp = dt.astimezone(tz.tzlocal())
+ else:
+ dt_exp = dt.astimezone()
+
+ assert dt_act == dt_exp
+ assert dt_act.tzname() == dt_exp.tzname()
+ assert dt_act.utcoffset() == dt_exp.utcoffset()
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/test_easter.py b/contrib/python/python-dateutil/py2/tests/test_easter.py
index cf2ec7f287..cf2ec7f287 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/test_easter.py
+++ b/contrib/python/python-dateutil/py2/tests/test_easter.py
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/test_import_star.py b/contrib/python/python-dateutil/py2/tests/test_import_star.py
index 2fb7098128..2fb7098128 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/test_import_star.py
+++ b/contrib/python/python-dateutil/py2/tests/test_import_star.py
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/test_imports.py b/contrib/python/python-dateutil/py2/tests/test_imports.py
index 60b86005ca..7d0749ec54 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/test_imports.py
+++ b/contrib/python/python-dateutil/py2/tests/test_imports.py
@@ -1,5 +1,69 @@
import sys
+import unittest
import pytest
+import six
+
+MODULE_TYPE = type(sys)
+
+
+# Tests live in datetutil/test which cause a RuntimeWarning for Python2 builds.
+# But since we expect lazy imports tests to fail for Python < 3.7 we'll ignore those
+# warnings with this filter.
+
+if six.PY2:
+ filter_import_warning = pytest.mark.filterwarnings("ignore::RuntimeWarning")
+else:
+
+ def filter_import_warning(f):
+ return f
+
+
+@pytest.fixture(scope="function")
+def clean_import():
+ """Create a somewhat clean import base for lazy import tests"""
+ du_modules = {
+ mod_name: mod
+ for mod_name, mod in sys.modules.items()
+ if mod_name.startswith("dateutil")
+ }
+
+ other_modules = {
+ mod_name for mod_name in sys.modules if mod_name not in du_modules
+ }
+
+ for mod_name in du_modules:
+ del sys.modules[mod_name]
+
+ yield
+
+ # Delete anything that wasn't in the origin sys.modules list
+ for mod_name in list(sys.modules):
+ if mod_name not in other_modules:
+ del sys.modules[mod_name]
+
+ # Restore original modules
+ for mod_name, mod in du_modules.items():
+ sys.modules[mod_name] = mod
+
+
+@filter_import_warning
+@pytest.mark.parametrize(
+ "module",
+ ["easter", "parser", "relativedelta", "rrule", "tz", "utils", "zoneinfo"],
+)
+def test_lazy_import(clean_import, module):
+ """Test that dateutil.[submodule] works for py version > 3.7"""
+
+ import dateutil, importlib
+
+ if sys.version_info < (3, 7):
+ pytest.xfail("Lazy loading does not work for Python < 3.7")
+
+ mod_obj = getattr(dateutil, module, None)
+ assert isinstance(mod_obj, MODULE_TYPE)
+
+ mod_imported = importlib.import_module("dateutil.%s" % module)
+ assert mod_obj is mod_imported
HOST_IS_WINDOWS = sys.platform.startswith('win')
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/test_internals.py b/contrib/python/python-dateutil/py2/tests/test_internals.py
index 530813147d..b32e6723fc 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/test_internals.py
+++ b/contrib/python/python-dateutil/py2/tests/test_internals.py
@@ -9,6 +9,7 @@ code that may be difficult to reach through the standard API calls.
import sys
import pytest
+import warnings
from dateutil.parser._parser import _ymd
from dateutil import tz
@@ -65,18 +66,17 @@ def test_parser_parser_private_not_warns():
from dateutil.parser._parser import _timelex, _tzparser
from dateutil.parser._parser import _parsetz
- with pytest.warns(None) as recorder:
+ with warnings.catch_warnings():
+ warnings.simplefilter("error")
_tzparser()
- assert len(recorder) == 0
- with pytest.warns(None) as recorder:
+ with warnings.catch_warnings():
+ warnings.simplefilter("error")
_timelex('2014-03-03')
- assert len(recorder) == 0
-
- with pytest.warns(None) as recorder:
+ with warnings.catch_warnings():
+ warnings.simplefilter("error")
_parsetz('+05:00')
- assert len(recorder) == 0
@pytest.mark.tzstr
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/test_isoparser.py b/contrib/python/python-dateutil/py2/tests/test_isoparser.py
index 35899ab9b1..c33881f3b0 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/test_isoparser.py
+++ b/contrib/python/python-dateutil/py2/tests/test_isoparser.py
@@ -80,10 +80,10 @@ def _isoparse_date_and_time(dt, date_fmt, time_fmt, tzoffset,
if not fmt.endswith('%f'): # pragma: nocover
raise ValueError('Time format has no microseconds!')
- if microsecond_precision != 6:
- dtstr = dtstr[:-(6 - microsecond_precision)]
- elif microsecond_precision > 6: # pragma: nocover
- raise ValueError('Precision must be 1-6')
+ if microsecond_precision != 6:
+ dtstr = dtstr[: -(6 - microsecond_precision)]
+ elif microsecond_precision > 6: # pragma: nocover
+ raise ValueError("Precision must be 1-6")
dtstr += offset_str
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/test_parser.py b/contrib/python/python-dateutil/py2/tests/test_parser.py
index 08a34dafbc..08a34dafbc 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/test_parser.py
+++ b/contrib/python/python-dateutil/py2/tests/test_parser.py
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/test_relativedelta.py b/contrib/python/python-dateutil/py2/tests/test_relativedelta.py
index 1e5d170449..5204c293b7 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/test_relativedelta.py
+++ b/contrib/python/python-dateutil/py2/tests/test_relativedelta.py
@@ -650,6 +650,67 @@ class RelativeDeltaTest(unittest.TestCase):
except:
self.fail("relativedelta() failed to hash!")
+ def testDayOfMonthPlus(self):
+ assert [
+ date(2021, 1, 28) + relativedelta(months=1),
+ date(2021, 2, 27) + relativedelta(months=1),
+ date(2021, 4, 29) + relativedelta(months=1),
+ date(2021, 5, 30) + relativedelta(months=1),
+ ] == [
+ date(2021, 2, 28),
+ date(2021, 3, 27),
+ date(2021, 5, 29),
+ date(2021, 6, 30),
+ ]
+
+ def testLastDayOfMonthPlus(self):
+ assert [
+ date(2021, 1, 31) + relativedelta(months=1),
+ date(2021, 1, 30) + relativedelta(months=1),
+ date(2021, 1, 29) + relativedelta(months=1),
+ date(2021, 1, 28) + relativedelta(months=1),
+ date(2021, 2, 28) + relativedelta(months=1),
+ date(2021, 4, 30) + relativedelta(months=1),
+ date(2021, 5, 31) + relativedelta(months=1),
+ ] == [
+ date(2021, 2, 28),
+ date(2021, 2, 28),
+ date(2021, 2, 28),
+ date(2021, 2, 28),
+ date(2021, 3, 28),
+ date(2021, 5, 30),
+ date(2021, 6, 30),
+ ]
+
+ def testDayOfMonthMinus(self):
+ assert [
+ date(2021, 2, 27) - relativedelta(months=1),
+ date(2021, 3, 30) - relativedelta(months=1),
+ date(2021, 3, 29) - relativedelta(months=1),
+ date(2021, 3, 28) - relativedelta(months=1),
+ date(2021, 5, 30) - relativedelta(months=1),
+ date(2021, 6, 29) - relativedelta(months=1),
+ ] == [
+ date(2021, 1, 27),
+ date(2021, 2, 28),
+ date(2021, 2, 28),
+ date(2021, 2, 28),
+ date(2021, 4, 30),
+ date(2021, 5, 29),
+ ]
+
+ def testLastDayOfMonthMinus(self):
+ assert [
+ date(2021, 2, 28) - relativedelta(months=1),
+ date(2021, 3, 31) - relativedelta(months=1),
+ date(2021, 5, 31) - relativedelta(months=1),
+ date(2021, 6, 30) - relativedelta(months=1),
+ ] == [
+ date(2021, 1, 28),
+ date(2021, 2, 28),
+ date(2021, 4, 30),
+ date(2021, 5, 30),
+ ]
class RelativeDeltaWeeksPropertyGetterTest(unittest.TestCase):
"""Test the weeks property getter"""
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/test_rrule.py b/contrib/python/python-dateutil/py2/tests/test_rrule.py
index 52673ecc26..52673ecc26 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/test_rrule.py
+++ b/contrib/python/python-dateutil/py2/tests/test_rrule.py
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/test_tz.py b/contrib/python/python-dateutil/py2/tests/test_tz.py
index e5e4772d9a..e5e4772d9a 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/test_tz.py
+++ b/contrib/python/python-dateutil/py2/tests/test_tz.py
diff --git a/contrib/python/python-dateutil/py2/dateutil/test/test_utils.py b/contrib/python/python-dateutil/py2/tests/test_utils.py
index fe1bfdcb84..fe1bfdcb84 100644
--- a/contrib/python/python-dateutil/py2/dateutil/test/test_utils.py
+++ b/contrib/python/python-dateutil/py2/tests/test_utils.py
diff --git a/contrib/python/python-dateutil/py2/tests/ya.make b/contrib/python/python-dateutil/py2/tests/ya.make
index 5b3ae41227..81fb4c8915 100644
--- a/contrib/python/python-dateutil/py2/tests/ya.make
+++ b/contrib/python/python-dateutil/py2/tests/ya.make
@@ -11,8 +11,6 @@ ENV(LANG=ru_RU.UTF-8)
# because we cannot change TZ in arcadia CI
ENV(DATEUTIL_MAY_NOT_CHANGE_TZ_VAR=1)
-SRCDIR(contrib/python/python-dateutil/py2/dateutil/test)
-
TEST_SRCS(
property/test_isoparse_prop.py
property/test_parser_prop.py
diff --git a/contrib/python/python-dateutil/py2/ya.make b/contrib/python/python-dateutil/py2/ya.make
index edad94a1f0..ae5784d273 100644
--- a/contrib/python/python-dateutil/py2/ya.make
+++ b/contrib/python/python-dateutil/py2/ya.make
@@ -2,7 +2,7 @@
PY2_LIBRARY()
-VERSION(2.8.2)
+VERSION(2.9.0.post0)
LICENSE(BSD-3-Clause)