diff -Nru python-swiftclient-4.4.0/.mailmap python-swiftclient-4.5.0/.mailmap --- python-swiftclient-4.4.0/.mailmap 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/.mailmap 2024-02-29 13:12:56.000000000 +0000 @@ -97,3 +97,4 @@ Flavio Percoco Timur Alperovich Thiago da Silva +DavHau diff -Nru python-swiftclient-4.4.0/.zuul.yaml python-swiftclient-4.5.0/.zuul.yaml --- python-swiftclient-4.4.0/.zuul.yaml 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/.zuul.yaml 2024-02-29 13:12:56.000000000 +0000 @@ -37,14 +37,24 @@ - publish-openstack-docs-pti - release-notes-jobs-python3 experimental: - # on-demand pipeline used to test older (but still supported) versions of python + # on-demand pipeline used to test older (but still supported) versions of python, + # as well as intermediate releases that the openstack-python3-jobs might skip jobs: - openstack-tox-py36 - openstack-tox-py37 + - openstack-tox-py39 + - openstack-tox-py310 check: jobs: - - swiftclient-swift-functional - - swiftclient-functional + - swiftclient-functional: + irrelevant-files: &functest-irrelevant-files + - ^(doc|releasenotes)/.*$ + - ^test/unit/.*$ + - ^(.gitreview|.mailmap|AUTHORS|ChangeLog|.*\.rst)$ + - swiftclient-swift-functional: + irrelevant-files: *functest-irrelevant-files + - tempest-full-py3: + irrelevant-files: *functest-irrelevant-files - openstack-tox-py311: voting: true gate: diff -Nru python-swiftclient-4.4.0/AUTHORS python-swiftclient-4.5.0/AUTHORS --- python-swiftclient-4.4.0/AUTHORS 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/AUTHORS 2024-02-29 13:12:56.000000000 +0000 @@ -30,6 +30,7 @@ Dan Prince (dprince@redhat.com) Daniel Wakefield (daniel.wakefield@hp.com) Darrell Bishop (darrell@swiftstack.com) +DavHau (hsngrmpf@gmail.com) David Goetz (david.goetz@rackspace.com) David Kranz (david.kranz@qrclab.com) David Shrewsbury (shrewsbury.dave@gmail.com) diff -Nru python-swiftclient-4.4.0/ChangeLog python-swiftclient-4.5.0/ChangeLog --- python-swiftclient-4.4.0/ChangeLog 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/ChangeLog 2024-02-29 13:12:56.000000000 +0000 @@ -1,3 +1,15 @@ +4.5.0 +----- + +* `swift stat --lh` now prints account quotas (including per-policy quotas) + in human-readable units, similar to account usage values. + +* Modernized some aspects of packaging, allowing wheels to be built with more + (and more recent) tools. + +* Various other minor bug fixes and improvements. + + 4.4.0 ----- diff -Nru python-swiftclient-4.4.0/PKG-INFO python-swiftclient-4.5.0/PKG-INFO --- python-swiftclient-4.4.0/PKG-INFO 2023-09-01 13:39:15.668769100 +0000 +++ python-swiftclient-4.5.0/PKG-INFO 2024-02-29 13:13:51.965757000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: python-swiftclient -Version: 4.4.0 +Version: 4.5.0 Summary: OpenStack Object Storage API Client Library Home-page: https://docs.openstack.org/python-swiftclient/latest/ Author: OpenStack diff -Nru python-swiftclient-4.4.0/debian/changelog python-swiftclient-4.5.0/debian/changelog --- python-swiftclient-4.4.0/debian/changelog 2023-09-05 19:31:03.000000000 +0000 +++ python-swiftclient-4.5.0/debian/changelog 2024-03-11 12:05:46.000000000 +0000 @@ -1,3 +1,14 @@ +python-swiftclient (1:4.5.0-0ubuntu1) noble; urgency=medium + + [ Corey Bryant ] + * d/gbp.conf, .launchpad.yaml: Sync from cloud-archive-tools for + caracal. + + [ James Page ] + * New upstream release for OpenStack Caracal. + + -- James Page Mon, 11 Mar 2024 12:05:46 +0000 + python-swiftclient (1:4.4.0-0ubuntu1) mantic; urgency=medium * New upstream release for OpenStack Bobcat. diff -Nru python-swiftclient-4.4.0/pyproject.toml python-swiftclient-4.5.0/pyproject.toml --- python-swiftclient-4.4.0/pyproject.toml 1970-01-01 00:00:00.000000000 +0000 +++ python-swiftclient-4.5.0/pyproject.toml 2024-02-29 13:12:56.000000000 +0000 @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "pbr"] +build-backend = "setuptools.build_meta" diff -Nru python-swiftclient-4.4.0/python_swiftclient.egg-info/PKG-INFO python-swiftclient-4.5.0/python_swiftclient.egg-info/PKG-INFO --- python-swiftclient-4.4.0/python_swiftclient.egg-info/PKG-INFO 2023-09-01 13:39:15.000000000 +0000 +++ python-swiftclient-4.5.0/python_swiftclient.egg-info/PKG-INFO 2024-02-29 13:13:51.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: python-swiftclient -Version: 4.4.0 +Version: 4.5.0 Summary: OpenStack Object Storage API Client Library Home-page: https://docs.openstack.org/python-swiftclient/latest/ Author: OpenStack diff -Nru python-swiftclient-4.4.0/python_swiftclient.egg-info/SOURCES.txt python-swiftclient-4.5.0/python_swiftclient.egg-info/SOURCES.txt --- python-swiftclient-4.4.0/python_swiftclient.egg-info/SOURCES.txt 2023-09-01 13:39:15.000000000 +0000 +++ python-swiftclient-4.5.0/python_swiftclient.egg-info/SOURCES.txt 2024-02-29 13:13:51.000000000 +0000 @@ -11,6 +11,7 @@ LICENSE MANIFEST.in README.rst +pyproject.toml requirements.txt run_tests.sh setup.cfg @@ -58,7 +59,9 @@ releasenotes/notes/3_9_0_release-3c293d277f14ec22.yaml releasenotes/notes/4_3_0_release.yaml releasenotes/notes/4_4_0_release-d731bab5982c160b.yaml +releasenotes/notes/4_5_0_release-b315d25b889293f2.yaml releasenotes/source/2023.1.rst +releasenotes/source/2023.2.rst releasenotes/source/conf.py releasenotes/source/current.rst releasenotes/source/index.rst diff -Nru python-swiftclient-4.4.0/python_swiftclient.egg-info/pbr.json python-swiftclient-4.5.0/python_swiftclient.egg-info/pbr.json --- python-swiftclient-4.4.0/python_swiftclient.egg-info/pbr.json 2023-09-01 13:39:15.000000000 +0000 +++ python-swiftclient-4.5.0/python_swiftclient.egg-info/pbr.json 2024-02-29 13:13:51.000000000 +0000 @@ -1 +1 @@ -{"git_version": "54fbfa8", "is_release": true} \ No newline at end of file +{"git_version": "27171d9", "is_release": true} \ No newline at end of file diff -Nru python-swiftclient-4.4.0/python_swiftclient.egg-info/requires.txt python-swiftclient-4.5.0/python_swiftclient.egg-info/requires.txt --- python-swiftclient-4.4.0/python_swiftclient.egg-info/requires.txt 2023-09-01 13:39:15.000000000 +0000 +++ python-swiftclient-4.5.0/python_swiftclient.egg-info/requires.txt 2024-02-29 13:13:51.000000000 +0000 @@ -5,7 +5,8 @@ [test] coverage!=4.4,>=4.0 -hacking<3.3.0,>=3.2.0 +hacking<6.2.0,>=3.2.0 keystoneauth1>=3.4.0 openstacksdk>=0.11.0 +python-keystoneclient>=0.7.0 stestr!=3.0.0,>=2.0.0 diff -Nru python-swiftclient-4.4.0/releasenotes/notes/4_5_0_release-b315d25b889293f2.yaml python-swiftclient-4.5.0/releasenotes/notes/4_5_0_release-b315d25b889293f2.yaml --- python-swiftclient-4.4.0/releasenotes/notes/4_5_0_release-b315d25b889293f2.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-swiftclient-4.5.0/releasenotes/notes/4_5_0_release-b315d25b889293f2.yaml 2024-02-29 13:12:56.000000000 +0000 @@ -0,0 +1,12 @@ +--- +features: + - | + ``swift stat --lh`` now prints account quotas (including per-policy quotas) + in human-readable units, similar to account usage values. + + - | + Modernized some aspects of packaging, allowing wheels to be built with more + (and more recent) tools. +fixes: + - | + Various other minor bug fixes and improvements. diff -Nru python-swiftclient-4.4.0/releasenotes/source/2023.2.rst python-swiftclient-4.5.0/releasenotes/source/2023.2.rst --- python-swiftclient-4.4.0/releasenotes/source/2023.2.rst 1970-01-01 00:00:00.000000000 +0000 +++ python-swiftclient-4.5.0/releasenotes/source/2023.2.rst 2024-02-29 13:12:56.000000000 +0000 @@ -0,0 +1,6 @@ +=========================== +2023.2 Series Release Notes +=========================== + +.. release-notes:: + :branch: stable/2023.2 diff -Nru python-swiftclient-4.4.0/releasenotes/source/index.rst python-swiftclient-4.5.0/releasenotes/source/index.rst --- python-swiftclient-4.4.0/releasenotes/source/index.rst 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/releasenotes/source/index.rst 2024-02-29 13:12:56.000000000 +0000 @@ -6,6 +6,7 @@ :maxdepth: 1 current + 2023.2 2023.1 zed yoga diff -Nru python-swiftclient-4.4.0/releasenotes/source/yoga.rst python-swiftclient-4.5.0/releasenotes/source/yoga.rst --- python-swiftclient-4.4.0/releasenotes/source/yoga.rst 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/releasenotes/source/yoga.rst 2024-02-29 13:12:56.000000000 +0000 @@ -3,4 +3,4 @@ ========================= .. release-notes:: - :branch: stable/yoga + :branch: unmaintained/yoga diff -Nru python-swiftclient-4.4.0/setup.cfg python-swiftclient-4.5.0/setup.cfg --- python-swiftclient-4.4.0/setup.cfg 2023-09-01 13:39:15.668769100 +0000 +++ python-swiftclient-4.5.0/setup.cfg 2024-02-29 13:13:51.965757000 +0000 @@ -34,8 +34,6 @@ [files] packages = swiftclient -scripts = - bin/swift data_files = share/man/man1 = doc/manpages/swift.1 diff -Nru python-swiftclient-4.4.0/swiftclient/command_helpers.py python-swiftclient-4.5.0/swiftclient/command_helpers.py --- python-swiftclient-4.4.0/swiftclient/command_helpers.py 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/swiftclient/command_helpers.py 2024-02-29 13:12:56.000000000 +0000 @@ -15,6 +15,7 @@ POLICY_HEADER_PREFIX = 'x-account-storage-policy-' +PER_POLICY_QUOTA_HEADER_PREFIX = 'x-account-quota-bytes-policy-' def stat_account(conn, options): @@ -38,6 +39,10 @@ ('Objects', object_count), ('Bytes', bytes_used), ]) + if headers.get('x-account-meta-quota-bytes'): + quota_bytes = prt_bytes(headers.get('x-account-meta-quota-bytes'), + options['human']).lstrip() + items.append(('Quota Bytes', quota_bytes)) policies = set() for header_key, header_value in headers.items(): @@ -68,6 +73,10 @@ options['human'] ).lstrip()), )) + policy_quota = headers.get(PER_POLICY_QUOTA_HEADER_PREFIX + policy) + if policy_quota: + items.append(('Quota Bytes for policy "' + policy + '"', + prt_bytes(policy_quota, options['human']).lstrip())) return items, headers @@ -75,7 +84,10 @@ def print_account_stats(items, headers, output_manager): exclude_policy_headers = [] for header_key, header_value in headers.items(): - if header_key.lower().startswith(POLICY_HEADER_PREFIX): + if header_key.lower().startswith(( + POLICY_HEADER_PREFIX, + PER_POLICY_QUOTA_HEADER_PREFIX, + )): exclude_policy_headers.append(header_key) items.extend(headers_to_items( @@ -84,7 +96,8 @@ 'content-length', 'date', 'x-account-container-count', 'x-account-object-count', - 'x-account-bytes-used'] + exclude_policy_headers))) + 'x-account-bytes-used', + 'x-account-meta-quota-bytes'] + exclude_policy_headers))) # line up the items nicely offset = max(len(item) for item, value in items) diff -Nru python-swiftclient-4.4.0/swiftclient/shell.py python-swiftclient-4.5.0/swiftclient/shell.py --- python-swiftclient-4.4.0/swiftclient/shell.py 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/swiftclient/shell.py 2024-02-29 13:12:56.000000000 +0000 @@ -754,7 +754,7 @@ items, headers, output_manager ) else: - raise(stat_result["error"]) + raise stat_result["error"] else: output_manager.error( 'Usage: %s stat %s\n%s', BASENAME, @@ -768,7 +768,7 @@ [--sync-key ] [--meta ] [--header
] [ []] -''' +''' # noqa st_post_help = ''' Updates meta information for the account, container, or object. @@ -864,7 +864,7 @@ else: result = swift.post(container=container) if not result["success"]: - raise(result["error"]) + raise result["error"] except SwiftError as e: output_manager.error(e.value) @@ -1520,7 +1520,7 @@ Optional positional arguments: Swift client command to filter the flags by. -'''.strip('\n') +'''.strip('\n') # noqa st_bash_completion_options = '''[command] diff -Nru python-swiftclient-4.4.0/test/unit/test_authv1.py python-swiftclient-4.5.0/test/unit/test_authv1.py --- python-swiftclient-4.4.0/test/unit/test_authv1.py 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/test/unit/test_authv1.py 2024-02-29 13:12:56.000000000 +0000 @@ -16,10 +16,13 @@ import json import unittest from unittest import mock -from keystoneauth1 import plugin -from keystoneauth1 import loading -from keystoneauth1 import exceptions -from swiftclient import authv1 +try: + from keystoneauth1 import plugin + from keystoneauth1 import loading + from keystoneauth1 import exceptions + from swiftclient import authv1 +except ImportError: + plugin = loading = exceptions = authv1 = None class TestDataNoAccount: @@ -44,6 +47,10 @@ class TestPluginLoading(TestDataNoAccount, unittest.TestCase): + def setUp(self): + if authv1 is None: + raise unittest.SkipTest('keystoneauth1 is not available') + def test_can_load(self): loader = loading.get_plugin_loader('v1password') self.assertIsInstance(loader, authv1.PasswordLoader) @@ -120,6 +127,8 @@ class TestPlugin(TestDataNoAccount, unittest.TestCase): def setUp(self): + if authv1 is None: + raise unittest.SkipTest('keystoneauth1 is not available') self.mock_session = mock.MagicMock() self.mock_response = self.mock_session.get.return_value self.mock_response.status_code = 200 diff -Nru python-swiftclient-4.4.0/test/unit/test_service.py python-swiftclient-4.5.0/test/unit/test_service.py --- python-swiftclient-4.4.0/test/unit/test_service.py 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/test/unit/test_service.py 2024-02-29 13:12:56.000000000 +0000 @@ -1330,7 +1330,7 @@ options) responses = [x for x in resp_iter] for resp in responses: - self.assertFalse('error' in resp) + self.assertNotIn('error', resp) self.assertTrue(resp['success']) self.assertEqual(5, len(responses)) container_resp, segment_container_resp = responses[0:2] diff -Nru python-swiftclient-4.4.0/test/unit/test_shell.py python-swiftclient-4.5.0/test/unit/test_shell.py --- python-swiftclient-4.4.0/test/unit/test_shell.py 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/test/unit/test_shell.py 2024-02-29 13:12:56.000000000 +0000 @@ -160,6 +160,34 @@ ' Bytes: 3\n') @mock.patch('swiftclient.service.Connection') + def test_stat_account_with_quota(self, connection): + argv = ["", "stat", "--lh"] + return_headers = { + 'x-account-container-count': '2000', + 'x-account-object-count': '3000', + 'x-account-bytes-used': '4000000', + 'x-account-storage-policy-gold-bytes-used': '4000', + 'x-account-meta-quota-bytes': '5000000', + 'x-account-quota-bytes-policy-gold': '5000', + 'content-length': 0, + 'date': ''} + connection.return_value.head_account.return_value = return_headers + connection.return_value.url = 'http://127.0.0.1/v1/AUTH_account' + with CaptureOutput() as output: + swiftclient.shell.main(argv) + + self.assertEqual( + output.out, + ' Account: AUTH_account\n' + ' Containers: 2000\n' + ' Objects: 2.9K\n' + ' Bytes: 3.8M\n' + ' Quota Bytes: 4.8M\n' + ' Objects in policy "gold": 0\n' + ' Bytes in policy "gold": 3.9K\n' + 'Quota Bytes for policy "gold": 4.9K\n') + + @mock.patch('swiftclient.service.Connection') def test_stat_account_with_headers(self, connection): argv = ["", "stat", "-H", "Skip-Middleware: Test"] return_headers = { @@ -711,7 +739,7 @@ @mock.patch('swiftclient.service.Connection') def test_download_shuffle(self, connection, mock_shuffle): # Test that the container and object lists are shuffled - mock_shuffle.side_effect = lambda l: l + mock_shuffle.side_effect = lambda to_shuffle: to_shuffle connection.return_value.get_object.return_value = [ {'content-type': 'text/plain', 'etag': EMPTY_ETAG}, @@ -867,12 +895,13 @@ fh.write(b'12345678901234567890') swiftclient.shell.main(argv) expected_calls = [mock.call('container', - {'X-Storage-Policy': mock.ANY}, + {'X-Storage-Policy': 'one'}, response_dict={}), mock.call('container_segments', - {'X-Storage-Policy': mock.ANY}, + {'X-Storage-Policy': 'one'}, response_dict={})] - connection.return_value.put_container.has_calls(expected_calls) + connection.return_value.put_container.assert_has_calls(expected_calls, + any_order=True) connection.return_value.put_object.assert_called_with( 'container', self.tmpfile.lstrip('/'), diff -Nru python-swiftclient-4.4.0/test/unit/test_swiftclient.py python-swiftclient-4.5.0/test/unit/test_swiftclient.py --- python-swiftclient-4.4.0/test/unit/test_swiftclient.py 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/test/unit/test_swiftclient.py 2024-02-29 13:12:56.000000000 +0000 @@ -579,7 +579,10 @@ self.assertTrue(token) def test_auth_v3applicationcredential(self): - from keystoneauth1 import exceptions as ksauthexceptions + try: + from keystoneauth1 import exceptions as ksauthexceptions + except ImportError: + raise unittest.SkipTest('keystoneauth1 is not available') os_options = { "auth_type": "v3applicationcredential", @@ -1997,7 +2000,7 @@ 'authurl': 'http://www.test.com', 'tenant_name': 'atenant'} conn = c.Connection(**args) - self.assertEqual(type(conn), c.Connection) + self.assertIsInstance(conn, c.Connection) def test_instance_kwargs_token(self): args = {'preauthtoken': 'atoken123', @@ -3053,7 +3056,7 @@ conn = c.Connection(url, 'asdf', 'asdf') self.assertIsNone(conn.http_conn) conn.http_conn = c.http_connection(url) - self.assertEqual(type(conn.http_conn), tuple) + self.assertIsInstance(conn.http_conn, tuple) self.assertEqual(len(conn.http_conn), 2) http_conn_obj = conn.http_conn[1] self.assertIsInstance(http_conn_obj, c.HTTPConnection) diff -Nru python-swiftclient-4.4.0/test-requirements.txt python-swiftclient-4.5.0/test-requirements.txt --- python-swiftclient-4.4.0/test-requirements.txt 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/test-requirements.txt 2024-02-29 13:12:56.000000000 +0000 @@ -1,6 +1,7 @@ -hacking>=3.2.0,<3.3.0 # Apache-2.0 +hacking>=3.2.0,<6.2.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 +python-keystoneclient>=0.7.0 keystoneauth1>=3.4.0 # Apache-2.0 stestr>=2.0.0,!=3.0.0 # Apache-2.0 openstacksdk>=0.11.0 # Apache-2.0 diff -Nru python-swiftclient-4.4.0/tox.ini python-swiftclient-4.5.0/tox.ini --- python-swiftclient-4.4.0/tox.ini 2023-09-01 13:38:49.000000000 +0000 +++ python-swiftclient-4.5.0/tox.ini 2024-02-29 13:12:56.000000000 +0000 @@ -1,18 +1,18 @@ [tox] envlist = py3,pep8 minversion = 3.18.0 -skipsdist = True [testenv] +skipsdist = True usedevelop = True list_dependencies_command = python -m pip freeze setenv = LANG=en_US.utf-8 VIRTUAL_ENV={envdir} -deps = -r{toxinidir}/requirements.txt +deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt - .[keystone] commands = sh -c '(find . -not \( -type d -name .?\* -prune \) \ \( -type d -name "__pycache__" -or -type f -name "*.py[co]" \) \ -print0) | xargs -0 rm -rf' @@ -24,6 +24,12 @@ commands = python -m flake8 swiftclient test +[testenv:{py36,py37}] +# Drop the use of constraints; most dependencies have dropped support for +# these versions already, and have updated their metadata to reflect that +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + [testenv:venv] commands = {posargs} @@ -69,7 +75,8 @@ # H404: multi line docstring should start without a leading new line # H405: multi line docstring summary not separated with an empty line # W504: line break after binary operator -ignore = H101,H301,H306,H401,H403,H404,H405,W504 +# F811: Redefinition of unused name from line n +ignore = H101,H301,H306,H401,H403,H404,H405,W504,F811 # H106: Don’t put vim configuration in source files # H203: Use assertIs(Not)None to check for None enable-extensions=H106,H203 @@ -87,8 +94,7 @@ [testenv:releasenotes] usedevelop = False -deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} - -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:pdf-docs]