diff --git a/Changelog.rst b/Changelog.rst index c7bb347..51b62d0 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -5,6 +5,7 @@ Changelog ------------------ * Drop support for Python 3.6 +* Drop dependency on `attr` 6.6.1 (2021-12-17) ------------------ diff --git a/poetry.lock b/poetry.lock index e0c0802..6000833 100644 --- a/poetry.lock +++ b/poetry.lock @@ -10,7 +10,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" name = "attrs" version = "21.2.0" description = "Classes Without Boilerplate" -category = "main" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" @@ -574,7 +574,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "e7bf84414b86de359f6162a29dd3c4d52a9c85db79f72c30017d1bac1b59be29" +content-hash = "ba50222af5b296f705a33bb005a96200f49eef2623c408930b4de282b74bdcc7" [metadata.files] atomicwrites = [ diff --git a/pyproject.toml b/pyproject.toml index db403d1..6cfd5d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,6 @@ Issues = "https://github.com/dmerejkowsky/tbump/issues" # Note: keep this in sync with .github/workflows/tests.yml python = "^3.7" -attrs = ">= 20.0.0" docopt = "^0.6.2" cli-ui = ">=0.10.3" schema = "^0.7.1" diff --git a/tbump/cli.py b/tbump/cli.py index 3ca77cf..d880aa4 100644 --- a/tbump/cli.py +++ b/tbump/cli.py @@ -1,10 +1,10 @@ import sys import textwrap import urllib.parse +from dataclasses import dataclass from pathlib import Path from typing import List, Optional -import attr import cli_ui as ui import docopt @@ -47,13 +47,13 @@ def print_error(self) -> None: ui.error("Canceled by user") -@attr.s +@dataclass class BumpOptions: - working_path: Path = attr.ib() - new_version: str = attr.ib() - interactive: bool = attr.ib(default=True) - dry_run: bool = attr.ib(default=False) - config_path: Optional[Path] = attr.ib(default=None) + working_path: Path + new_version: str + interactive: bool = True + dry_run: bool = False + config_path: Optional[Path] = None def run(cmd: List[str]) -> None: diff --git a/tbump/config.py b/tbump/config.py index a58ec84..f80f6ff 100644 --- a/tbump/config.py +++ b/tbump/config.py @@ -1,9 +1,9 @@ import abc import re +from dataclasses import dataclass from pathlib import Path from typing import Dict, List, Optional, Pattern, Tuple, Union -import attr import cli_ui as ui import schema import tomlkit @@ -13,32 +13,32 @@ from tbump.hooks import HOOKS_CLASSES, Hook -@attr.s +@dataclass class File: - src: str = attr.ib() - search: Optional[str] = attr.ib(default=None) - version_template: Optional[str] = attr.ib(default=None) + src: str + search: Optional[str] = None + version_template: Optional[str] = None -@attr.s +@dataclass class Field: - name: str = attr.ib() - default: Optional[Union[str, int]] = attr.ib(default=None) + name: str + default: Optional[Union[str, int]] = None -@attr.s +@dataclass class Config: - current_version: str = attr.ib() - version_regex: Pattern[str] = attr.ib() + current_version: str + version_regex: Pattern[str] - git_tag_template: str = attr.ib() - git_message_template: str = attr.ib() + git_tag_template: str + git_message_template: str - files: List[File] = attr.ib() - hooks: List[Hook] = attr.ib() - fields: List[Field] = attr.ib() + files: List[File] + hooks: List[Hook] + fields: List[Field] - github_url: Optional[str] = attr.ib() + github_url: Optional[str] class ConfigFile(metaclass=abc.ABCMeta): diff --git a/tbump/file_bumper.py b/tbump/file_bumper.py index bfdd5ac..35bb4f1 100644 --- a/tbump/file_bumper.py +++ b/tbump/file_bumper.py @@ -1,9 +1,9 @@ import glob import re +from dataclasses import dataclass from pathlib import Path from typing import Dict, List, Optional, Pattern -import attr import cli_ui as ui from tbump.action import Action @@ -11,12 +11,12 @@ from tbump.error import Error -@attr.s +@dataclass class ChangeRequest: - src: str = attr.ib() - old_string: str = attr.ib() - new_string: str = attr.ib() - search: Optional[str] = attr.ib(default=None) + src: str + old_string: str + new_string: str + search: Optional[str] = None class Patch(Action):