From 63d37de394fd23b5fb518e70529f58a38acbdda4 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Wed, 2 Oct 2024 17:36:44 -0400 Subject: [PATCH 1/5] fix: determine version better in setup.py --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index c9665cbf3..dd04022e4 100755 --- a/setup.py +++ b/setup.py @@ -34,6 +34,11 @@ def determine_version(): 0ae7c04 This was copied from tools/version.py to fix #1472 """ + import charmcraft + version = charmcraft.__version__ + + if version != "devel": + return version desc = ( subprocess.run( ["git", "describe", "--always", "--long"], @@ -79,9 +84,6 @@ def determine_version(): "requests-unixsocket", "snap-helpers", "tabulate", - # Needed until requests-unixsocket supports urllib3 v2 - # https://github.com/msabramo/requests-unixsocket/pull/69 - "urllib3<2.0", ] lint_requires = [ From e6afa1c8f90fe6e39cd3000f6a7a3f4c502ff10a Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Wed, 2 Oct 2024 17:40:47 -0400 Subject: [PATCH 2/5] build(deps): update internal dependencies Indirectly updates requests, urllib3, and replaces requests-unixsocket with requests-unixsocket2 --- requirements-dev.txt | 10 +++++----- requirements.txt | 10 +++++----- setup.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1cfd136e7..c62b6f734 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -10,8 +10,8 @@ codespell==2.2.6 colorama==0.4.6 coverage==7.4.1 craft-cli==2.4.0 -craft-parts==1.25.2 -craft-providers==1.20.3 +craft-parts==1.25.3 +craft-providers==1.20.4 craft-store==2.5.0 cryptography==43.0.1 Deprecated==1.2.14 @@ -65,9 +65,9 @@ pytz==2023.3.post1 pyxdg==0.28 PyYAML==6.0.2 referencing==0.30.2 -requests==2.31.0 +requests==2.32.3 requests-toolbelt==1.0.0 -requests-unixsocket==0.3.0 +requests-unixsocket2==0.4.2 responses==0.24.1 rpds-py==0.10.6 ruff==0.1.15 @@ -85,7 +85,7 @@ types-setuptools==69.0.0.20240125 types-tabulate==0.9.0.20240106 types-urllib3==1.26.25.14 typing_extensions==4.8.0 -urllib3==1.26.18 +urllib3==2.2.3 virtualenv==20.25.0 wrapt==1.15.0 yamllint==1.32.0 diff --git a/requirements.txt b/requirements.txt index 81d869921..b6804de82 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,8 +3,8 @@ certifi==2023.7.22 cffi==1.16.0 charset-normalizer==3.3.2 craft-cli==2.4.0 -craft-parts==1.25.2 -craft-providers==1.20.3 +craft-parts==1.25.3 +craft-providers==1.20.4 craft-store==2.5.0 cryptography==43.0.1 Deprecated==1.2.14 @@ -36,9 +36,9 @@ pytz==2023.4 pyxdg==0.28 PyYAML==6.0.2 referencing==0.30.2 -requests==2.31.0 +requests==2.32.3 requests-toolbelt==1.0.0 -requests-unixsocket==0.3.0 +requests-unixsocket2==0.4.2 rpds-py==0.10.6 SecretStorage==3.3.3 six==1.16.0 @@ -47,6 +47,6 @@ tabulate==0.9.0 types-Deprecated==1.2.9.20240311 types-PyYAML==6.0.12.20240808 typing_extensions==4.8.0 -urllib3==1.26.18 +urllib3==2.2.3 wrapt==1.15.0 zipp==3.17.0 diff --git a/setup.py b/setup.py index dd04022e4..6573924af 100755 --- a/setup.py +++ b/setup.py @@ -81,7 +81,7 @@ def determine_version(): "pyyaml", "requests", "requests-toolbelt", - "requests-unixsocket", + "requests-unixsocket2", "snap-helpers", "tabulate", ] From 8a3d10b4b82110ea2a34e95ec652d62a59fa020d Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Thu, 3 Oct 2024 13:06:25 -0400 Subject: [PATCH 3/5] style: autoformat --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 6573924af..d9a1dc5c0 100755 --- a/setup.py +++ b/setup.py @@ -35,6 +35,7 @@ def determine_version(): This was copied from tools/version.py to fix #1472 """ import charmcraft + version = charmcraft.__version__ if version != "devel": From 98805d29809a28c1b8a894709c8c5ff76f0a6bba Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 4 Oct 2024 16:04:19 -0400 Subject: [PATCH 4/5] build(deps): stricter craft-providers dep --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d9a1dc5c0..3d5b7e655 100755 --- a/setup.py +++ b/setup.py @@ -71,7 +71,7 @@ def determine_version(): install_requires = [ "craft-cli>=2.3.0", "craft-parts>=1.18", - "craft-providers", + "craft-providers~=1.20.4", "craft-store>=2.4", "distro>=1.3.0", "humanize>=2.6.0", From 4b50d14d73dcb28449333b5dff1b3976c65785b3 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Mon, 7 Oct 2024 13:56:42 -0400 Subject: [PATCH 5/5] fix: test --- tests/commands/test_store_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/commands/test_store_registry.py b/tests/commands/test_store_registry.py index 50ca194b8..93bb1e621 100644 --- a/tests/commands/test_store_registry.py +++ b/tests/commands/test_store_registry.py @@ -906,7 +906,7 @@ def read(self, size): assert next(streamed) == b"12345" assert test_content._test_read_chunks == [chunk_size] assert next(streamed) == b"6789" - assert test_content._test_read_chunks == [chunk_size, chunk_size] + assert test_content._test_read_chunks == [chunk_size, chunk_size, chunk_size] with pytest.raises(StopIteration): next(streamed)