Skip to content

Commit

Permalink
Drop dependency on attr
Browse files Browse the repository at this point in the history
  • Loading branch information
dmerejkowsky committed Dec 22, 2021
1 parent b13a383 commit 7d6d3d7
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
1 change: 1 addition & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
------------------

* Drop support for Python 3.6
* Drop dependency on `attr`

6.6.1 (2021-12-17)
------------------
Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 7 additions & 7 deletions tbump/cli.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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:
Expand Down
34 changes: 17 additions & 17 deletions tbump/config.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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):
Expand Down
12 changes: 6 additions & 6 deletions tbump/file_bumper.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
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
from tbump.config import ConfigFile, Field, File, get_config_file
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):
Expand Down

0 comments on commit 7d6d3d7

Please sign in to comment.