Skip to content

Commit

Permalink
Tidelift release task skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Jul 16, 2021
1 parent 8930877 commit 448df03
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
8 changes: 8 additions & 0 deletions invocations/packaging/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 18 additions & 2 deletions tests/packaging/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -1093,28 +1093,43 @@ 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
# unhairy way to do that, but not really that worried either...:P
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"
Expand All @@ -1130,6 +1145,7 @@ def contains_all_tasks(self):
push
status
test-install
tidelift
""".split()
assert set(release_ns.task_names) == set(names)

Expand Down

0 comments on commit 448df03

Please sign in to comment.