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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
args:
- "--fix=lf"
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.36.0
rev: 0.37.1
hooks:
- id: check-github-workflows
- id: check-readthedocs
Expand All @@ -22,7 +22,7 @@ repos:
- id: pyupgrade
args: ["--py39-plus"]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
rev: 26.3.1
hooks:
- id: black
name: "Autoformat python files"
Expand All @@ -41,7 +41,7 @@ repos:
- 'flake8-comprehensions==3.16.0'
- 'flake8-typing-as-t==1.0.0'
- repo: https://github.com/PyCQA/isort
rev: 7.0.0
rev: 8.0.1
hooks:
- id: isort
name: "Sort python imports"
Expand All @@ -54,7 +54,7 @@ repos:
hooks:
- id: slyp
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
rev: v2.4.2
hooks:
- id: codespell
args: ["--ignore-regex", "https://[^\\s]*"]
Expand All @@ -63,7 +63,7 @@ repos:
hooks:
- id: alphabetize-codeowners
- repo: https://github.com/rhysd/actionlint
rev: v1.7.10
rev: v1.7.12
hooks:
- id: actionlint
additional_dependencies:
Expand Down
1 change: 1 addition & 0 deletions changelog.d/check-version-is-new.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Check if the version number in the source is already present as a changelog header.
"""

import os
import re
import sys
Expand Down
1 change: 1 addition & 0 deletions changelog.d/update-pr-refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Meant to run in the context of a PR GitHub Actions workflow from the repo root
"""

import argparse
import glob
import json
Expand Down
2 changes: 1 addition & 1 deletion src/globus_sdk/globus_app/client_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ClientApp(GlobusApp):
"""

_login_client: ConfidentialAppAuthClient
_authorizer_factory: ClientCredentialsAuthorizerFactory # type:ignore
_authorizer_factory: ClientCredentialsAuthorizerFactory # type: ignore

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion src/globus_sdk/globus_app/user_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class UserApp(GlobusApp):
"""

_login_client: NativeAppAuthClient | ConfidentialAppAuthClient
_authorizer_factory: ( # type:ignore
_authorizer_factory: ( # type: ignore
AccessTokenAuthorizerFactory | RefreshTokenAuthorizerFactory
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,12 @@ def print_authorize_url(self, authorize_url: str) -> None:
application accesses.
"""
login_prompt = "Please authenticate with Globus here:"
print(
textwrap.dedent(
f"""
print(textwrap.dedent(f"""
{login_prompt}
{"-" * len(login_prompt)}
{authorize_url}
{"-" * len(login_prompt)}
"""
)
)
"""))

def prompt_for_code(self) -> str:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def create_child_client(
:param privacy_policy: URL of client's privacy policy.
:param required_idp: In order to use this client a user must have an identity
from this IdP in their identity set.
:param preselect_idp: This pre-selects the given IdP on the Globus Auth login
:param preselect_idp: This preselects the given IdP on the Globus Auth login
page if the user is not already authenticated.
:param additional_fields: Any additional parameters to be passed through.

Expand Down
4 changes: 2 additions & 2 deletions src/globus_sdk/services/auth/client/service_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ def create_client(
:param privacy_policy: URL of client's privacy policy.
:param required_idp: In order to use this client a user must have an identity
from this IdP in their identity set.
:param preselect_idp: This pre-selects the given IdP on the Globus Auth login
:param preselect_idp: This preselects the given IdP on the Globus Auth login
page if the user is not already authenticated.
:param additional_fields: Any additional parameters to be passed through.

Expand Down Expand Up @@ -1229,7 +1229,7 @@ def update_client(
:param privacy_policy: URL of client's privacy policy.
:param required_idp: In order to use this client a user must have an identity
from this IdP in their identity set.
:param preselect_idp: This pre-selects the given IdP on the Globus Auth login
:param preselect_idp: This preselects the given IdP on the Globus Auth login
page if the user is not already authenticated.
:param additional_fields: Any additional parameters to be passed through.

Expand Down
6 changes: 2 additions & 4 deletions src/globus_sdk/token_storage/legacy/sqlite_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ def _init_and_connect(
else:
conn = sqlite3.connect(self.dbname, **connect_params)
if init_tables:
conn.executescript(
"""
conn.executescript("""
CREATE TABLE config_storage (
namespace VARCHAR NOT NULL,
config_name VARCHAR NOT NULL,
Expand All @@ -87,8 +86,7 @@ def _init_and_connect(
value VARCHAR NOT NULL,
PRIMARY KEY (attribute)
);
"""
)
""")
# mark the version which was used to create the DB
# also mark the "database schema version" in case we ever need to handle
# graceful upgrades
Expand Down
8 changes: 2 additions & 6 deletions src/globus_sdk/token_storage/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ def _init_and_connect(
conn: sqlite3.Connection = sqlite3.connect(
self.filepath, **connect_params
)
conn.executescript(
textwrap.dedent(
"""
conn.executescript(textwrap.dedent("""
CREATE TABLE token_storage (
namespace VARCHAR NOT NULL,
resource_server VARCHAR NOT NULL,
Expand All @@ -69,9 +67,7 @@ def _init_and_connect(
value VARCHAR NOT NULL,
PRIMARY KEY (attribute)
);
"""
)
)
"""))
# mark the version which was used to create the DB
# also mark the "database schema version" in case we ever need to handle
# graceful upgrades
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,44 @@
def test_graph_str_single_node():
g = ScopeGraph.parse("foo")
clean_str = _blank_lines_removed(str(g))
assert (
clean_str
== """\
assert clean_str == """\
digraph scopes {
rankdir="LR";
foo
}"""
)


def test_graph_str_single_optional_node():
g = ScopeGraph.parse("*foo")
clean_str = _blank_lines_removed(str(g))
assert (
clean_str
== """\
assert clean_str == """\
digraph scopes {
rankdir="LR";
*foo
}"""
)


def test_graph_str_single_dependency():
g = ScopeGraph.parse("foo[bar]")
clean_str = _blank_lines_removed(str(g))
assert (
clean_str
== """\
assert clean_str == """\
digraph scopes {
rankdir="LR";
foo
foo -> bar;
}"""
)


def test_graph_str_optional_dependency():
g = ScopeGraph.parse("foo[bar[*baz]]")
clean_str = _blank_lines_removed(str(g))
assert (
clean_str
== """\
assert clean_str == """\
digraph scopes {
rankdir="LR";
foo
foo -> bar;
bar -> baz [ label = "optional" ];
}"""
)


def _blank_lines_removed(s: str) -> str:
Expand Down
6 changes: 2 additions & 4 deletions tests/unit/sphinxext/test_base_add_content_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ def gen_rst(self):
assert etree.get("source") == "TEST"
paragraph_element = etree.find("paragraph")
assert paragraph_element is not None
assert paragraph_element.text == textwrap.dedent(
"""\
assert paragraph_element.text == textwrap.dedent("""\
a
b"""
)
b""")


def test_addcontent_generating_warning(
Expand Down
12 changes: 4 additions & 8 deletions tests/unit/sphinxext/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,16 @@ def test_read_sphinx_params(sphinxext):
assert len(params) == 6
assert params[0] == ":param param1: some doc on one line"
assert params[1] == ":param param2: other doc\n spanning multiple lines"
assert params[2] == textwrap.dedent(
"""\
assert params[2] == textwrap.dedent("""\
:param param3: a doc
spanning
many
lines"""
)
assert params[3] == textwrap.dedent(
"""\
lines""")
assert params[3] == textwrap.dedent("""\
:param param4: a doc
spanning lines

with a break in the middle ^"""
)
with a break in the middle ^""")
assert params[4] == ":param param5: another"
assert params[5] == ":param param6: and a final one after some whitespace"

Expand Down
Loading