Skip to content

Commit

Permalink
Fix check version in changelog script (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdusek authored Nov 20, 2023
1 parent 9744ace commit 8d5718d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scripts/check_version_in_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@

with open(CHANGELOG_PATH, encoding='utf-8') as changelog_file:
for line in changelog_file:
# The heading for the changelog entry for the given version can start with either the version number, or the version number in a link
if re.match(rf'\[?{current_package_version}([\] ]|$)', line):
# Ensure that the heading in the changelog entry for the specified version includes a version number
# enclosed in square brackets. This version number is formatted as a link to the corresponding
# version tag on GitHub.
if re.match(rf'## \[{current_package_version}\].*$', line):
break
else:
raise RuntimeError(f'There is no entry in the changelog for the current package version ({current_package_version})')
2 changes: 1 addition & 1 deletion src/apify_client/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LogContext(NamedTuple):
# Metaclass for resource clients which wraps all their public methods
# With injection of their details to the log context vars
class WithLogDetailsClient(type):
def __new__(cls: type[type], name: str, bases: tuple, attrs: dict) -> WithLogDetailsClient: # noqa: PYI034
def __new__(cls: type[type], name: str, bases: tuple, attrs: dict) -> WithLogDetailsClient:
for attr_name, attr_value in attrs.items():
if not attr_name.startswith('_') and inspect.isfunction(attr_value):
attrs[attr_name] = _injects_client_details_to_log_context(attr_value)
Expand Down

0 comments on commit 8d5718d

Please sign in to comment.