From 8ad0ab9191da9baded1b2affdf47a36060180bcf Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Tue, 5 Dec 2023 13:48:09 -0700 Subject: [PATCH] fix: lint and remove unused build deps --- homebrew_releaser/readme_updater.py | 12 +++---- justfile | 4 --- setup.py | 4 +-- test/unit/test_git.py | 52 ++++++++++++++--------------- 4 files changed, 31 insertions(+), 41 deletions(-) diff --git a/homebrew_releaser/readme_updater.py b/homebrew_releaser/readme_updater.py index 139f31f..aa2b767 100644 --- a/homebrew_releaser/readme_updater.py +++ b/homebrew_releaser/readme_updater.py @@ -93,13 +93,11 @@ 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, diff --git a/justfile b/justfile index b0171a7..b2f4bf5 100644 --- a/justfile +++ b/justfile @@ -21,10 +21,6 @@ audit: bandit: {{VIRTUAL_BIN}}/bandit -r {{PROJECT_NAME}}/ -# Builds the project in preparation for release -build: - {{VIRTUAL_BIN}}/python -m build - # Runs the Black Python formatter against the project black: {{VIRTUAL_BIN}}/black {{PROJECT_NAME}}/ {{TEST_DIR}}/ diff --git a/setup.py b/setup.py index 41a7e42..1526b03 100644 --- a/setup.py +++ b/setup.py @@ -24,13 +24,11 @@ DEV_REQUIREMENTS = [ 'bandit == 1.7.*', 'black == 23.*', - 'build == 0.10.*', 'flake8 == 6.*', 'isort == 5.*', - 'mypy == 1.5.*', + 'mypy == 1.7.*', 'pytest == 7.*', 'pytest-cov == 4.*', - 'twine == 4.*', 'types-requests', ] diff --git a/test/unit/test_git.py b/test/unit/test_git.py index a6849cb..dd2bfd1 100644 --- a/test/unit/test_git.py +++ b/test/unit/test_git.py @@ -19,33 +19,31 @@ 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')