Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/pylint
rev: v2.15.8
rev: v3.3.3
hooks:
- id: pylint
2 changes: 1 addition & 1 deletion scripts/shopify_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def add(cls, connection):
if os.path.exists(filename):
raise ConfigFileError("There is already a config file at " + filename)
else:
config = dict(protocol="https")
config = {"protocol": "https"}
domain = input("Domain? (leave blank for %s.myshopify.com) " % (connection))
if not domain.strip():
domain = "%s.myshopify.com" % (connection)
Expand Down
1 change: 0 additions & 1 deletion shopify/api_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class ApiAccessError(Exception):


class ApiAccess:

SCOPE_DELIMITER = ","
SCOPE_RE = re.compile(r"\A(?P<unauthenticated>unauthenticated_)?(write|read)_(?P<resource>.*)\Z")
IMPLIED_SCOPE_RE = re.compile(r"\A(?P<unauthenticated>unauthenticated_)?write_(?P<resource>.*)\Z")
Expand Down
2 changes: 1 addition & 1 deletion shopify/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def add_metafield(self, metafield):
if self.is_new():
raise ValueError("You can only add metafields to a resource that has been saved")

metafield._prefix_options = dict(resource=self.__class__.plural, resource_id=self.id)
metafield._prefix_options = {"resource": self.__class__.plural, "resource_id": self.id}
metafield.save()
return metafield

Expand Down
4 changes: 2 additions & 2 deletions shopify/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, shop_url, version=None, token=None, access_scopes=None):
return

def create_permission_url(self, scope, redirect_uri, state=None):
query_params = dict(client_id=self.api_key, scope=",".join(scope), redirect_uri=redirect_uri)
query_params = {"client_id": self.api_key, "scope": ",".join(scope), "redirect_uri": redirect_uri}
if state:
query_params["state"] = state
return "https://%s/admin/oauth/authorize?%s" % (self.url, urllib.parse.urlencode(query_params))
Expand All @@ -69,7 +69,7 @@ def request_token(self, params):
code = params["code"]

url = "https://%s/admin/oauth/access_token?" % self.url
query_params = dict(client_id=self.api_key, client_secret=self.secret, code=code)
query_params = {"client_id": self.api_key, "client_secret": self.secret, "code": code}
request = urllib.request.Request(url, urllib.parse.urlencode(query_params).encode("utf-8"))
response = urllib.request.urlopen(request)

Expand Down
Loading