diff options
| author | arcadia-devtools <[email protected]> | 2022-06-01 16:22:57 +0300 | 
|---|---|---|
| committer | arcadia-devtools <[email protected]> | 2022-06-01 16:22:57 +0300 | 
| commit | 63a84accbe6624a8f7258f16c3568b903845ce9a (patch) | |
| tree | 660e04171958103edb06b36ab2c1f0a1bc5436e3 /contrib/python | |
| parent | 3078efc0435f57bcd781b58118a6b82578d11037 (diff) | |
intermediate changes
ref:33582b2639153838c696b8bf2b6926f34f6d34e9
Diffstat (limited to 'contrib/python')
13 files changed, 57 insertions, 32 deletions
diff --git a/contrib/python/s3transfer/py3/.dist-info/METADATA b/contrib/python/s3transfer/py3/.dist-info/METADATA index dbafb16cb7d..2323710a8e5 100644 --- a/contrib/python/s3transfer/py3/.dist-info/METADATA +++ b/contrib/python/s3transfer/py3/.dist-info/METADATA @@ -1,6 +1,6 @@  Metadata-Version: 2.1  Name: s3transfer -Version: 0.5.2 +Version: 0.6.0  Summary: An Amazon S3 Transfer Manager  Home-page: https://github.com/boto/s3transfer  Author: Amazon Web Services @@ -13,12 +13,11 @@ Classifier: Natural Language :: English  Classifier: License :: OSI Approved :: Apache Software License  Classifier: Programming Language :: Python  Classifier: Programming Language :: Python :: 3 -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 +Requires-Python: >= 3.7  License-File: LICENSE.txt  License-File: NOTICE.txt  Requires-Dist: botocore (<2.0a.0,>=1.12.36) diff --git a/contrib/python/s3transfer/py3/s3transfer/__init__.py b/contrib/python/s3transfer/py3/s3transfer/__init__.py index c6760f87c2f..e8ff66f00ca 100644 --- a/contrib/python/s3transfer/py3/s3transfer/__init__.py +++ b/contrib/python/s3transfer/py3/s3transfer/__init__.py @@ -144,7 +144,7 @@ import s3transfer.compat  from s3transfer.exceptions import RetriesExceededError, S3UploadFailedError  __author__ = 'Amazon Web Services' -__version__ = '0.5.2' +__version__ = '0.6.0'  class NullHandler(logging.Handler): diff --git a/contrib/python/s3transfer/py3/s3transfer/manager.py b/contrib/python/s3transfer/py3/s3transfer/manager.py index 31aa488bdde..b11daeba958 100644 --- a/contrib/python/s3transfer/py3/s3transfer/manager.py +++ b/contrib/python/s3transfer/py3/s3transfer/manager.py @@ -171,6 +171,9 @@ class TransferManager:          'GrantReadACP',          'GrantWriteACP',          'Metadata', +        'ObjectLockLegalHoldStatus', +        'ObjectLockMode', +        'ObjectLockRetainUntilDate',          'RequestPayer',          'ServerSideEncryption',          'StorageClass', diff --git a/contrib/python/s3transfer/py3/s3transfer/upload.py b/contrib/python/s3transfer/py3/s3transfer/upload.py index 18368e0e363..0c99bd7b296 100644 --- a/contrib/python/s3transfer/py3/s3transfer/upload.py +++ b/contrib/python/s3transfer/py3/s3transfer/upload.py @@ -790,7 +790,7 @@ class UploadPartTask(Task):                  UploadId=upload_id,                  PartNumber=part_number,                  Body=body, -                **extra_args +                **extra_args,              )          etag = response['ETag']          part_metadata = {'ETag': etag, 'PartNumber': part_number} diff --git a/contrib/python/s3transfer/py3/s3transfer/utils.py b/contrib/python/s3transfer/py3/s3transfer/utils.py index ba881c67dd8..61407eba5c5 100644 --- a/contrib/python/s3transfer/py3/s3transfer/utils.py +++ b/contrib/python/s3transfer/py3/s3transfer/utils.py @@ -29,8 +29,8 @@ MAX_PARTS = 10000  # The maximum file size you can upload via S3 per request.  # See: http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadingObjects.html  # and: http://docs.aws.amazon.com/AmazonS3/latest/dev/qfacts.html -MAX_SINGLE_UPLOAD_SIZE = 5 * (1024 ** 3) -MIN_UPLOAD_CHUNKSIZE = 5 * (1024 ** 2) +MAX_SINGLE_UPLOAD_SIZE = 5 * (1024**3) +MIN_UPLOAD_CHUNKSIZE = 5 * (1024**2)  logger = logging.getLogger(__name__) diff --git a/contrib/python/s3transfer/py3/tests/unit/test_download.py b/contrib/python/s3transfer/py3/tests/unit/test_download.py index 2bd095f8675..e8b5fe1f86e 100644 --- a/contrib/python/s3transfer/py3/tests/unit/test_download.py +++ b/contrib/python/s3transfer/py3/tests/unit/test_download.py @@ -576,7 +576,7 @@ class TestGetObjectTask(BaseTaskTest):          self.stream = BytesIO(self.content)          self.fileobj = WriteCollector()          self.osutil = OSUtils() -        self.io_chunksize = 64 * (1024 ** 2) +        self.io_chunksize = 64 * (1024**2)          self.task_cls = GetObjectTask          self.download_output_manager = DownloadSeekableOutputManager(              self.osutil, self.transfer_coordinator, self.io_executor diff --git a/contrib/python/s3transfer/py3/tests/unit/test_utils.py b/contrib/python/s3transfer/py3/tests/unit/test_utils.py index a1ff904e7a1..217779943b0 100644 --- a/contrib/python/s3transfer/py3/tests/unit/test_utils.py +++ b/contrib/python/s3transfer/py3/tests/unit/test_utils.py @@ -1146,8 +1146,8 @@ class TestAdjustChunksize(unittest.TestCase):          self.adjuster = ChunksizeAdjuster()      def test_valid_chunksize(self): -        chunksize = 7 * (1024 ** 2) -        file_size = 8 * (1024 ** 2) +        chunksize = 7 * (1024**2) +        file_size = 8 * (1024**2)          new_size = self.adjuster.adjust_chunksize(chunksize, file_size)          self.assertEqual(new_size, chunksize) @@ -1164,17 +1164,17 @@ class TestAdjustChunksize(unittest.TestCase):          self.assertEqual(new_size, MAX_SINGLE_UPLOAD_SIZE)      def test_chunksize_too_small(self): -        chunksize = 7 * (1024 ** 2) -        file_size = 5 * (1024 ** 4) +        chunksize = 7 * (1024**2) +        file_size = 5 * (1024**4)          # If we try to upload a 5TB file, we'll need to use 896MB part          # sizes.          new_size = self.adjuster.adjust_chunksize(chunksize, file_size) -        self.assertEqual(new_size, 896 * (1024 ** 2)) +        self.assertEqual(new_size, 896 * (1024**2))          num_parts = file_size / new_size          self.assertLessEqual(num_parts, MAX_PARTS)      def test_unknown_file_size_with_valid_chunksize(self): -        chunksize = 7 * (1024 ** 2) +        chunksize = 7 * (1024**2)          new_size = self.adjuster.adjust_chunksize(chunksize)          self.assertEqual(new_size, chunksize) diff --git a/contrib/python/traitlets/py3/.dist-info/METADATA b/contrib/python/traitlets/py3/.dist-info/METADATA index 26ae3d62b4a..6429e017cc5 100644 --- a/contrib/python/traitlets/py3/.dist-info/METADATA +++ b/contrib/python/traitlets/py3/.dist-info/METADATA @@ -1,6 +1,6 @@  Metadata-Version: 2.1  Name: traitlets -Version: 5.2.1.post0 +Version: 5.2.2.post1  Project-URL: Homepage, https://github.com/ipython/traitlets  Author-email: IPython Development Team <[email protected]>  License: # Licensing terms diff --git a/contrib/python/traitlets/py3/traitlets/_version.py b/contrib/python/traitlets/py3/traitlets/_version.py index c671fe81ad6..f75993c7a65 100644 --- a/contrib/python/traitlets/py3/traitlets/_version.py +++ b/contrib/python/traitlets/py3/traitlets/_version.py @@ -1,5 +1,5 @@ -version_info = (5, 2, 1, "post0") -__version__ = "5.2.1.post0" +version_info = (5, 2, 2) +__version__ = "5.2.2"  # unlike `.dev`, alpha, beta and rc _must not_ have dots,  # or the wheel and tgz won't look to pip like the same version. diff --git a/contrib/python/traitlets/py3/traitlets/config/application.py b/contrib/python/traitlets/py3/traitlets/config/application.py index e5a86867423..efff262b718 100644 --- a/contrib/python/traitlets/py3/traitlets/config/application.py +++ b/contrib/python/traitlets/py3/traitlets/config/application.py @@ -92,6 +92,9 @@ else:      ) +IS_PYTHONW = sys.executable and sys.executable.endswith("pythonw.exe") + +  def catch_config_error(method):      """Method decorator for catching invalid config (Trait/ArgumentErrors) during init. @@ -252,11 +255,12 @@ class Application(SingletonConfigurable):              "disable_existing_loggers": False,          } -        if sys.executable and sys.executable.endswith("pythonw.exe"): +        if IS_PYTHONW:              # disable logging              # (this should really go to a file, but file-logging is only              # hooked up in parallel applications) -            del config["handlers"]["loggers"] +            del config["handlers"] +            del config["loggers"]          return config diff --git a/contrib/python/traitlets/py3/traitlets/config/tests/test_application.py b/contrib/python/traitlets/py3/traitlets/config/tests/test_application.py index db743f9f2e7..0f1cbd578f3 100644 --- a/contrib/python/traitlets/py3/traitlets/config/tests/test_application.py +++ b/contrib/python/traitlets/py3/traitlets/config/tests/test_application.py @@ -805,6 +805,19 @@ def test_logging_config(tmp_path, capsys):      assert capsys.readouterr().err == "[Application] WARNING | warn\n" +def test_get_default_logging_config_pythonw(monkeypatch): +    """Ensure logging is correctly disabled for pythonw usage.""" +    monkeypatch.setattr("traitlets.config.application.IS_PYTHONW", True) +    config = Application().get_default_logging_config() +    assert "handlers" not in config +    assert "loggers" not in config + +    monkeypatch.setattr("traitlets.config.application.IS_PYTHONW", False) +    config = Application().get_default_logging_config() +    assert "handlers" in config +    assert "loggers" in config + +  @pytest.fixture  def caplogconfig(monkeypatch):      """Capture logging config events for DictConfigurator objects. @@ -827,6 +840,7 @@ def caplogconfig(monkeypatch):      return calls [email protected](sys.implementation.name == "pypy", reason="Test does not work on pypy")  def test_logging_teardown_on_error(capsys, caplogconfig):      """Ensure we don't try to open logs in order to close them (See #722). diff --git a/contrib/python/traitlets/py3/traitlets/tests/test_traitlets.py b/contrib/python/traitlets/py3/traitlets/tests/test_traitlets.py index 4b145afd029..db9250d3d2b 100644 --- a/contrib/python/traitlets/py3/traitlets/tests/test_traitlets.py +++ b/contrib/python/traitlets/py3/traitlets/tests/test_traitlets.py @@ -56,6 +56,7 @@ from traitlets import (      link,      observe,      observe_compat, +    traitlets,      validate,  )  from traitlets.utils import cast_unicode @@ -3133,3 +3134,17 @@ def test_object_from_string(s, expected):  )  def test_tcp_from_string(s, expected):      _from_string_test(TCPAddress, s, expected) + + +def test_all_attribute(): +    """Verify all trait types are added to `traitlets.__all__`""" +    names = dir(traitlets) +    for name in names: +        value = getattr(traitlets, name) +        if not name.startswith("_") and isinstance(value, type) and issubclass(value, TraitType): +            if name not in traitlets.__all__: +                raise ValueError(f"{name} not in __all__") + +    for name in traitlets.__all__: +        if name not in names: +            raise ValueError(f"{name} should be removed from __all__") diff --git a/contrib/python/traitlets/py3/traitlets/traitlets.py b/contrib/python/traitlets/py3/traitlets/traitlets.py index 0927222163b..0eae5d19595 100644 --- a/contrib/python/traitlets/py3/traitlets/traitlets.py +++ b/contrib/python/traitlets/py3/traitlets/traitlets.py @@ -74,6 +74,7 @@ __all__ = [      "CComplex",      "CFloat",      "CInt", +    "CLong",      "CRegExp",      "CUnicode",      "Callable", @@ -95,7 +96,9 @@ __all__ = [      "HasTraits",      "Instance",      "Int", +    "Integer",      "List", +    "Long",      "MetaHasDescriptors",      "MetaHasTraits",      "ObjectName", @@ -3455,16 +3458,3 @@ class Callable(TraitType):              return value          else:              self.error(obj, value) - - -def _add_all(): -    """add all trait types to `__all__` - -    do in a function to avoid iterating through globals while defining local variables -    """ -    for _name, _value in globals().items(): -        if not _name.startswith("_") and isinstance(_value, type) and issubclass(_value, TraitType): -            __all__.append(_name) - - -_add_all()  | 
