Skip to content

Commit

Permalink
chore: prep v0.18.3 for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Jul 7, 2024
1 parent 1b6b025 commit 3aa38b0
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 92 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# CHANGELOG

## v0.18.3 (2024-07-07)

- Corrects regression introduced in `v0.18.2` on the URLs used for public repo asset downloads
- Removes the quotes that previously wrapped commit messages unintentionally
- Uses a conventional commit message structure
- Bumps development dependencies

## v0.18.2 (2024-07-04)

**WARNING: Do not use this version, please use v0.18.3 or later!**

- Fixes the URLs used to download the default zip/tars for private repos

## v0.18.1 (2024-01-12)
Expand Down
2 changes: 1 addition & 1 deletion homebrew_releaser/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.18.2'
__version__ = '0.18.3'
12 changes: 7 additions & 5 deletions homebrew_releaser/readme_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ def generate_table(formulas: List) -> str:
rows = []

for formula in formulas:
rows.append([
f'[{formula["name"]}]({formula.get("homepage")})',
formula.get('desc'),
f'`brew install {formula["name"]}`',
])
rows.append(
[
f'[{formula["name"]}]({formula.get("homepage")})',
formula.get('desc'),
f'`brew install {formula["name"]}`',
]
)

table = pretty_tables.create(
headers=headers,
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

DEV_REQUIREMENTS = [
'bandit == 1.7.*',
'black == 23.*',
'flake8 == 6.*',
'black == 24.*',
'flake8 == 7.*',
'isort == 5.*',
'mypy == 1.7.*',
'pytest == 7.*',
'pytest-cov == 4.*',
'mypy == 1.10.*',
'pytest == 8.*',
'pytest-cov == 5.*',
'types-requests',
]

Expand Down
140 changes: 84 additions & 56 deletions test/unit/test_formula.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ def test_generate_formula():
owner=USERNAME,
repo_name=mock_repo_name,
repository=repository,
checksums=[{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}],
checksums=[
{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}
],
install=INSTALL,
tar_url=mock_tar_url,
depends_on=DEPENDS_ON,
Expand All @@ -82,20 +84,32 @@ def test_generate_formula():
record_formula(formula_path, formula_filename, formula)

# The following assertions are explicitly listed as the "gold standard" for generic formula generation
assert '''# typed: true
assert (
'''# typed: true
# frozen_string_literal: true
# This file was generated by Homebrew Releaser. DO NOT EDIT.''' in formula
assert '''desc "Tool to release scripts, binaries, and executables to github"
# This file was generated by Homebrew Releaser. DO NOT EDIT.'''
in formula
)
assert (
'''desc "Tool to release scripts, binaries, and executables to github"
homepage "https://github.com/Justintime50/test-generate-formula"
url "https://github.com/Justintime50/test-generate-formula/archive/refs/tags/v0.1.0.tar.gz"
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
license "MIT"''' in formula
assert '''depends_on "bash" => :build
depends_on "gcc"''' in formula
assert '''def install
license "MIT"'''
in formula
)
assert (
'''depends_on "bash" => :build
depends_on "gcc"'''
in formula
)
assert (
'''def install
bin.install "src/secure-browser-kiosk.sh" => "secure-browser-kiosk"
end''' in formula
end'''
in formula
)
assert '''test do
assert_match("my script output", shell_output("my-script-command"))
end'''
Expand All @@ -121,12 +135,14 @@ def test_generate_formula_no_article_description():
owner=USERNAME,
repo_name=mock_repo_name,
repository=repository,
checksums=[{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}],
checksums=[
{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}
],
install=INSTALL,
tar_url=mock_tar_url,
depends_on=None,
Expand Down Expand Up @@ -158,12 +174,14 @@ def test_generate_formula_formula_name_starts_description():
owner=USERNAME,
repo_name=mock_repo_name,
repository=repository,
checksums=[{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}],
checksums=[
{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}
],
install=INSTALL,
tar_url=mock_tar_url,
depends_on=None,
Expand Down Expand Up @@ -193,12 +211,14 @@ def test_generate_formula_no_depends_on():
owner=USERNAME,
repo_name=mock_repo_name,
repository=repository,
checksums=[{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}],
checksums=[
{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}
],
install=INSTALL,
tar_url=mock_tar_url,
depends_on=None,
Expand Down Expand Up @@ -228,12 +248,14 @@ def test_generate_formula_no_test():
owner=USERNAME,
repo_name=mock_repo_name,
repository=repository,
checksums=[{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}],
checksums=[
{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}
],
install=INSTALL,
tar_url=mock_tar_url,
depends_on=DEPENDS_ON,
Expand Down Expand Up @@ -501,12 +523,14 @@ def test_generate_formula_string_false_configs():
owner=USERNAME,
repo_name=mock_repo_name,
repository=repository,
checksums=[{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}],
checksums=[
{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}
],
install=INSTALL,
tar_url=mock_tar_url,
depends_on=None,
Expand Down Expand Up @@ -538,12 +562,14 @@ def test_generate_formula_empty_fields():
owner=USERNAME,
repo_name=mock_repo_name,
repository=repository,
checksums=[{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}],
checksums=[
{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}
],
install=INSTALL,
tar_url=mock_tar_url,
depends_on=None,
Expand Down Expand Up @@ -642,12 +668,14 @@ def test_generate_formula_override_version():
owner=USERNAME,
repo_name=mock_repo_name,
repository=repository,
checksums=[{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}],
checksums=[
{
f'{mock_repo_name}.tar.gz': {
'checksum': CHECKSUM,
'url': f'https://github.com/justintime50/{mock_repo_name}/releases/download/{VERSION}/{mock_repo_name}-{VERSION}.tar.gz', # noqa
},
}
],
install=INSTALL,
tar_url=mock_tar_url,
version='9.8.7',
Expand Down
52 changes: 27 additions & 25 deletions test/unit/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,33 @@ def test_setup(mock_subprocess):
commit_email = 'user@example.com'
Git.setup(homebrew_owner, commit_email, homebrew_owner, homebrew_tap)

mock_subprocess.assert_has_calls([
call(
[
'git',
'clone',
'--depth=1',
'https://x-access-token:123@github.com/Justintime50/homebrew-formulas.git',
],
stderr=-2,
text=True,
timeout=30,
),
call(
['git', '-C', 'homebrew-formulas', 'config', 'user.name', '"Justintime50"'],
stderr=-2,
text=True,
timeout=30,
),
call(
['git', '-C', 'homebrew-formulas', 'config', 'user.email', 'user@example.com'],
stderr=-2,
text=True,
timeout=30,
),
])
mock_subprocess.assert_has_calls(
[
call(
[
'git',
'clone',
'--depth=1',
'https://x-access-token:123@github.com/Justintime50/homebrew-formulas.git',
],
stderr=-2,
text=True,
timeout=30,
),
call(
['git', '-C', 'homebrew-formulas', 'config', 'user.name', '"Justintime50"'],
stderr=-2,
text=True,
timeout=30,
),
call(
['git', '-C', 'homebrew-formulas', 'config', 'user.email', 'user@example.com'],
stderr=-2,
text=True,
timeout=30,
),
]
)


@patch('subprocess.check_output')
Expand Down

0 comments on commit 3aa38b0

Please sign in to comment.