Merge ~maxiberta/snapstore-client:craft-store-2.1.1 into snapstore-client:master

Proposed by Maximiliano Bertacchini
Status: Merged
Approved by: Maximiliano Bertacchini
Approved revision: 7100ea8d8cece14cb7dd33a919686ab76b84dc57
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~maxiberta/snapstore-client:craft-store-2.1.1
Merge into: snapstore-client:master
Diff against target: 229 lines (+35/-48)
4 files modified
Makefile (+4/-0)
requirements-dev.txt (+20/-28)
requirements.txt (+10/-10)
store_admin/logic/http_client.py (+1/-10)
Reviewer Review Type Date Requested Status
Przemysław Suliga Approve
Review via email: mp+424908@code.launchpad.net

Commit message

Update craft-store to 2.1.1

Drop in-memory keyring hack now that craft-store supports ephemeral logins

To post a comment you must log in.
Revision history for this message
Przemysław Suliga (suligap) wrote :

+1 thanks!

review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/Makefile b/Makefile
index 4649c33..1dc8c9f 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,10 @@ SNAPCRAFT_FLAGS ?= --use-lxd --enable-manifest
15$(OLS_WHEELS_DIR):15$(OLS_WHEELS_DIR):
16 git clone $(DEPENDENCY_REPO) $(OLS_WHEELS_DIR)16 git clone $(DEPENDENCY_REPO) $(OLS_WHEELS_DIR)
1717
18.PHONY: update-dependencies
19update-dependencies: $(OLS_WHEELS_DIR)
20 cd $(OLS_WHEELS_DIR) && git pull
21
18$(ENV)/prod: | $(OLS_WHEELS_DIR)22$(ENV)/prod: | $(OLS_WHEELS_DIR)
19 virtualenv $(ENV) 23 virtualenv $(ENV)
20 $(PIP) install -f $(OLS_WHEELS_DIR) --no-index -r requirements.txt24 $(PIP) install -f $(OLS_WHEELS_DIR) --no-index -r requirements.txt
diff --git a/requirements-dev.txt b/requirements-dev.txt
index c80f7c8..afda69f 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,18 +1,18 @@
1acceptable==0.311acceptable==0.32
2 # via -r requirements-dev.in2 # via -r requirements-dev.in
3attrs==21.2.03attrs==21.4.0
4 # via4 # via
5 # jsonschema5 # jsonschema
6 # pytest6 # pytest
7black==22.1.07black==22.3.0
8 # via -r requirements-dev.in8 # via -r requirements-dev.in
9certifi==2021.10.89certifi==2021.10.8
10 # via requests10 # via requests
11charset-normalizer==2.0.711charset-normalizer==2.0.12
12 # via requests12 # via requests
13click==8.0.313click==8.1.3
14 # via black14 # via black
15coverage[toml]==6.3.115coverage[toml]==6.3.2
16 # via16 # via
17 # -r requirements-dev.in17 # -r requirements-dev.in
18 # pytest-cov18 # pytest-cov
@@ -20,35 +20,33 @@ execnet==1.9.0
20 # via pytest-xdist20 # via pytest-xdist
21extras==1.0.021extras==1.0.0
22 # via testtools22 # via testtools
23fixtures==3.0.023fixtures==4.0.0
24 # via testtools24 # via testtools
25flake8==4.0.125flake8==4.0.1
26 # via -r requirements-dev.in26 # via -r requirements-dev.in
27idna==3.327idna==3.3
28 # via requests28 # via requests
29importlib-resources==5.7.1
30 # via jsonschema
29iniconfig==1.1.131iniconfig==1.1.1
30 # via pytest32 # via pytest
31jinja2==3.0.233jsonschema==4.5.1
32 # via acceptable
33jsonschema==3.2.0
34 # via acceptable34 # via acceptable
35markupsafe==2.0.1
36 # via jinja2
37mccabe==0.6.135mccabe==0.6.1
38 # via flake836 # via flake8
39mypy-extensions==0.4.337mypy-extensions==0.4.3
40 # via black38 # via black
41packaging==21.039packaging==21.3
42 # via40 # via
43 # pytest41 # pytest
44 # pytest-sugar42 # pytest-sugar
45pathspec==0.9.043pathspec==0.9.0
46 # via black44 # via black
47pbr==5.6.045pbr==5.9.0
48 # via46 # via
49 # fixtures47 # fixtures
50 # testtools48 # testtools
51platformdirs==2.4.049platformdirs==2.5.2
52 # via black50 # via black
53pluggy==1.0.051pluggy==1.0.0
54 # via pytest52 # via pytest
@@ -62,7 +60,7 @@ pyflakes==2.4.0
62 # via flake860 # via flake8
63pyparsing==2.4.761pyparsing==2.4.7
64 # via packaging62 # via packaging
65pyrsistent==0.18.063pyrsistent==0.18.1
66 # via jsonschema64 # via jsonschema
67pytest==7.0.065pytest==7.0.0
68 # via66 # via
@@ -81,32 +79,26 @@ pytest-xdist==2.5.0
81 # via -r requirements-dev.in79 # via -r requirements-dev.in
82pyyaml==6.080pyyaml==6.0
83 # via acceptable81 # via acceptable
84requests==2.26.082requests==2.27.1
85 # via responses83 # via responses
86responses==0.20.084responses==0.20.0
87 # via -r requirements-dev.in85 # via -r requirements-dev.in
88six==1.16.0
89 # via
90 # fixtures
91 # jsonschema
92termcolor==1.1.086termcolor==1.1.0
93 # via pytest-sugar87 # via pytest-sugar
94testtools==2.5.088testtools==2.5.0
95 # via89 # via
96 # -r requirements-dev.in90 # -r requirements-dev.in
97 # fixtures91 # fixtures
98tomli==1.2.192tomli==2.0.1
99 # via93 # via
100 # black94 # black
101 # coverage95 # coverage
102 # pytest96 # pytest
103typing-extensions==3.10.0.297typing-extensions==4.2.0
104 # via black98 # via black
105urllib3==1.26.799urllib3==1.26.9
106 # via100 # via
107 # requests101 # requests
108 # responses102 # responses
109103zipp==3.8.0
110# The following packages are considered to be unsafe in a requirements file:104 # via importlib-resources
111setuptools==58.3.0
112 # via jsonschema
diff --git a/requirements.txt b/requirements.txt
index e4a1975..da1b653 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,17 +4,17 @@ cffi==1.15.0
4 # via4 # via
5 # cryptography5 # cryptography
6 # pynacl6 # pynacl
7charset-normalizer==2.0.77charset-normalizer==2.0.12
8 # via requests8 # via requests
9click==8.0.39click==8.1.3
10 # via -r requirements.in10 # via -r requirements.in
11craft-store==2.0.111craft-store==2.1.1
12 # via -r requirements.in12 # via -r requirements.in
13cryptography==35.0.013cryptography==36.0.2
14 # via secretstorage14 # via secretstorage
15idna==3.315idna==3.3
16 # via requests16 # via requests
17importlib-metadata==4.8.117importlib-metadata==4.11.3
18 # via keyring18 # via keyring
19jeepney==0.7.119jeepney==0.7.1
20 # via20 # via
@@ -28,7 +28,7 @@ overrides==6.1.0
28 # via craft-store28 # via craft-store
29protobuf==3.18.129protobuf==3.18.1
30 # via macaroonbakery30 # via macaroonbakery
31pycparser==2.2031pycparser==2.21
32 # via cffi32 # via cffi
33pydantic==1.9.033pydantic==1.9.0
34 # via craft-store34 # via craft-store
@@ -48,7 +48,7 @@ pytz==2021.3
48 # via pyrfc333948 # via pyrfc3339
49pyxdg==0.2649pyxdg==0.26
50 # via -r requirements.in50 # via -r requirements.in
51requests==2.26.051requests==2.27.1
52 # via52 # via
53 # -r requirements.in53 # -r requirements.in
54 # craft-store54 # craft-store
@@ -63,11 +63,11 @@ six==1.16.0
63 # macaroonbakery63 # macaroonbakery
64 # pymacaroons64 # pymacaroons
65 # pynacl65 # pynacl
66typing-extensions==3.10.0.266typing-extensions==4.2.0
67 # via pydantic67 # via pydantic
68typing-utils==0.1.068typing-utils==0.1.0
69 # via overrides69 # via overrides
70urllib3==1.26.770urllib3==1.26.9
71 # via requests71 # via requests
72zipp==3.5.072zipp==3.8.0
73 # via importlib-metadata73 # via importlib-metadata
diff --git a/store_admin/logic/http_client.py b/store_admin/logic/http_client.py
index 15b80b2..067f9c8 100644
--- a/store_admin/logic/http_client.py
+++ b/store_admin/logic/http_client.py
@@ -2,8 +2,6 @@
2# Copyright 2022 Canonical Ltd. This software is licensed under the2# Copyright 2022 Canonical Ltd. This software is licensed under the
3# GNU General Public License version 3 (see the file LICENSE).3# GNU General Public License version 3 (see the file LICENSE).
44
5import os
6
7import requests5import requests
8from requests.adapters import HTTPAdapter, Retry6from requests.adapters import HTTPAdapter, Retry
9from craft_store import Auth, StoreClient, endpoints7from craft_store import Auth, StoreClient, endpoints
@@ -37,21 +35,14 @@ def get_session(unique=False):
3735
3836
39def get_store_client(base_url):37def get_store_client(base_url):
40 env_auth_key = "__snap_store_auth"
41 # Ugly workaround for craft-store not allowing to use an in-memory keyring
42 # without using an environment variable for "storing" existing credentials.
43 os.environ[env_auth_key] = os.getenv(env_auth_key) or "-"
44
45 store_client = StoreClient(38 store_client = StoreClient(
46 base_url=base_url,39 base_url=base_url,
47 storage_base_url="", # No uploads expected.40 storage_base_url="", # No uploads expected.
48 endpoints=endpoints.SNAP_STORE, # SCA.41 endpoints=endpoints.SNAP_STORE, # SCA.
49 user_agent=USER_AGENT,42 user_agent=USER_AGENT,
50 application_name=APP_NAME,43 application_name=APP_NAME,
51 environment_auth=env_auth_key,44 ephemeral=True,
52 )45 )
53
54 store_client.logout()
55 return store_client46 return store_client
5647
5748

Subscribers

People subscribed via source and target branches

to all changes: