From fcf1bf32f47810939f60c3802c1c9226aed7f96132c2223aad09afb7c7c4ea42 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Fri, 12 May 2023 08:19:39 +0000 Subject: [PATCH] =?UTF-8?q?-=20Delete=20migrate-to-pytest.patch=20-=20Dele?= =?UTF-8?q?te=20remove-mock.patch=20-=20Add=20remove-icecream.patch=20-=20?= =?UTF-8?q?Update=20to=202.1.1:=20=20=20*=20[Bug]:=20Fix=20up=20an=20inter?= =?UTF-8?q?nal=20utility=20which=20monkeypatches=20a=20=20=20=20=20Sphinx/?= =?UTF-8?q?docutils=20internal,=20so=20that=20it=20accepts=20arbitrary=20a?= =?UTF-8?q?rgs/kwargs=20=20=20=20=20instead=20of=20exploding=20on=20newer?= =?UTF-8?q?=20Sphinxes.=20-=202.0.1:=20=20=20*=20[Bug]:=20Fix=20up=20an=20?= =?UTF-8?q?internal=20utility=20which=20monkeypatches=20a=20=20=20=20=20Sp?= =?UTF-8?q?hinx/docutils=20internal,=20so=20that=20it=20accepts=20arbitrar?= =?UTF-8?q?y=20args/kwargs=20=20=20=20=20instead=20of=20exploding=20on=20n?= =?UTF-8?q?ewer=20Sphinxes.=20-=202.1.0:=20=20=20*=20[Feature]:=20Allow=20?= =?UTF-8?q?controlling=20the=20name=20of=20your=20development=20branch=20?= =?UTF-8?q?=20=20=20=20for=20source=20code=20links=20(eg=20=E2=80=9CNext?= =?UTF-8?q?=201.x=20feature=20release=E2=80=9D=20section=20=20=20=20=20hea?= =?UTF-8?q?ders)=20via=20the=20new=20releases=5Fdevelopment=5Fbranch=20con?= =?UTF-8?q?fig=20option.=20=20=20*=20[Feature]:=20Add=20a=20new=20configur?= =?UTF-8?q?ation=20setting,=20=20=20=20=20releases=5Fsupported=5Fversions,?= =?UTF-8?q?=20allowing=20you=20to=20limit=20how=20many=20=E2=80=9CNext=20?= =?UTF-8?q?=20=20=20=201.x=20feature=20release=E2=80=9D=20(or=20bugfix,=20?= =?UTF-8?q?etc)=20sections=20appear=20at=20the=20top=20=20=20=20=20of=20yo?= =?UTF-8?q?ur=20changelog.=20-=202.0.0:=20=20=20*=20[Bug]:=20Don=E2=80=99t?= =?UTF-8?q?=20make=20tmpdirs=20in=20releases.util.make=5Fapp=20when=20bein?= =?UTF-8?q?g=20=20=20=20=20given=20explicit=20directory=20args.=20=20=20*?= =?UTF-8?q?=20[Bug]:=20Changelog=20transformation=20sometimes=20failed=20t?= =?UTF-8?q?o=20occur=20when=20=20=20=20=20running=20under=20a=20=E2=80=98s?= =?UTF-8?q?ingle=20HTML=20file=E2=80=99=20Sphinx=20builder=20(eg=20singleh?= =?UTF-8?q?tml),=20=20=20=20=20which=20resulted=20in=20=E2=80=98unknown=20?= =?UTF-8?q?node=E2=80=99=20errors.=20This=20has=20been=20fixed.=20=20=20*?= =?UTF-8?q?=20[Support]:=20Migrated=20the=20test=20suite=20to=20use=20pyte?= =?UTF-8?q?st-relaxed=20(and=20thus=20=20=20=20=20pytest)=20instead=20of?= =?UTF-8?q?=20spec.=20=20=20*=20[Support]:=20Dropped=20support=20for=20Sph?= =?UTF-8?q?inx=20<4.=20We=20tried=20to=20support=20=20=20=20=201.8+,=20but?= =?UTF-8?q?=20too=20many=20transitive=20dependencies=20have=20clearly=20?= =?UTF-8?q?=E2=80=9Cmoved=20on=E2=80=9D=20=20=20=20=20and=20cause=20variou?= =?UTF-8?q?s=20cells=20in=20the=20test=20matrix=20to=20fail=20hard.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-releases?expand=0&rev=21 --- migrate-to-pytest.patch | 685 --------------------------------------- python-releases.changes | 42 +++ python-releases.spec | 19 +- releases-1.6.3.tar.gz | 3 - releases-2.1.1.tar.gz | 3 + remove-icecream.patch | 10 + remove-mock.patch | 13 - semanticversioning.patch | 56 ++-- 8 files changed, 84 insertions(+), 747 deletions(-) delete mode 100644 migrate-to-pytest.patch delete mode 100644 releases-1.6.3.tar.gz create mode 100644 releases-2.1.1.tar.gz create mode 100644 remove-icecream.patch delete mode 100644 remove-mock.patch diff --git a/migrate-to-pytest.patch b/migrate-to-pytest.patch deleted file mode 100644 index 5fed561..0000000 --- a/migrate-to-pytest.patch +++ /dev/null @@ -1,685 +0,0 @@ -From 94bb11bfe6a9583896de6d54861af68e9ce6b957 Mon Sep 17 00:00:00 2001 -From: Jeff Forcier -Date: Fri, 17 Jan 2020 15:16:49 -0500 -Subject: [PATCH] Migrate to pytest-relaxed from spec - ---- - dev-requirements.txt | 3 +- - docs/changelog.rst | 2 ++ - integration/integration.py | 6 ++-- - integration/util.py | 66 ++++++++++++++++++++------------------ - setup.cfg | 4 +++ - tasks.py | 7 ++-- - tests/_util.py | 6 ++-- - tests/organization.py | 35 ++++++++++---------- - tests/presentation.py | 25 +++++++-------- - 9 files changed, 80 insertions(+), 74 deletions(-) - -Index: releases-1.6.3/dev-requirements.txt -=================================================================== ---- releases-1.6.3.orig/dev-requirements.txt -+++ releases-1.6.3/dev-requirements.txt -@@ -2,7 +2,7 @@ - invoke>=0.6.0,<2.0 - invocations>=0.14,<2.0 - # Tests (N.B. integration suite also uses Invoke as above) --spec>=0.11.3,<2.0 -+pytest==4.6.9 - mock==1.0.1 - # Just for tests...heh - six>=1.4.1,<2.0 -Index: releases-1.6.3/docs/changelog.rst -=================================================================== ---- releases-1.6.3.orig/docs/changelog.rst -+++ releases-1.6.3/docs/changelog.rst -@@ -2,6 +2,7 @@ - Changelog - ========= - -+- :support:`-` Migrated the test suite to use ``pytest`` - - :release:`1.6.3 <2020-01-10>` - - :support:`87 backported` (via :issue:`88`) Our upper Sphinx version limit was - mostly defensive and at this point is just too old to even build on -Index: releases-1.6.3/tasks.py -=================================================================== ---- releases-1.6.3.orig/tasks.py -+++ releases-1.6.3/tasks.py -@@ -1,17 +1,14 @@ - from os.path import join - - from invocations import docs --from invocations.testing import test, integration, watch_tests -+from invocations.pytest import test, integration - from invocations.packaging import release - - from invoke import Collection - - --ns = Collection(test, integration, watch_tests, release, docs) -+ns = Collection(test, integration, release, docs) - ns.configure({ -- 'tests': { -- 'package': 'releases', -- }, - 'packaging': { - 'sign': True, - 'wheel': True, -Index: releases-1.6.3/tests/_util.py -=================================================================== ---- releases-1.6.3.orig/tests/_util.py -+++ releases-1.6.3/tests/_util.py -@@ -2,7 +2,6 @@ from docutils.nodes import ( - list_item, paragraph, - ) - from mock import Mock --from spec import eq_, ok_ - import six - - from releases import ( -@@ -108,9 +107,10 @@ def expect_releases(entries, release_map - err += "\nFull changelog: {!r}\n" - for rel, issues in six.iteritems(release_map): - found = changelog.pop(rel) -- eq_(set(found), set(issues), err.format(rel, issues, found, snapshot)) -+ msg = err.format(rel, issues, found, snapshot) -+ assert set(found) == set(issues), msg - # Sanity: ensure no leftover issue lists exist (empty ones are OK) - for key in list(changelog.keys()): - if not changelog[key]: - del changelog[key] -- ok_(not changelog, "Found leftovers: {}".format(changelog)) -+ assert not changelog, "Found leftovers: {}".format(changelog) -Index: releases-1.6.3/tests/organization.py -=================================================================== ---- releases-1.6.3.orig/tests/organization.py -+++ releases-1.6.3/tests/organization.py -@@ -1,5 +1,6 @@ - import six --from spec import Spec, eq_, raises, skip -+from pytest import skip, raises -+from unittest import TestCase - from docutils.nodes import ( - list_item, raw, paragraph, Text, - ) -@@ -20,58 +21,58 @@ from _util import ( - ) - - --class organization(Spec): -+class organization(TestCase): - """ - Organization of issues into releases (parsing) - """ -- def setup(self): -+ def setUp(self): - setup_issues(self) - - def _expect_entries(self, all_entries, in_, not_in): - # Grab 2nd release as 1st is the empty 'beginning of time' one - entries = releases(*all_entries)[1]['entries'] -- eq_(len(entries), len(in_)) -+ assert len(entries) == len(in_) - for x in in_: - assert x in entries - for x in not_in: - assert x not in entries - -- def feature_releases_include_features_and_support_not_bugs(self): -+ def test_feature_releases_include_features_and_support_not_bugs(self): - self._expect_entries( - ['1.1.0', self.f, self.b, self.s], - [self.f, self.s], - [self.b] - ) - -- def feature_releases_include_major_bugs(self): -+ def test_feature_releases_include_major_bugs(self): - self._expect_entries( - ['1.1.0', self.f, self.b, self.mb], - [self.f, self.mb], - [self.b] - ) - -- def bugfix_releases_include_bugs(self): -+ def test_bugfix_releases_include_bugs(self): - self._expect_entries( - ['1.0.2', self.f, self.b, self.mb], - [self.b], - [self.mb, self.f], - ) - -- def bugfix_releases_include_backported_features(self): -+ def test_bugfix_releases_include_backported_features(self): - self._expect_entries( - ['1.0.2', self.bf, self.b, self.s], - [self.b, self.bf], - [self.s] - ) - -- def bugfix_releases_include_backported_support(self): -+ def test_bugfix_releases_include_backported_support(self): - self._expect_entries( - ['1.0.2', self.f, self.b, self.s, self.bs], - [self.b, self.bs], - [self.s, self.f] - ) - -- def backported_features_also_appear_in_feature_releases(self): -+ def test_backported_features_also_appear_in_feature_releases(self): - entries = ( - '1.1.0', '1.0.2', self.bf, self.b, self.s, - ) -@@ -82,35 +83,35 @@ class organization(Spec): - } - expect_releases(entries, expected) - -- def unmarked_bullet_list_items_treated_as_bugs(self): -+ def test_unmarked_bullet_list_items_treated_as_bugs(self): - fake = list_item('', paragraph('', '', raw('', 'whatever'))) - changelog = releases('1.0.2', self.f, fake) - entries = changelog[1]['entries'] -- eq_(len(entries), 1) -+ assert len(entries) == 1 - assert self.f not in entries - assert isinstance(entries[0], Issue) -- eq_(entries[0].number, None) -+ assert entries[0].number is None - -- def unreleased_items_go_in_unreleased_releases(self): -+ def test_unreleased_items_go_in_unreleased_releases(self): - changelog = releases(self.f, self.b) - # Should have two unreleased lists, one feature w/ feature, one bugfix - # w/ bugfix. - bugfix, feature = changelog[1:] -- eq_(len(feature['entries']), 1) -- eq_(len(bugfix['entries']), 1) -+ assert len(feature['entries']) == 1 -+ assert len(bugfix['entries']) == 1 - assert self.f in feature['entries'] - assert self.b in bugfix['entries'] -- eq_(feature['obj'].number, 'unreleased_1.x_feature') -- eq_(bugfix['obj'].number, 'unreleased_1.x_bugfix') -+ assert feature['obj'].number == 'unreleased_1.x_feature' -+ assert bugfix['obj'].number == 'unreleased_1.x_bugfix' - -- def issues_consumed_by_releases_are_not_in_unreleased(self): -+ def test_issues_consumed_by_releases_are_not_in_unreleased(self): - changelog = releases('1.0.2', self.f, self.b, self.s, self.bs) - release = changelog[1]['entries'] - unreleased = changelog[-1]['entries'] - assert self.b in release - assert self.b not in unreleased - -- def oddly_ordered_bugfix_releases_and_unreleased_list(self): -+ def test_oddly_ordered_bugfix_releases_and_unreleased_list(self): - # Release set up w/ non-contiguous feature+bugfix releases; catches - # funky problems with 'unreleased' buckets - b2 = b(2) -@@ -122,7 +123,7 @@ class organization(Spec): - assert b2 in changelog[2]['entries'] - assert b2 in changelog[3]['entries'] - -- def release_line_bugfix_specifier(self): -+ def test_release_line_bugfix_specifier(self): - b50 = b(50) - b42 = b(42, spec='1.1+') - f25 = f(25) -@@ -148,9 +149,9 @@ class organization(Spec): - ('1.1.2', [b50, b42]), - ('1.2.1', [b50, b42]), - ): -- eq_(set(c[rel]), set(issues)) -+ assert set(c[rel]) == set(issues) - -- def releases_can_specify_issues_explicitly(self): -+ def test_releases_can_specify_issues_explicitly(self): - # Build regular list-o-entries - b2 = b(2) - b3 = b(3) -@@ -172,13 +173,13 @@ class organization(Spec): - assert b2 in one_1_1 - assert b3 in one_1_1 - -- def explicit_release_list_split_works_with_unicode(self): -+ def test_explicit_release_list_split_works_with_unicode(self): - changelog = release_list('1.0.1', b(17)) - changelog[0][0].append(Text(six.text_type('17'))) - # When using naive method calls, this explodes - construct_releases(changelog, make_app()) - -- def explicit_feature_release_features_are_removed_from_unreleased(self): -+ def test_explicit_feature_release_features_are_removed_from_unreleased(self): - f1 = f(1) - f2 = f(2) - changelog = release_list('1.1.0', f1, f2) -@@ -193,7 +194,7 @@ class organization(Spec): - # now-released feature 2 should not be in unreleased_feature - assert f2 not in rendered['unreleased_1.x_feature'] - -- def explicit_bugfix_releases_get_removed_from_unreleased(self): -+ def test_explicit_bugfix_releases_get_removed_from_unreleased(self): - b1 = b(1) - b2 = b(2) - changelog = release_list('1.0.1', b1, b2) -@@ -205,27 +206,27 @@ class organization(Spec): - assert b1 not in rendered[1]['entries'] - # unreleased bug list should still get/see bug 1 - assert b1 in rendered[2]['entries'] -+ -+ def test_explicit_releases_error_on_unfound_issues(self): -+ with raises(ValueError): -+ # Just a release - result will have 1.0.0, 1.0.1, and unreleased -+ changelog = release_list('1.0.1') -+ # No issues listed -> this clearly doesn't exist in any buckets -+ changelog[1][0].append(Text("25")) -+ # This should asplode -+ construct_releases(changelog, make_app()) - -- @raises(ValueError) -- def explicit_releases_error_on_unfound_issues(self): -- # Just a release - result will have 1.0.0, 1.0.1, and unreleased -- changelog = release_list('1.0.1') -- # No issues listed -> this clearly doesn't exist in any buckets -- changelog[1][0].append(Text("25")) -- # This should asplode -- construct_releases(changelog, make_app()) -- -- def duplicate_issue_numbers_adds_two_issue_items(self): -+ def test_duplicate_issue_numbers_adds_two_issue_items(self): - test_changelog = releases('1.0.1', self.b, self.b) - test_changelog = changelog2dict(test_changelog) -- eq_(len(test_changelog['1.0.1']), 2) -+ assert len(test_changelog['1.0.1']) == 2 - -- def duplicate_zeroes_dont_error(self): -+ def test_duplicate_zeroes_dont_error(self): - cl = releases('1.0.1', b(0), b(0)) - cl = changelog2dict(cl) - assert len(cl['1.0.1']) == 2 - -- def issues_are_sorted_by_type_within_releases(self): -+ def test_issues_are_sorted_by_type_within_releases(self): - b1 = b(123, major=True) - b2 = b(124, major=True) - s1 = s(25) -@@ -239,9 +240,9 @@ class organization(Spec): - # Order should be feature, bug, support. While it doesn't REALLY - # matter, assert that within each category the order matches the old - # 'reverse chronological' order. -- eq_(changelog['1.1'], [f2, f1, b2, b1, s2, s1]) -+ assert changelog['1.1'], [f2, f1, b2, b1, s2 == s1] - -- def rolling_release_works_without_annotation(self): -+ def test_rolling_release_works_without_annotation(self): - b1 = b(1) - b2 = b(2) - f3 = f(3) -@@ -262,7 +263,7 @@ class organization(Spec): - } - expect_releases(entries, expected) - -- def plus_annotations_let_old_lines_continue_getting_released(self): -+ def test_plus_annotations_let_old_lines_continue_getting_released(self): - b9 = b(9) - f8 = f(8) - f7 = f(7, spec="1.0+") -@@ -288,7 +289,7 @@ class organization(Spec): - } - expect_releases(entries, expected) - -- def semver_spec_annotations_allow_preventing_forward_porting(self): -+ def test_semver_spec_annotations_allow_preventing_forward_porting(self): - f9 = f(9, spec=">=1.0") - f8 = f(8) - b7 = b(7, spec="<2.0") -@@ -331,7 +332,7 @@ class organization(Spec): - } - expect_releases(entries, expected) - -- def bugs_before_major_releases_associate_with_previous_release_only(self): -+ def test_bugs_before_major_releases_associate_with_previous_release_only(self): - b1 = b(1) - b2 = b(2) - f3 = f(3) -@@ -362,13 +363,13 @@ class organization(Spec): - } - expect_releases(entries, expected) - -- def semver_double_ended_specs_work_when_more_than_two_major_versions(self): -+ def test_semver_double_ended_specs_work_when_more_than_two_major_versions(self): - skip() - -- def can_disable_default_pin_to_latest_major_version(self): -+ def test_can_disable_default_pin_to_latest_major_version(self): - skip() - -- def features_before_first_release_function_correctly(self): -+ def test_features_before_first_release_function_correctly(self): - f0 = f(0) - b1 = b(1) - f2 = f(2) -@@ -384,7 +385,7 @@ class organization(Spec): - # TODO: consider removing that entirely; arguably needing it is a bug? - expect_releases(entries, expected, skip_initial=True) - -- def all_bugs_before_first_release_act_featurelike(self): -+ def test_all_bugs_before_first_release_act_featurelike(self): - b1 = b(1) - f2 = f(2) - b3 = b(3) -@@ -397,10 +398,10 @@ class organization(Spec): - second = changelog['0.1.1'] - assert b1 in first - assert f2 in first -- eq_(len(first), 3) # Meh, hard to assert about the implicit one -- eq_(second, [b3]) -+ assert len(first) == 3 # Meh, hard to assert about the implicit one -+ assert second == [b3] - -- def specs_and_keywords_play_together_nicely(self): -+ def test_specs_and_keywords_play_together_nicely(self): - b1 = b(1) - b2 = b(2, major=True, spec='1.0+') - f3 = f(3) -@@ -426,18 +427,18 @@ class organization(Spec): - } - expect_releases(entries, expected) - -- def changelogs_without_any_releases_display_unreleased_normally(self): -+ def test_changelogs_without_any_releases_display_unreleased_normally(self): - changelog = releases(self.f, self.b, skip_initial=True) - # Ensure only the two unreleased 'releases' showed up -- eq_(len(changelog), 2) -+ assert len(changelog) == 2 - # And assert that both items appeared in one of them (since there's no - # real releases at all, the bugfixes are treated as 'major' bugs, as - # per concepts doc.) - bugfix, feature = changelog -- eq_(len(feature['entries']), 2) -- eq_(len(bugfix['entries']), 0) -+ assert len(feature['entries']) == 2 -+ assert len(bugfix['entries']) == 0 - -- class unstable_prehistory: -+ class unstable_prehistory(TestCase): - def _expect_releases(self, *args, **kwargs): - """ - expect_releases() wrapper setting unstable_prehistory by default -@@ -445,7 +446,7 @@ class organization(Spec): - kwargs['app'] = make_app(unstable_prehistory=True) - return expect_releases(*args, **kwargs) - -- def all_issue_types_rolled_up_together(self): -+ def test_all_issue_types_rolled_up_together(self): - # Pre-1.0-only base case - entries = ( - '0.1.1', -@@ -461,7 +462,7 @@ class organization(Spec): - } - self._expect_releases(entries, expected, skip_initial=True) - -- def does_not_affect_releases_after_1_0(self): -+ def test_does_not_affect_releases_after_1_0(self): - # Mixed changelog crossing 1.0 boundary - entries = ( - '1.1.0', -@@ -483,7 +484,7 @@ class organization(Spec): - } - self._expect_releases(entries, expected, skip_initial=True) - -- def doesnt_care_if_you_skipped_1_0_entirely(self): -+ def test_doesnt_care_if_you_skipped_1_0_entirely(self): - # Mixed changelog where 1.0 is totally skipped and one goes to 2.0 - entries = ( - '2.1.0', -@@ -505,7 +506,7 @@ class organization(Spec): - } - self._expect_releases(entries, expected, skip_initial=True) - -- def explicit_unstable_releases_still_eat_their_issues(self): -+ def test_explicit_unstable_releases_still_eat_their_issues(self): - # I.e. an 0.x.y releases using explicit issue listings, works - # correctly - the explicitly listed issues don't appear in nearby - # implicit releases. -Index: releases-1.6.3/tests/presentation.py -=================================================================== ---- releases-1.6.3.orig/tests/presentation.py -+++ releases-1.6.3/tests/presentation.py -@@ -1,4 +1,3 @@ --from spec import Spec, eq_ - from docutils.nodes import ( - reference, bullet_list, list_item, literal, raw, paragraph, Text - ) -@@ -18,6 +17,7 @@ from _util import ( - setup_issues, - ) - -+from unittest import TestCase - - def _obj2name(obj): - cls = obj if isinstance(obj, type) else obj.__class__ -@@ -30,11 +30,11 @@ def _expect_type(node, cls): - assert isinstance(node, cls), msg - - --class presentation(Spec): -+class presentation(TestCase): - """ - Expansion/extension of docutils nodes (rendering) - """ -- def setup(self): -+ def setUp(self): - setup_issues(self) - - def _generate(self, *entries, **kwargs): -@@ -58,17 +58,17 @@ class presentation(Spec): - assert expected in header - elif type_ == 'issue': - link = nodes[0][1][0][0][2] -- eq_(link['refuri'], expected) -+ assert link['refuri'] == expected - else: - raise Exception("Gave unknown type_ kwarg to _test_link()!") - -- def issues_with_numbers_appear_as_number_links(self): -+ def test_test_issues_with_numbers_appear_as_number_links(self): - self._test_link({}, 'issue', 'bar_15') - -- def releases_appear_as_header_links(self): -+ def test_test_releases_appear_as_header_links(self): - self._test_link({}, 'release', 'foo_1.0.2') - -- def links_will_use_github_option_if_defined(self): -+ def test_links_will_use_github_option_if_defined(self): - kwargs = { - 'release_uri': None, - 'issue_uri': None, -@@ -80,7 +80,7 @@ class presentation(Spec): - ): - self._test_link(kwargs, type_, expected) - -- def issue_links_prefer_explicit_setting_over_github_setting(self): -+ def test_issue_links_prefer_explicit_setting_over_github_setting(self): - kwargs = { - 'release_uri': None, - 'issue_uri': 'explicit_issue_%s', -@@ -88,7 +88,7 @@ class presentation(Spec): - } - self._test_link(kwargs, 'issue', 'explicit_issue_15') - -- def release_links_prefer_explicit_setting_over_github_setting(self): -+ def test_release_links_prefer_explicit_setting_over_github_setting(self): - kwargs = { - 'release_uri': 'explicit_release_%s', - 'issue_uri': None, -@@ -96,7 +96,7 @@ class presentation(Spec): - } - self._test_link(kwargs, 'release', 'explicit_release_1.0.2') - -- def completely_blank_uri_settings_does_not_asplode(self): -+ def test_completely_blank_uri_settings_does_not_asplode(self): - kwargs = { - 'release_uri': None, - 'issue_uri': None, -@@ -117,48 +117,48 @@ class presentation(Spec): - def _assert_prefix(self, entries, expectation): - assert expectation in self._generate(*entries)[0][0][0] - -- def bugs_marked_as_bugs(self): -+ def test_bugs_marked_as_bugs(self): - self._assert_prefix(['1.0.2', self.b], 'Bug') - -- def features_marked_as_features(self): -+ def test_features_marked_as_features(self): - self._assert_prefix(['1.1.0', self.f], 'Feature') - -- def support_marked_as_support(self): -+ def test_support_marked_as_support(self): - self._assert_prefix(['1.1.0', self.s], 'Support') - -- def dashed_issues_appear_as_unlinked_issues(self): -+ def test_dashed_issues_appear_as_unlinked_issues(self): - node = self._generate('1.0.2', b('-')) - assert not isinstance(node[0][2], reference) - -- def zeroed_issues_appear_as_unlinked_issues(self): -+ def test_zeroed_issues_appear_as_unlinked_issues(self): - node = self._generate('1.0.2', b(0)) - assert not isinstance(node[0][2], reference) - -- def un_prefixed_list_items_appear_as_unlinked_bugs(self): -+ def test_un_prefixed_list_items_appear_as_unlinked_bugs(self): - fake = list_item('', paragraph('', '', - Text("fixes an issue in "), literal('', 'methodname'))) - node = self._generate('1.0.2', fake) - # [, , , , ] -- eq_(len(node[0]), 5) -+ assert len(node[0]) == 5 - assert 'Bug' in str(node[0][0]) - assert 'fixes an issue' in str(node[0][3]) - assert 'methodname' in str(node[0][4]) - -- def un_prefixed_list_items_get_no_prefix_under_unstable_prehistory(self): -+ def test_un_prefixed_list_items_get_no_prefix_under_unstable_prehistory(self): - app = make_app(unstable_prehistory=True) - fake = list_item('', paragraph('', '', raw('', 'whatever'))) - node = self._generate('0.1.0', fake, app=app, skip_initial=True) - # [] -- eq_(len(node[0]), 1) -+ assert len(node[0]) == 1 - assert 'Bug' not in str(node[0][0]) - assert 'whatever' in str(node[0][0]) - -- def issues_remain_wrapped_in_unordered_list_nodes(self): -+ def test_issues_remain_wrapped_in_unordered_list_nodes(self): - node = self._generate('1.0.2', self.b, raw=True)[0][1] - _expect_type(node, bullet_list) - _expect_type(node[0], list_item) - -- def release_headers_have_local_style_tweaks(self): -+ def test_release_headers_have_local_style_tweaks(self): - node = self._generate('1.0.2', self.b, raw=True)[0][0] - _expect_type(node, raw) - # Header w/ bottom margin -@@ -166,18 +166,18 @@ class presentation(Spec): - # Date span w/ font-size - assert ' + +- Delete migrate-to-pytest.patch +- Delete remove-mock.patch +- Add remove-icecream.patch +- Update to 2.1.1: + * [Bug]: Fix up an internal utility which monkeypatches a + Sphinx/docutils internal, so that it accepts arbitrary args/kwargs + instead of exploding on newer Sphinxes. +- 2.0.1: + * [Bug]: Fix up an internal utility which monkeypatches a + Sphinx/docutils internal, so that it accepts arbitrary args/kwargs + instead of exploding on newer Sphinxes. +- 2.1.0: + * [Feature]: Allow controlling the name of your development branch + for source code links (eg “Next 1.x feature release” section + headers) via the new releases_development_branch config option. + * [Feature]: Add a new configuration setting, + releases_supported_versions, allowing you to limit how many “Next + 1.x feature release” (or bugfix, etc) sections appear at the top + of your changelog. +- 2.0.0: + * [Bug]: Don’t make tmpdirs in releases.util.make_app when being + given explicit directory args. + * [Bug]: Changelog transformation sometimes failed to occur when + running under a ‘single HTML file’ Sphinx builder (eg singlehtml), + which resulted in ‘unknown node’ errors. This has been fixed. + * [Support]: Migrated the test suite to use pytest-relaxed (and thus + pytest) instead of spec. + * [Support]: Dropped support for Sphinx <4. We tried to support + 1.8+, but too many transitive dependencies have clearly “moved on” + and cause various cells in the test matrix to fail hard. + * [Support]: Dropped support for Python 2.7, Python 3.4, and Python + 3.5, to align slightly better with upstream (and ecosystem) EOLs. + * [Support]: The releases_release_uri/releases_issue_uri settings + now allow modern (.format/f-strings) string formatting, in + addition to the old %s-based interpolation. + * [Support]: Administrivia overhaul: enhanced README, packaging + metadata cleaned up/expanded, CI moved to Circle-CI, renamed dev + branch to main, and more besides. + ------------------------------------------------------------------- Fri Apr 21 12:32:52 UTC 2023 - Dirk Müller diff --git a/python-releases.spec b/python-releases.spec index 351adcd..df8c3e3 100644 --- a/python-releases.spec +++ b/python-releases.spec @@ -17,7 +17,6 @@ %global flavor @BUILD_FLAVOR@%{nil} -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %if "%{flavor}" == "test" %define psuffix -%{flavor} %bcond_without test @@ -27,29 +26,28 @@ %endif %{?sle15_python_module_pythons} Name: python-releases%{psuffix} -Version: 1.6.3 +Version: 2.1.1 Release: 0 Summary: A Sphinx extension for changelog manipulation License: BSD-2-Clause URL: https://github.com/bitprophet/releases Source: https://files.pythonhosted.org/packages/source/r/releases/releases-%{version}.tar.gz Patch0: semanticversioning.patch -Patch1: migrate-to-pytest.patch -Patch2: remove-mock.patch +# PATCH-FIX-OPENSUSE remove-icecream.patch to remove icecream dependency +Patch1: remove-icecream.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-Sphinx >= 1.3 +Requires: python-Sphinx >= 4 Requires: python-semantic_version -Requires: python-six >= 1.4.1 BuildArch: noarch %if %{with test} -BuildRequires: %{python_module Sphinx >= 1.3} +BuildRequires: %{python_module Sphinx >= 3} BuildRequires: %{python_module invocations} BuildRequires: %{python_module invoke} +BuildRequires: %{python_module pytest-relaxed} BuildRequires: %{python_module pytest} BuildRequires: %{python_module semantic_version} -BuildRequires: %{python_module six >= 1.4.1} %endif %python_subpackages @@ -84,14 +82,15 @@ Specifically: %if %{with test} %check -%pytest +%pytest tests %endif %if !%{with test} %files %{python_files} %doc README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/releases +%{python_sitelib}/releases-%{version}*-info %endif %changelog diff --git a/releases-1.6.3.tar.gz b/releases-1.6.3.tar.gz deleted file mode 100644 index 95fffef..0000000 --- a/releases-1.6.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:555ae4c97a671a420281c1c782e9236be25157b449fdf20b4c4b293fe93db2f1 -size 40510 diff --git a/releases-2.1.1.tar.gz b/releases-2.1.1.tar.gz new file mode 100644 index 0000000..2c525c5 --- /dev/null +++ b/releases-2.1.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae0683c3f309931a3717c6976e0f079929d05d34214b432a95764e61367f58d1 +size 43034 diff --git a/remove-icecream.patch b/remove-icecream.patch new file mode 100644 index 0000000..35db0cb --- /dev/null +++ b/remove-icecream.patch @@ -0,0 +1,10 @@ +Index: releases-2.1.1/tests/conftest.py +=================================================================== +--- releases-2.1.1.orig/tests/conftest.py ++++ releases-2.1.1/tests/conftest.py +@@ -1,5 +0,0 @@ +-from icecream import ic, install as install_ic +- +- +-install_ic() +-ic.configureOutput(includeContext=True) diff --git a/remove-mock.patch b/remove-mock.patch deleted file mode 100644 index 4a77e29..0000000 --- a/remove-mock.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: releases-1.6.3/tests/_util.py -=================================================================== ---- releases-1.6.3.orig/tests/_util.py -+++ releases-1.6.3/tests/_util.py -@@ -1,7 +1,7 @@ - from docutils.nodes import ( - list_item, paragraph, - ) --from mock import Mock -+from unittest.mock import Mock - import six - - from releases import ( diff --git a/semanticversioning.patch b/semanticversioning.patch index 2aeff52..ddfa184 100644 --- a/semanticversioning.patch +++ b/semanticversioning.patch @@ -28,11 +28,11 @@ of `releases` even if users haven't yet upgraded python-semanticversion. releases/models.py | 54 ++++++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 26 deletions(-) -diff --git a/releases/__init__.py b/releases/__init__.py -index 3c73f0b..48fc5f5 100644 ---- a/releases/__init__.py -+++ b/releases/__init__.py -@@ -426,7 +426,7 @@ def handle_upcoming_major_release(entries, manager): +Index: releases-2.1.1/releases/__init__.py +=================================================================== +--- releases-2.1.1.orig/releases/__init__.py ++++ releases-2.1.1/releases/__init__.py +@@ -425,7 +425,7 @@ def handle_upcoming_major_release(entrie # to the line manager! for obj in next_releases: # TODO: update when Release gets tied closer w/ Version @@ -41,31 +41,29 @@ index 3c73f0b..48fc5f5 100644 if version.minor == 0 and version.patch == 0: manager.add_family(obj.family) -diff --git a/releases/models.py b/releases/models.py -index d980e9c..0517174 100644 ---- a/releases/models.py -+++ b/releases/models.py -@@ -2,18 +2,10 @@ +Index: releases-2.1.1/releases/models.py +=================================================================== +--- releases-2.1.1.orig/releases/models.py ++++ releases-2.1.1/releases/models.py +@@ -2,16 +2,7 @@ from functools import reduce from operator import xor from docutils import nodes -from semantic_version import Version as StrictVersion, Spec -+from semantic_version import Version, Spec - import six - - +- +- -class Version(StrictVersion): - """ - Version subclass toggling ``partial=True`` by default. - """ +- - def __init__(self, version_string, partial=True): -- super(Version, self).__init__(version_string, partial) -- -- +- super().__init__(version_string, partial) ++from semantic_version import Version, Spec + + # Issue type list (keys) + color values - ISSUE_TYPES = { - 'bug': 'A04040', -@@ -122,7 +114,7 @@ def default_spec(self, manager): +@@ -119,7 +110,7 @@ class Issue(nodes.Element): buckets = self.minor_releases(manager) if buckets: specstr = ">={}".format(max(buckets)) @@ -74,7 +72,7 @@ index d980e9c..0517174 100644 def add_to_manager(self, manager): """ -@@ -130,32 +122,43 @@ def add_to_manager(self, manager): +@@ -127,27 +118,37 @@ class Issue(nodes.Element): """ # Derive version spec allowing us to filter against major/minor buckets spec = self.spec or self.default_spec(manager) @@ -97,7 +95,7 @@ index d980e9c..0517174 100644 + versions = { + Version.coerce(x): x for x in manager[family] - if not x.startswith('unreleased') + if not x.startswith("unreleased") - ] - # Select matching release lines (& stringify) + } @@ -127,17 +125,3 @@ index d980e9c..0517174 100644 # Don't put into JUST unreleased_bugfix; it implies that this # major release/family hasn't actually seen any releases yet # and only exists for features to go into. - if bugfix_buckets: - buckets.append('unreleased_bugfix') -+ - # Obtain list of minor releases to check for "haven't had ANY - # releases yet" corner case, in which case ALL issues get thrown in - # unreleased_feature for the first release to consume. -@@ -164,6 +167,7 @@ def add_to_manager(self, manager): - no_releases = not self.minor_releases(manager) - if self.is_featurelike or self.backported or no_releases: - buckets.append('unreleased_feature') -+ - # Now that we know which buckets are appropriate, add ourself to - # all of them. TODO: or just...do it above...instead... - for bucket in buckets: