Skip to content

Commit

Permalink
Postpone Python 3.10 dataclass features
Browse files Browse the repository at this point in the history
  • Loading branch information
lagru committed Nov 14, 2023
1 parent 219c92d commit 62cbdac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "changelist"
version = "0.5rc0.dev0"
# TODO add slots=True, kw_only=True to dataclasses starting with >=3.10
requires-python = ">=3.9"
readme = "README.md"
license = {file = "LICENSE.txt"}
Expand Down
8 changes: 4 additions & 4 deletions src/changelist/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
logger = logging.getLogger(__name__)


@dataclass(frozen=True, slots=True, kw_only=True)
@dataclass(frozen=True)
class ChangeNote:
"""Describes an atomic change in the notes."""

Expand Down Expand Up @@ -65,7 +65,7 @@ def from_pull_requests(
return notes


@dataclass(frozen=True, slots=True, kw_only=True)
@dataclass(frozen=True)
class Contributor:
"""A person mentioned in the notes as an author or reviewer.
Expand All @@ -74,7 +74,7 @@ class Contributor:
contributor's GitHub profile.
"""

name: str | None
name: str
login: str
reference_url: str

Expand All @@ -98,7 +98,7 @@ def from_named_users(cls, named_users: set[NamedUser]) -> "set[Contributor]":
return contributors


@dataclass(frozen=True, kw_only=True)
@dataclass(frozen=True)
class MdFormatter:
"""Format release notes in Markdown from PRs, authors and reviewers."""

Expand Down
2 changes: 1 addition & 1 deletion src/changelist/_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def pull_requests_from_commits(commits: Iterable[Commit]) -> set[PullRequest]:
return all_pull_requests


@dataclass(frozen=True, kw_only=True)
@dataclass(frozen=True)
class GitHubGraphQl:
"""Interface to query GitHub's GraphQL API for a particular repository."""

Expand Down

0 comments on commit 62cbdac

Please sign in to comment.