From 448df03f9d71b0dd189e6168aa9d51a763f6c43f Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 16 Jul 2021 15:54:36 -0400 Subject: [PATCH] Tidelift release task skeleton --- invocations/packaging/release.py | 8 ++++++++ tests/packaging/release.py | 20 ++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/invocations/packaging/release.py b/invocations/packaging/release.py index 75251ad..6e26a9b 100644 --- a/invocations/packaging/release.py +++ b/invocations/packaging/release.py @@ -890,6 +890,14 @@ def push(c, dry_run=False): c.run("git push {}".format(opts), **kwargs) +@task +def tidelift(c, dry_run=False): + """ + Add current latest version to Tidelift & set changelog link. + """ + pass + + # TODO: still need time to solve the 'just myself pls' problem ns = Collection( "release", all_, status, prepare, build, publish, push, test_install diff --git a/tests/packaging/release.py b/tests/packaging/release.py index 070e87c..f9c1582 100644 --- a/tests/packaging/release.py +++ b/tests/packaging/release.py @@ -1093,11 +1093,23 @@ def honors_dry_run(self): ) +class tidelift_: + def adds_new_version_with_changelog_link(self): + # new version created + # release line etc stuff? prob just defaults? + # changelog link + skip() + + def dry_run_does_not_hit_api(self): + skip() + + class all_task: @patch("invocations.packaging.release.prepare") @patch("invocations.packaging.release.publish") @patch("invocations.packaging.release.push") - def runs_primary_workflow(self, push, publish, prepare): + @patch("invocations.packaging.release.tidelift") + def runs_primary_workflow(self, tidelift, push, publish, prepare): c = MockContext(run=True) all_(c) # TODO: this doesn't actually prove order of operations. not seeing an @@ -1105,16 +1117,19 @@ def runs_primary_workflow(self, push, publish, prepare): prepare.assert_called_once_with(c, dry_run=False) publish.assert_called_once_with(c, dry_run=False) push.assert_called_once_with(c, dry_run=False) + tidelift.assert_called_once_with(c, dry_run=False) @patch("invocations.packaging.release.prepare") @patch("invocations.packaging.release.publish") @patch("invocations.packaging.release.push") - def passes_through_dry_run_flag(self, push, publish, prepare): + @patch("invocations.packaging.release.tidelift") + def passes_through_dry_run_flag(self, tidelift, push, publish, prepare): c = MockContext(run=True) all_(c, dry_run=True) prepare.assert_called_once_with(c, dry_run=True) publish.assert_called_once_with(c, dry_run=True) push.assert_called_once_with(c, dry_run=True) + tidelift.assert_called_once_with(c, dry_run=True) def bound_to_name_without_underscore(self): assert all_.name == "all" @@ -1130,6 +1145,7 @@ def contains_all_tasks(self): push status test-install + tidelift """.split() assert set(release_ns.task_names) == set(names)