Skip to content

Commit

Permalink
chore: clean up after pyupgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Nov 4, 2024
1 parent d1a7029 commit ab0b254
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/scriv/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pkgutil
import re
from pathlib import Path
from typing import Any, List
from typing import Any

import attr

Expand Down
2 changes: 1 addition & 1 deletion src/scriv/format.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Dispatcher for format-based knowledge."""

import abc
from typing import Dict, List, Optional
from typing import Optional

from .config import Config

Expand Down
2 changes: 1 addition & 1 deletion src/scriv/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import logging
import os
from typing import Any, Dict
from collections.abc import Iterable
from typing import Any

import requests

Expand Down
1 change: 0 additions & 1 deletion src/scriv/gitinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import subprocess
import sys
from pathlib import Path
from typing import Set

import click

Expand Down
2 changes: 1 addition & 1 deletion src/scriv/literals.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import ast
import configparser
import os.path
from typing import Any, Optional
from collections.abc import MutableMapping
from typing import Any, Optional

from .exceptions import ScrivException
from .optional import tomllib, yaml
Expand Down
2 changes: 1 addition & 1 deletion src/scriv/scriv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import re
import textwrap
from pathlib import Path
from typing import List, Optional
from collections.abc import Iterable
from typing import Optional

import jinja2

Expand Down
2 changes: 1 addition & 1 deletion src/scriv/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import shlex
import subprocess
from typing import List, Tuple, Union
from typing import Union

# The return value of run_command.
CmdResult = tuple[bool, str]
Expand Down
2 changes: 1 addition & 1 deletion src/scriv/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import logging
import re
import sys
from typing import Dict, Optional, Tuple, TypeVar
from collections.abc import Sequence
from typing import TypeVar

import click_log

Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
import sys
import traceback
from pathlib import Path
from collections.abc import Iterable
from pathlib import Path

import pytest
import responses
Expand Down
2 changes: 1 addition & 1 deletion tests/faker.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Fake implementations of some of our external information sources."""

import shlex
from typing import Callable, Dict, List, Optional, Set, Tuple
from collections.abc import Iterable
from typing import Callable, Optional

from scriv.shell import CmdResult

Expand Down
6 changes: 3 additions & 3 deletions tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class TestCreateAdd:
Tests of auto-adding created fragments.
"""

def test_create_add(
def test_create_add( # pylint: disable=too-many-positional-arguments
self, caplog, mocker, fake_git, cli_invoke, changelog_d
):
# "scriv create --add" will invoke "git add" on the file.
Expand Down Expand Up @@ -261,7 +261,7 @@ def test_create_add_preference(
)
mock_call.assert_called_once_with(["git", "add", file_path])

def test_create_add_preference_no_add(
def test_create_add_preference_no_add( # pylint: disable=too-many-positional-arguments
self, caplog, mocker, fake_git, cli_invoke, changelog_d
):
# The user can set a git configuration to default to --add, but --no-add
Expand All @@ -274,7 +274,7 @@ def test_create_add_preference_no_add(
mock_call.assert_not_called()
assert "Added" not in caplog.text

def test_create_add_fail(
def test_create_add_fail( # pylint: disable=too-many-positional-arguments
self, caplog, mocker, fake_git, cli_invoke, changelog_d
):
# We properly handle failure to add.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ghrel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import json
import logging
from typing import Any, Dict
from typing import Any
from unittest.mock import call

import pytest
Expand Down

0 comments on commit ab0b254

Please sign in to comment.