From fa0dd5652d82f8d238742f2d50c5514dec6f29a8 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 26 Aug 2019 22:00:18 +0100 Subject: [PATCH 01/16] Mark strings as raw Resolves the following deprecation warning: DeprecationWarning: invalid escape sequence \. Change-Id: If0bc30e646a3bb35c02dc73cc31fb146b3ecd6b5 Signed-off-by: Stephen Finucane --- pbr/git.py | 6 +++--- pbr/packaging.py | 28 ++++++++++++++-------------- pbr/tests/test_packaging.py | 12 ++++++------ pbr/tests/test_setup.py | 4 ++-- pbr/tests/test_wsgi.py | 2 +- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pbr/git.py b/pbr/git.py index 6e0e346..7a3cb2d 100644 --- a/pbr/git.py +++ b/pbr/git.py @@ -156,9 +156,9 @@ def _clean_changelog_message(msg): * Escapes '`' which is interpreted as a literal """ - msg = msg.replace('*', '\*') - msg = msg.replace('_', '\_') - msg = msg.replace('`', '\`') + msg = msg.replace('*', r'\*') + msg = msg.replace('_', r'\_') + msg = msg.replace('`', r'\`') return msg diff --git a/pbr/packaging.py b/pbr/packaging.py index 0947de2..932ccdb 100644 --- a/pbr/packaging.py +++ b/pbr/packaging.py @@ -110,20 +110,20 @@ def get_reqs_from_files(requirements_files): def egg_fragment(match): return re.sub(r'(?P[\w.-]+)-' - '(?P' - '(?P' - '(?P0|[1-9][0-9]*)\.' - '(?P0|[1-9][0-9]*)\.' - '(?P0|[1-9][0-9]*)){1}' - '(?P(?:\-' - '(?P(?:(?=[0]{1}[0-9A-Za-z-]{0})(?:[0]{1})|' - '(?=[1-9]{1}[0-9]*[A-Za-z]{0})(?:[0-9]+)|' - '(?=[0-9]*[A-Za-z-]+[0-9A-Za-z-]*)(?:[0-9A-Za-z-]+)){1}' - '(?:\.(?=[0]{1}[0-9A-Za-z-]{0})(?:[0]{1})|' - '\.(?=[1-9]{1}[0-9]*[A-Za-z]{0})(?:[0-9]+)|' - '\.(?=[0-9]*[A-Za-z-]+[0-9A-Za-z-]*)' - '(?:[0-9A-Za-z-]+))*){1}){0,1}(?:\+' - '(?P(?:[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))){0,1}))', + r'(?P' + r'(?P' + r'(?P0|[1-9][0-9]*)\.' + r'(?P0|[1-9][0-9]*)\.' + r'(?P0|[1-9][0-9]*)){1}' + r'(?P(?:\-' + r'(?P(?:(?=[0]{1}[0-9A-Za-z-]{0})(?:[0]{1})|' + r'(?=[1-9]{1}[0-9]*[A-Za-z]{0})(?:[0-9]+)|' + r'(?=[0-9]*[A-Za-z-]+[0-9A-Za-z-]*)(?:[0-9A-Za-z-]+)){1}' + r'(?:\.(?=[0]{1}[0-9A-Za-z-]{0})(?:[0]{1})|' + r'\.(?=[1-9]{1}[0-9]*[A-Za-z]{0})(?:[0-9]+)|' + r'\.(?=[0-9]*[A-Za-z-]+[0-9A-Za-z-]*)' + r'(?:[0-9A-Za-z-]+))*){1}){0,1}(?:\+' + r'(?P(?:[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))){0,1}))', r'\g>=\g', match.groups()[-1]) diff --git a/pbr/tests/test_packaging.py b/pbr/tests/test_packaging.py index 811715b..c7dafda 100644 --- a/pbr/tests/test_packaging.py +++ b/pbr/tests/test_packaging.py @@ -108,7 +108,7 @@ class GPGKeyFixture(fixtures.Fixture): def setUp(self): super(GPGKeyFixture, self).setUp() tempdir = self.useFixture(fixtures.TempDir()) - gnupg_version_re = re.compile('^gpg\s.*\s([\d+])\.([\d+])\.([\d+])') + gnupg_version_re = re.compile(r'^gpg\s.*\s([\d+])\.([\d+])\.([\d+])') gnupg_version = base._run_cmd(['gpg', '--version'], tempdir.path) for line in gnupg_version[0].split('\n'): gnupg_version = gnupg_version_re.match(line) @@ -293,23 +293,23 @@ class TestPackagingInGitRepoWithCommit(base.BaseTestCase): self.run_setup('sdist', allow_fail=False) with open(os.path.join(self.package_dir, 'ChangeLog'), 'r') as f: body = f.read() - self.assertIn('\*', body) + self.assertIn(r'\*', body) def test_changelog_handles_dead_links_in_commit(self): self.repo.commit(message_content="See os_ for to_do about qemu_.") self.run_setup('sdist', allow_fail=False) with open(os.path.join(self.package_dir, 'ChangeLog'), 'r') as f: body = f.read() - self.assertIn('os\_', body) - self.assertIn('to\_do', body) - self.assertIn('qemu\_', body) + self.assertIn(r'os\_', body) + self.assertIn(r'to\_do', body) + self.assertIn(r'qemu\_', body) def test_changelog_handles_backticks(self): self.repo.commit(message_content="Allow `openstack.org` to `work") self.run_setup('sdist', allow_fail=False) with open(os.path.join(self.package_dir, 'ChangeLog'), 'r') as f: body = f.read() - self.assertIn('\`', body) + self.assertIn(r'\`', body) def test_manifest_exclude_honoured(self): self.run_setup('sdist', allow_fail=False) diff --git a/pbr/tests/test_setup.py b/pbr/tests/test_setup.py index 85d40eb..0e60df7 100644 --- a/pbr/tests/test_setup.py +++ b/pbr/tests/test_setup.py @@ -162,7 +162,7 @@ class GitLogsTest(base.BaseTestCase): self.assertIn("------", changelog_contents) self.assertIn("Refactor hooks file", changelog_contents) self.assertIn( - "Bug fix: create\_stack() fails when waiting", + r"Bug fix: create\_stack() fails when waiting", changelog_contents) self.assertNotIn("Refactor hooks file.", changelog_contents) self.assertNotIn("182feb3", changelog_contents) @@ -176,7 +176,7 @@ class GitLogsTest(base.BaseTestCase): self.assertNotIn("ev)il", changelog_contents) self.assertNotIn("e(vi)l", changelog_contents) self.assertNotIn('Merge "', changelog_contents) - self.assertNotIn('1\_foo.1', changelog_contents) + self.assertNotIn(r'1\_foo.1', changelog_contents) def test_generate_authors(self): author_old = u"Foo Foo " diff --git a/pbr/tests/test_wsgi.py b/pbr/tests/test_wsgi.py index 18732f7..a42fe78 100644 --- a/pbr/tests/test_wsgi.py +++ b/pbr/tests/test_wsgi.py @@ -98,7 +98,7 @@ class TestWsgiScripts(base.BaseTestCase): stdoutdata = p.stdout.readline() # Available at ... print(stdoutdata) - m = re.search(b'(http://[^:]+:\d+)/', stdoutdata) + m = re.search(br'(http://[^:]+:\d+)/', stdoutdata) self.assertIsNotNone(m, "Regex failed to match on %s" % stdoutdata) stdoutdata = p.stdout.readline() # DANGER! ... -- GitLab From 57d7c53739487e9fa0051ae12d8609acebaaf0e1 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 26 Aug 2019 22:00:28 +0100 Subject: [PATCH 02/16] Update to latest hacking Change-Id: If73238a39d0934c6f577fc52132fcbc63e8eb25f Signed-off-by: Stephen Finucane --- pbr/builddoc.py | 10 +- pbr/git.py | 14 +- pbr/options.py | 4 +- pbr/packaging.py | 2 + pbr/tests/test_packaging.py | 212 ++++++++++++----------- pbr/tests/test_setup.py | 6 +- pbr/tests/testpackage/doc/source/conf.py | 17 +- pbr/tests/util.py | 4 +- pbr/util.py | 7 +- pbr/version.py | 4 +- test-requirements.txt | 3 +- tox.ini | 6 +- 12 files changed, 141 insertions(+), 148 deletions(-) diff --git a/pbr/builddoc.py b/pbr/builddoc.py index f5c66ce..276eec6 100644 --- a/pbr/builddoc.py +++ b/pbr/builddoc.py @@ -132,11 +132,11 @@ class LocalBuildDoc(setup_command.BuildDoc): autoindex.write(" %s.rst\n" % module) def _sphinx_tree(self): - source_dir = self._get_source_dir() - cmd = ['-H', 'Modules', '-o', source_dir, '.'] - if apidoc_use_padding: - cmd.insert(0, 'apidoc') - apidoc.main(cmd + self.autodoc_tree_excludes) + source_dir = self._get_source_dir() + cmd = ['-H', 'Modules', '-o', source_dir, '.'] + if apidoc_use_padding: + cmd.insert(0, 'apidoc') + apidoc.main(cmd + self.autodoc_tree_excludes) def _sphinx_run(self): if not self.verbose: diff --git a/pbr/git.py b/pbr/git.py index 7a3cb2d..f1d7c50 100644 --- a/pbr/git.py +++ b/pbr/git.py @@ -276,13 +276,14 @@ def write_git_changelog(git_dir=None, dest_dir=os.path.curdir, changelog = _iter_changelog(changelog) if not changelog: return + new_changelog = os.path.join(dest_dir, 'ChangeLog') - # If there's already a ChangeLog and it's not writable, just use it - if (os.path.exists(new_changelog) - and not os.access(new_changelog, os.W_OK)): + if os.path.exists(new_changelog) and not os.access(new_changelog, os.W_OK): + # If there's already a ChangeLog and it's not writable, just use it log.info('[pbr] ChangeLog not written (file already' ' exists and it is not writeable)') return + log.info('[pbr] Writing ChangeLog') with io.open(new_changelog, "w", encoding="utf-8") as changelog_file: for release, content in changelog: @@ -297,13 +298,14 @@ def generate_authors(git_dir=None, dest_dir='.', option_dict=dict()): 'SKIP_GENERATE_AUTHORS') if should_skip: return + start = time.time() old_authors = os.path.join(dest_dir, 'AUTHORS.in') new_authors = os.path.join(dest_dir, 'AUTHORS') - # If there's already an AUTHORS file and it's not writable, just use it - if (os.path.exists(new_authors) - and not os.access(new_authors, os.W_OK)): + if os.path.exists(new_authors) and not os.access(new_authors, os.W_OK): + # If there's already an AUTHORS file and it's not writable, just use it return + log.info('[pbr] Generating AUTHORS') ignore_emails = '((jenkins|zuul)@review|infra@lists|jenkins@openstack)' if git_dir is None: diff --git a/pbr/options.py b/pbr/options.py index 105b200..2313cc4 100644 --- a/pbr/options.py +++ b/pbr/options.py @@ -48,6 +48,6 @@ TRUE_VALUES = ('true', '1', 'yes') def get_boolean_option(option_dict, option_name, env_name): - return ((option_name in option_dict - and option_dict[option_name][1].lower() in TRUE_VALUES) or + return ((option_name in option_dict and + option_dict[option_name][1].lower() in TRUE_VALUES) or str(os.getenv(env_name)).lower() in TRUE_VALUES) diff --git a/pbr/packaging.py b/pbr/packaging.py index 932ccdb..a697992 100644 --- a/pbr/packaging.py +++ b/pbr/packaging.py @@ -328,6 +328,7 @@ except ImportError: def have_nose(): return _have_nose + _wsgi_text = """#PBR Generated from %(group)r import threading @@ -652,6 +653,7 @@ class LocalSDist(sdist.sdist): self.filelist.sort() sdist.sdist.make_distribution(self) + try: from pbr import builddoc _have_sphinx = True diff --git a/pbr/tests/test_packaging.py b/pbr/tests/test_packaging.py index c7dafda..9a3778e 100644 --- a/pbr/tests/test_packaging.py +++ b/pbr/tests/test_packaging.py @@ -765,8 +765,10 @@ class TestVersions(base.BaseTestCase): def test_get_kwargs_corner_cases(self): # No tags: - git_dir = self.repo._basedir + '/.git' - get_kwargs = lambda tag: packaging._get_increment_kwargs(git_dir, tag) + + def get_kwargs(tag): + git_dir = self.repo._basedir + '/.git' + return packaging._get_increment_kwargs(git_dir, tag) def _check_combinations(tag): self.repo.commit() @@ -947,109 +949,109 @@ class TestRepositoryURLDependencies(base.BaseTestCase): 'pypi-proj1', 'pypi-proj2'])) def test_egg_fragment(self): - expected = [ - 'django-thumborize', - 'django-thumborize-beta', - 'django-thumborize2-beta', - 'django-thumborize2-beta>=4.0.1', - 'django-thumborize2-beta>=1.0.0-alpha.beta.1', - 'django-thumborize2-beta>=1.0.0-alpha-a.b-c-long+build.1-aef.1-its-okay', # noqa - 'django-thumborize2-beta>=2.0.0-rc.1+build.123', - 'django-thumborize-beta>=0.0.4', - 'django-thumborize-beta>=1.2.3', - 'django-thumborize-beta>=10.20.30', - 'django-thumborize-beta>=1.1.2-prerelease+meta', - 'django-thumborize-beta>=1.1.2+meta', - 'django-thumborize-beta>=1.1.2+meta-valid', - 'django-thumborize-beta>=1.0.0-alpha', - 'django-thumborize-beta>=1.0.0-beta', - 'django-thumborize-beta>=1.0.0-alpha.beta', - 'django-thumborize-beta>=1.0.0-alpha.beta.1', - 'django-thumborize-beta>=1.0.0-alpha.1', - 'django-thumborize-beta>=1.0.0-alpha0.valid', - 'django-thumborize-beta>=1.0.0-alpha.0valid', - 'django-thumborize-beta>=1.0.0-alpha-a.b-c-somethinglong+build.1-aef.1-its-okay', # noqa - 'django-thumborize-beta>=1.0.0-rc.1+build.1', - 'django-thumborize-beta>=2.0.0-rc.1+build.123', - 'django-thumborize-beta>=1.2.3-beta', - 'django-thumborize-beta>=10.2.3-DEV-SNAPSHOT', - 'django-thumborize-beta>=1.2.3-SNAPSHOT-123', - 'django-thumborize-beta>=1.0.0', - 'django-thumborize-beta>=2.0.0', - 'django-thumborize-beta>=1.1.7', - 'django-thumborize-beta>=2.0.0+build.1848', - 'django-thumborize-beta>=2.0.1-alpha.1227', - 'django-thumborize-beta>=1.0.0-alpha+beta', - 'django-thumborize-beta>=1.2.3----RC-SNAPSHOT.12.9.1--.12+788', - 'django-thumborize-beta>=1.2.3----R-S.12.9.1--.12+meta', - 'django-thumborize-beta>=1.2.3----RC-SNAPSHOT.12.9.1--.12', - 'django-thumborize-beta>=1.0.0+0.build.1-rc.10000aaa-kk-0.1', - 'django-thumborize-beta>=999999999999999999.99999999999999.9999999999999', # noqa - 'Proj1', - 'Proj2>=0.0.1', - 'Proj3', - 'Proj4>=0.0.2', - 'Proj5', - 'Proj>=0.0.3', - 'Proj', - 'Proj>=0.0.4', - 'Proj', - 'foo-bar>=1.2.4', - ] - tests = [ - 'egg=django-thumborize', - 'egg=django-thumborize-beta', - 'egg=django-thumborize2-beta', - 'egg=django-thumborize2-beta-4.0.1', - 'egg=django-thumborize2-beta-1.0.0-alpha.beta.1', - 'egg=django-thumborize2-beta-1.0.0-alpha-a.b-c-long+build.1-aef.1-its-okay', # noqa - 'egg=django-thumborize2-beta-2.0.0-rc.1+build.123', - 'egg=django-thumborize-beta-0.0.4', - 'egg=django-thumborize-beta-1.2.3', - 'egg=django-thumborize-beta-10.20.30', - 'egg=django-thumborize-beta-1.1.2-prerelease+meta', - 'egg=django-thumborize-beta-1.1.2+meta', - 'egg=django-thumborize-beta-1.1.2+meta-valid', - 'egg=django-thumborize-beta-1.0.0-alpha', - 'egg=django-thumborize-beta-1.0.0-beta', - 'egg=django-thumborize-beta-1.0.0-alpha.beta', - 'egg=django-thumborize-beta-1.0.0-alpha.beta.1', - 'egg=django-thumborize-beta-1.0.0-alpha.1', - 'egg=django-thumborize-beta-1.0.0-alpha0.valid', - 'egg=django-thumborize-beta-1.0.0-alpha.0valid', - 'egg=django-thumborize-beta-1.0.0-alpha-a.b-c-somethinglong+build.1-aef.1-its-okay', # noqa - 'egg=django-thumborize-beta-1.0.0-rc.1+build.1', - 'egg=django-thumborize-beta-2.0.0-rc.1+build.123', - 'egg=django-thumborize-beta-1.2.3-beta', - 'egg=django-thumborize-beta-10.2.3-DEV-SNAPSHOT', - 'egg=django-thumborize-beta-1.2.3-SNAPSHOT-123', - 'egg=django-thumborize-beta-1.0.0', - 'egg=django-thumborize-beta-2.0.0', - 'egg=django-thumborize-beta-1.1.7', - 'egg=django-thumborize-beta-2.0.0+build.1848', - 'egg=django-thumborize-beta-2.0.1-alpha.1227', - 'egg=django-thumborize-beta-1.0.0-alpha+beta', - 'egg=django-thumborize-beta-1.2.3----RC-SNAPSHOT.12.9.1--.12+788', # noqa - 'egg=django-thumborize-beta-1.2.3----R-S.12.9.1--.12+meta', - 'egg=django-thumborize-beta-1.2.3----RC-SNAPSHOT.12.9.1--.12', - 'egg=django-thumborize-beta-1.0.0+0.build.1-rc.10000aaa-kk-0.1', # noqa - 'egg=django-thumborize-beta-999999999999999999.99999999999999.9999999999999', # noqa - 'egg=Proj1', - 'egg=Proj2-0.0.1', - 'egg=Proj3', - 'egg=Proj4-0.0.2', - 'egg=Proj5', - 'egg=Proj-0.0.3', - 'egg=Proj', - 'egg=Proj-0.0.4', - 'egg=Proj', - 'egg=foo-bar-1.2.4', - ] - for index, test in enumerate(tests): - self.assertEqual(expected[index], - re.sub(r'egg=([^&]+).*$', - packaging.egg_fragment, - test)) + expected = [ + 'django-thumborize', + 'django-thumborize-beta', + 'django-thumborize2-beta', + 'django-thumborize2-beta>=4.0.1', + 'django-thumborize2-beta>=1.0.0-alpha.beta.1', + 'django-thumborize2-beta>=1.0.0-alpha-a.b-c-long+build.1-aef.1-its-okay', # noqa + 'django-thumborize2-beta>=2.0.0-rc.1+build.123', + 'django-thumborize-beta>=0.0.4', + 'django-thumborize-beta>=1.2.3', + 'django-thumborize-beta>=10.20.30', + 'django-thumborize-beta>=1.1.2-prerelease+meta', + 'django-thumborize-beta>=1.1.2+meta', + 'django-thumborize-beta>=1.1.2+meta-valid', + 'django-thumborize-beta>=1.0.0-alpha', + 'django-thumborize-beta>=1.0.0-beta', + 'django-thumborize-beta>=1.0.0-alpha.beta', + 'django-thumborize-beta>=1.0.0-alpha.beta.1', + 'django-thumborize-beta>=1.0.0-alpha.1', + 'django-thumborize-beta>=1.0.0-alpha0.valid', + 'django-thumborize-beta>=1.0.0-alpha.0valid', + 'django-thumborize-beta>=1.0.0-alpha-a.b-c-somethinglong+build.1-aef.1-its-okay', # noqa + 'django-thumborize-beta>=1.0.0-rc.1+build.1', + 'django-thumborize-beta>=2.0.0-rc.1+build.123', + 'django-thumborize-beta>=1.2.3-beta', + 'django-thumborize-beta>=10.2.3-DEV-SNAPSHOT', + 'django-thumborize-beta>=1.2.3-SNAPSHOT-123', + 'django-thumborize-beta>=1.0.0', + 'django-thumborize-beta>=2.0.0', + 'django-thumborize-beta>=1.1.7', + 'django-thumborize-beta>=2.0.0+build.1848', + 'django-thumborize-beta>=2.0.1-alpha.1227', + 'django-thumborize-beta>=1.0.0-alpha+beta', + 'django-thumborize-beta>=1.2.3----RC-SNAPSHOT.12.9.1--.12+788', + 'django-thumborize-beta>=1.2.3----R-S.12.9.1--.12+meta', + 'django-thumborize-beta>=1.2.3----RC-SNAPSHOT.12.9.1--.12', + 'django-thumborize-beta>=1.0.0+0.build.1-rc.10000aaa-kk-0.1', + 'django-thumborize-beta>=999999999999999999.99999999999999.9999999999999', # noqa + 'Proj1', + 'Proj2>=0.0.1', + 'Proj3', + 'Proj4>=0.0.2', + 'Proj5', + 'Proj>=0.0.3', + 'Proj', + 'Proj>=0.0.4', + 'Proj', + 'foo-bar>=1.2.4', + ] + tests = [ + 'egg=django-thumborize', + 'egg=django-thumborize-beta', + 'egg=django-thumborize2-beta', + 'egg=django-thumborize2-beta-4.0.1', + 'egg=django-thumborize2-beta-1.0.0-alpha.beta.1', + 'egg=django-thumborize2-beta-1.0.0-alpha-a.b-c-long+build.1-aef.1-its-okay', # noqa + 'egg=django-thumborize2-beta-2.0.0-rc.1+build.123', + 'egg=django-thumborize-beta-0.0.4', + 'egg=django-thumborize-beta-1.2.3', + 'egg=django-thumborize-beta-10.20.30', + 'egg=django-thumborize-beta-1.1.2-prerelease+meta', + 'egg=django-thumborize-beta-1.1.2+meta', + 'egg=django-thumborize-beta-1.1.2+meta-valid', + 'egg=django-thumborize-beta-1.0.0-alpha', + 'egg=django-thumborize-beta-1.0.0-beta', + 'egg=django-thumborize-beta-1.0.0-alpha.beta', + 'egg=django-thumborize-beta-1.0.0-alpha.beta.1', + 'egg=django-thumborize-beta-1.0.0-alpha.1', + 'egg=django-thumborize-beta-1.0.0-alpha0.valid', + 'egg=django-thumborize-beta-1.0.0-alpha.0valid', + 'egg=django-thumborize-beta-1.0.0-alpha-a.b-c-somethinglong+build.1-aef.1-its-okay', # noqa + 'egg=django-thumborize-beta-1.0.0-rc.1+build.1', + 'egg=django-thumborize-beta-2.0.0-rc.1+build.123', + 'egg=django-thumborize-beta-1.2.3-beta', + 'egg=django-thumborize-beta-10.2.3-DEV-SNAPSHOT', + 'egg=django-thumborize-beta-1.2.3-SNAPSHOT-123', + 'egg=django-thumborize-beta-1.0.0', + 'egg=django-thumborize-beta-2.0.0', + 'egg=django-thumborize-beta-1.1.7', + 'egg=django-thumborize-beta-2.0.0+build.1848', + 'egg=django-thumborize-beta-2.0.1-alpha.1227', + 'egg=django-thumborize-beta-1.0.0-alpha+beta', + 'egg=django-thumborize-beta-1.2.3----RC-SNAPSHOT.12.9.1--.12+788', # noqa + 'egg=django-thumborize-beta-1.2.3----R-S.12.9.1--.12+meta', + 'egg=django-thumborize-beta-1.2.3----RC-SNAPSHOT.12.9.1--.12', + 'egg=django-thumborize-beta-1.0.0+0.build.1-rc.10000aaa-kk-0.1', # noqa + 'egg=django-thumborize-beta-999999999999999999.99999999999999.9999999999999', # noqa + 'egg=Proj1', + 'egg=Proj2-0.0.1', + 'egg=Proj3', + 'egg=Proj4-0.0.2', + 'egg=Proj5', + 'egg=Proj-0.0.3', + 'egg=Proj', + 'egg=Proj-0.0.4', + 'egg=Proj', + 'egg=foo-bar-1.2.4', + ] + for index, test in enumerate(tests): + self.assertEqual(expected[index], + re.sub(r'egg=([^&]+).*$', + packaging.egg_fragment, + test)) def test_parse_repo_url_requirements(self): result = packaging.parse_requirements([self.requirements]) diff --git a/pbr/tests/test_setup.py b/pbr/tests/test_setup.py index 0e60df7..d171d7c 100644 --- a/pbr/tests/test_setup.py +++ b/pbr/tests/test_setup.py @@ -93,8 +93,9 @@ class SkipFileWrites(base.BaseTestCase): option_dict=self.option_dict) self.assertEqual( not os.path.exists(self.filename), - (self.option_value.lower() in options.TRUE_VALUES - or self.env_value is not None)) + (self.option_value.lower() in options.TRUE_VALUES or + self.env_value is not None)) + _changelog_content = """7780758\x00Break parser\x00 (tag: refs/tags/1_foo.1) 04316fe\x00Make python\x00 (refs/heads/review/monty_taylor/27519) @@ -125,6 +126,7 @@ def _make_old_git_changelog_format(line): refname = refname.replace('tag: ', '') return '\x00'.join((sha, msg, refname)) + _old_git_changelog_content = '\n'.join( _make_old_git_changelog_format(line) for line in _changelog_content.split('\n')) diff --git a/pbr/tests/testpackage/doc/source/conf.py b/pbr/tests/testpackage/doc/source/conf.py index 7358510..6edbe8e 100644 --- a/pbr/tests/testpackage/doc/source/conf.py +++ b/pbr/tests/testpackage/doc/source/conf.py @@ -12,17 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import sys -sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', - #'sphinx.ext.intersphinx', ] # autodoc generation is a bit aggressive and a nuisance when doing heavy @@ -49,16 +45,8 @@ add_module_names = True # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' -# -- Options for HTML output -------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -# html_theme_path = ["."] -# html_theme = '_theme' -# html_static_path = ['static'] -# Output file base name for HTML help builder. -htmlhelp_basename = '%sdoc' % project +# -- Options for HTML output -------------------------------------------------- # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass @@ -69,6 +57,3 @@ latex_documents = [ u'%s Documentation' % project, u'OpenStack Foundation', 'manual'), ] - -# Example configuration for intersphinx: refer to the Python standard library. -#intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/pbr/tests/util.py b/pbr/tests/util.py index 0e7bcf1..8a00c84 100644 --- a/pbr/tests/util.py +++ b/pbr/tests/util.py @@ -53,9 +53,9 @@ except ImportError: @contextlib.contextmanager def open_config(filename): if sys.version_info >= (3, 2): - cfg = configparser.ConfigParser() + cfg = configparser.ConfigParser() else: - cfg = configparser.SafeConfigParser() + cfg = configparser.SafeConfigParser() cfg.read(filename) yield cfg with open(filename, 'w') as fp: diff --git a/pbr/util.py b/pbr/util.py index 6b2e87d..1e9fdc4 100644 --- a/pbr/util.py +++ b/pbr/util.py @@ -219,10 +219,11 @@ def cfg_to_args(path='setup.cfg', script_args=()): """ # The method source code really starts here. - if sys.version_info >= (3, 2): - parser = configparser.ConfigParser() + if sys.version_info >= (3, 0): + parser = configparser.ConfigParser() else: - parser = configparser.SafeConfigParser() + parser = configparser.SafeConfigParser() + if not os.path.exists(path): raise errors.DistutilsFileError("file '%s' does not exist" % os.path.abspath(path)) diff --git a/pbr/version.py b/pbr/version.py index 5eb217a..46c6020 100644 --- a/pbr/version.py +++ b/pbr/version.py @@ -323,8 +323,8 @@ class SemanticVersion(object): version number of the component to preserve sorting. (Used for rpm support) """ - if ((self._prerelease_type or self._dev_count) - and pre_separator is None): + if ((self._prerelease_type or self._dev_count) and + pre_separator is None): segments = [self.decrement().brief_string()] pre_separator = "." else: diff --git a/test-requirements.txt b/test-requirements.txt index c30a2b1..09efec0 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,9 +1,10 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. + wheel>=0.32.0 # MIT fixtures>=3.0.0 # Apache-2.0/BSD -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0 # Apache-2.0 mock>=2.0.0 # BSD six>=1.10.0 # MIT stestr>=2.1.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index ca87002..d48c770 100644 --- a/tox.ini +++ b/tox.ini @@ -48,10 +48,8 @@ commands = coverage xml -o cover/coverage.xml [flake8] -# H405 multi line docstring summary not separated with an empty line -# H904 "Wrap lines in parentheses and not a backslash for line continuation -# Removed in current hacking (https://review.openstack.org/#/c/101701/). -ignore = H803,H904 +# W504 (you have to choose this or W503) +ignore = W504 exclude = .venv,.tox,dist,doc,*.egg,build show-source = true -- GitLab From dfe67959e662d6f6b116262b08922af17ac67e72 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 27 Aug 2019 10:26:47 +0100 Subject: [PATCH 03/16] trivial: Use 'open' context manager It's a little nicer to look at. Change-Id: If5bc9b7e3927fe3203ba9adadaa1185c4a1cc7ed Signed-off-by: Stephen Finucane --- pbr/tests/test_packaging.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pbr/tests/test_packaging.py b/pbr/tests/test_packaging.py index 9a3778e..07be547 100644 --- a/pbr/tests/test_packaging.py +++ b/pbr/tests/test_packaging.py @@ -120,9 +120,9 @@ class GPGKeyFixture(fixtures.Fixture): else: if gnupg_version is None: gnupg_version = (0, 0, 0) - config_file = tempdir.path + '/key-config' - f = open(config_file, 'wt') - try: + + config_file = os.path.join(tempdir.path, 'key-config') + with open(config_file, 'wt') as f: if gnupg_version[0] == 2 and gnupg_version[1] >= 1: f.write(""" %no-protection @@ -138,8 +138,7 @@ class GPGKeyFixture(fixtures.Fixture): Preferences: (setpref) %commit """) - finally: - f.close() + # Note that --quick-random (--debug-quick-random in GnuPG 2.x) # does not have a corresponding preferences file setting and # must be passed explicitly on the command line instead @@ -149,6 +148,7 @@ class GPGKeyFixture(fixtures.Fixture): gnupg_random = '--debug-quick-random' else: gnupg_random = '' + base._run_cmd( ['gpg', '--gen-key', '--batch', gnupg_random, config_file], tempdir.path) -- GitLab From b821df5f232e0843aced66b508c1d7355887bc9b Mon Sep 17 00:00:00 2001 From: xuanyandong Date: Sat, 26 Oct 2019 11:21:58 +0800 Subject: [PATCH 04/16] Switch to Ussuri jobs Change-Id: I059ae377aed10e5dcb0e418c6aa427aca88cf9e1 --- .zuul.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index afe7b83..7605424 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -109,8 +109,7 @@ - openstack-cover-jobs - openstack-lower-constraints-jobs - openstack-python-jobs - - openstack-python35-jobs - - openstack-python3-train-jobs + - openstack-python3-ussuri-jobs - periodic-stable-jobs - publish-openstack-docs-pti check: -- GitLab From 6eb2964c1792274cc7319013db881de3a525f754 Mon Sep 17 00:00:00 2001 From: Sandro Tosi Date: Tue, 14 Apr 2020 14:49:00 -0400 Subject: [PATCH 05/16] Drop python2 support; Closes: #938011 --- debian/changelog | 6 ++++++ debian/control | 38 -------------------------------------- debian/rules | 4 ++-- 3 files changed, 8 insertions(+), 40 deletions(-) diff --git a/debian/changelog b/debian/changelog index a8e24aa..bf83020 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-pbr (5.4.3-3) UNRELEASED; urgency=medium + + * Drop python2 support; Closes: #938011 + + -- Sandro Tosi Tue, 14 Apr 2020 13:52:49 -0400 + python-pbr (5.4.3-2) unstable; urgency=medium * Really re-introduce Python 2 support. diff --git a/debian/control b/debian/control index 656a672..4bfb125 100644 --- a/debian/control +++ b/debian/control @@ -11,8 +11,6 @@ Build-Depends: git, gnupg, openstack-pkg-tools, - python-all, - python-setuptools, python3-all, python3-setuptools, python3-sphinx, @@ -74,42 +72,6 @@ Description: inject useful and sensible default behaviors into setuptools - doc . This package provides the documentation. -Package: python-pbr -Architecture: all -Depends: - python-pkg-resources, - python-setuptools, - python-six, - ${misc:Depends}, - ${python:Depends}, -Description: inject useful and sensible default behaviors into setuptools - Python 2.x - PBR (Python Build Reasonableness) is a library that injects some useful and - sensible default behaviors into your setuptools run. PBR can: - * Manage version number based on git revisions and tags (Version file). - * Generate AUTHORS file from git log - * Generate ChangeLog from git log - * Generate Sphinx autodoc stub files for your whole module - * Store your dependencies in a pip requirements file - * Use your README file as a long_description - * Smartly find packages under your root package - . - PBR is only mildly configurable. The basic idea is that there's a decent way - to run things and if you do, you should reap the rewards, because then it's - simple and repeatable. If you want to do things differently, cool! But you've - already got the power of Python at your fingertips, so you don't really need - PBR. - . - PBR builds on top of the work that d2to1 started to provide for declarative - configuration. d2to1 is itself an implementation of the ideas behind - distutils2. Although distutils2 is now abandoned in favor of work towards PEP - 426 and Metadata 2.0, declarative config is still a great idea and - specifically important in trying to distribute setup code as a library when - that library itself will alter how the setup is processed. As Metadata 2.0 and - other modern Python packaging PEPs come out, PBR aims to support them as - quickly as possible. - . - This package provides support for Python 2.x. - Package: python3-pbr Architecture: all Depends: diff --git a/debian/rules b/debian/rules index 4186152..d160aad 100755 --- a/debian/rules +++ b/debian/rules @@ -7,7 +7,7 @@ export http_proxy=127.0.0.1:9 export https_proxy=127.0.0.1:9 %: - dh $@ --buildsystem=python_distutils --with python2,python3,sphinxdoc + dh $@ --buildsystem=python_distutils --with python3,sphinxdoc override_dh_auto_clean: rm -rf .stestr build __pycache__ @@ -16,7 +16,7 @@ override_dh_auto_build: echo "Do nothing..." override_dh_auto_install: - pkgos-dh_auto_install + pkgos-dh_auto_install --no-py2 override_dh_auto_test: ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) -- GitLab From 00441dfe22a2b8d39fec9ced8e6832cbbf28504e Mon Sep 17 00:00:00 2001 From: Sandro Tosi Date: Tue, 14 Apr 2020 14:49:04 -0400 Subject: [PATCH 06/16] releasing package python-pbr version 5.4.3-3 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bf83020..c5e1269 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -python-pbr (5.4.3-3) UNRELEASED; urgency=medium +python-pbr (5.4.3-3) unstable; urgency=medium * Drop python2 support; Closes: #938011 - -- Sandro Tosi Tue, 14 Apr 2020 13:52:49 -0400 + -- Sandro Tosi Tue, 14 Apr 2020 14:49:01 -0400 python-pbr (5.4.3-2) unstable; urgency=medium -- GitLab From a2193dfef1a33983dcd42a4c20a8bd9180d11ca6 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Tue, 14 Apr 2020 21:19:44 +0200 Subject: [PATCH 07/16] Now packaging 5.4.5. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index c5e1269..8b1614d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-pbr (5.4.5-1) experimental; urgency=medium + + * New upstream release. + + -- Thomas Goirand Tue, 14 Apr 2020 21:19:22 +0200 + python-pbr (5.4.3-3) unstable; urgency=medium * Drop python2 support; Closes: #938011 -- GitLab From 59c12ab553f08494e89642ecd368c6777df64057 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Tue, 14 Apr 2020 21:24:44 +0200 Subject: [PATCH 08/16] Removed remainings of Python 2 support. --- debian/changelog | 1 + debian/python-pbr.postinst | 11 ----------- debian/python-pbr.postrm | 11 ----------- debian/python-pbr.prerm | 11 ----------- debian/python3-pbr.postinst | 11 ----------- 5 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 debian/python-pbr.postinst delete mode 100644 debian/python-pbr.postrm delete mode 100644 debian/python-pbr.prerm delete mode 100644 debian/python3-pbr.postinst diff --git a/debian/changelog b/debian/changelog index 8b1614d..472972f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ python-pbr (5.4.5-1) experimental; urgency=medium * New upstream release. + * Removed remainings of Python 2 support. -- Thomas Goirand Tue, 14 Apr 2020 21:19:22 +0200 diff --git a/debian/python-pbr.postinst b/debian/python-pbr.postinst deleted file mode 100644 index 0441ca6..0000000 --- a/debian/python-pbr.postinst +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -set -e - -if [ "$1" = "configure" ] ; then - update-alternatives --install /usr/bin/pbr pbr /usr/bin/python2-pbr 300 -fi - -#DEBHELPER# - -exit 0 diff --git a/debian/python-pbr.postrm b/debian/python-pbr.postrm deleted file mode 100644 index 8222739..0000000 --- a/debian/python-pbr.postrm +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -set -e - -if [ "$1" = "remove" ] || [ "$1" = "disappear" ] ; then - update-alternatives --remove pbr /usr/bin/python2-pbr -fi - -#DEBHELPER# - -exit 0 diff --git a/debian/python-pbr.prerm b/debian/python-pbr.prerm deleted file mode 100644 index 6865a4e..0000000 --- a/debian/python-pbr.prerm +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -set -e - -if [ "$1" = "remove" ] ; then - update-alternatives --remove pbr /usr/bin/python2-pbr -fi - -#DEBHELPER# - -exit 0 diff --git a/debian/python3-pbr.postinst b/debian/python3-pbr.postinst deleted file mode 100644 index 7a1bec4..0000000 --- a/debian/python3-pbr.postinst +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -set -e - -if [ "$1" = "configure" ] ; then - update-alternatives --install /usr/bin/pbr pbr /usr/bin/python3-pbr 200 -fi - -#DEBHELPER# - -exit 0 -- GitLab From 4014374d8c55502c180bb111de7486705de05335 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 15 Apr 2020 09:12:32 +0200 Subject: [PATCH 09/16] Uploading to experimental, fixing "cannot install" (Closes: #956736). --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 472972f..6e51a20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-pbr (5.4.5-2) unstable; urgency=medium + + * Uploading to experimental, fixing "cannot install" (Closes: #956736). + + -- Thomas Goirand Wed, 15 Apr 2020 09:11:52 +0200 + python-pbr (5.4.5-1) experimental; urgency=medium * New upstream release. -- GitLab From 20869fe2960c4e4797f2b9d52502ebd0f6c0f789 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 15 Apr 2020 09:16:12 +0200 Subject: [PATCH 10/16] * Disabled unit tests for now, as otherwise it wouldn't build because test dependencies need pbr to install. Will re-activate on next upload. Also disabled docs because of the same reason (sphinxcontrib.apidoc needs PBR). --- debian/changelog | 3 +++ debian/control | 34 +++++++++++++++++----------------- debian/rules | 9 ++++++--- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6e51a20..8d8427b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ python-pbr (5.4.5-2) unstable; urgency=medium * Uploading to experimental, fixing "cannot install" (Closes: #956736). + * Disabled unit tests for now, as otherwise it wouldn't build because test + dependencies need pbr to install. Will re-activate on next upload. Also + disabled docs because of the same reason (sphinxcontrib.apidoc needs PBR). -- Thomas Goirand Wed, 15 Apr 2020 09:11:52 +0200 diff --git a/debian/control b/debian/control index 4bfb125..ca04e12 100644 --- a/debian/control +++ b/debian/control @@ -14,23 +14,23 @@ Build-Depends: python3-all, python3-setuptools, python3-sphinx, -Build-Depends-Indep: - python3-all-dev , - python3-coverage , - python3-fixtures , - python3-markupsafe , - python3-mock , - python3-openstackdocstheme , - python3-pip , - python3-six , - python3-sphinxcontrib.apidoc, - python3-stestr , - python3-testresources , - python3-testscenarios , - python3-testtools , - python3-virtualenv , - python3-wheel , - subunit , +#Build-Depends-Indep: +# python3-all-dev , +# python3-coverage , +# python3-fixtures , +# python3-markupsafe , +# python3-mock , +# python3-openstackdocstheme , +# python3-pip , +# python3-six , +# python3-sphinxcontrib.apidoc, +# python3-stestr , +# python3-testresources , +# python3-testscenarios , +# python3-testtools , +# python3-virtualenv , +# python3-wheel , +# subunit , Standards-Version: 4.4.1 Rules-Requires-Root: no Vcs-Browser: https://salsa.debian.org/openstack-team/libs/python-pbr diff --git a/debian/rules b/debian/rules index d160aad..92a621c 100755 --- a/debian/rules +++ b/debian/rules @@ -20,13 +20,16 @@ override_dh_auto_install: override_dh_auto_test: ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) - pkgos-dh_auto_test --no-py2 'pbr\.tests(?!.*test_packaging\.TestRequirementParsing\.test_requirement_parsing.*|.*test_core\.TestCore\.test_setup_py_keywords.*)' + echo "Disabling unit tests for now" + #pkgos-dh_auto_test --no-py2 'pbr\.tests(?!.*test_packaging\.TestRequirementParsing\.test_requirement_parsing.*|.*test_core\.TestCore\.test_setup_py_keywords.*)' endif override_dh_sphinxdoc: ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS))) - PYTHONPATH=. PYTHON=python3 python3 -m sphinx -b html doc/source $(CURDIR)/debian/python-pbr-doc/usr/share/doc/python-pbr-doc/html - dh_sphinxdoc + mkdir -p $(CURDIR)/debian/python-pbr-doc/usr/share/doc/python-pbr-doc + cp README.rst $(CURDIR)/debian/python-pbr-doc/usr/share/doc/python-pbr-doc +# PYTHONPATH=. PYTHON=python3 python3 -m sphinx -b html doc/source $(CURDIR)/debian/python-pbr-doc/usr/share/doc/python-pbr-doc/html +# dh_sphinxdoc endif override_dh_python3: -- GitLab From a571389d9e92a5c34c858b166d09e2632ded2c78 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 15 Apr 2020 09:31:37 +0200 Subject: [PATCH 11/16] Reactivate tests and docs. --- debian/changelog | 6 ++++++ debian/control | 36 ++++++++++++++++++------------------ debian/rules | 9 +++------ 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8d8427b..a5189b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-pbr (5.4.5-3) UNRELEASED; urgency=medium + + * Reactivate tests and docs. + + -- Thomas Goirand Wed, 15 Apr 2020 09:31:18 +0200 + python-pbr (5.4.5-2) unstable; urgency=medium * Uploading to experimental, fixing "cannot install" (Closes: #956736). diff --git a/debian/control b/debian/control index ca04e12..9cdd622 100644 --- a/debian/control +++ b/debian/control @@ -13,24 +13,24 @@ Build-Depends: openstack-pkg-tools, python3-all, python3-setuptools, - python3-sphinx, -#Build-Depends-Indep: -# python3-all-dev , -# python3-coverage , -# python3-fixtures , -# python3-markupsafe , -# python3-mock , -# python3-openstackdocstheme , -# python3-pip , -# python3-six , -# python3-sphinxcontrib.apidoc, -# python3-stestr , -# python3-testresources , -# python3-testscenarios , -# python3-testtools , -# python3-virtualenv , -# python3-wheel , -# subunit , + python3-sphinx , +Build-Depends-Indep: + python3-all-dev , + python3-coverage , + python3-fixtures , + python3-markupsafe , + python3-mock , + python3-openstackdocstheme , + python3-pip , + python3-six , + python3-sphinxcontrib.apidoc , + python3-stestr , + python3-testresources , + python3-testscenarios , + python3-testtools , + python3-virtualenv , + python3-wheel , + subunit , Standards-Version: 4.4.1 Rules-Requires-Root: no Vcs-Browser: https://salsa.debian.org/openstack-team/libs/python-pbr diff --git a/debian/rules b/debian/rules index 92a621c..d160aad 100755 --- a/debian/rules +++ b/debian/rules @@ -20,16 +20,13 @@ override_dh_auto_install: override_dh_auto_test: ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) - echo "Disabling unit tests for now" - #pkgos-dh_auto_test --no-py2 'pbr\.tests(?!.*test_packaging\.TestRequirementParsing\.test_requirement_parsing.*|.*test_core\.TestCore\.test_setup_py_keywords.*)' + pkgos-dh_auto_test --no-py2 'pbr\.tests(?!.*test_packaging\.TestRequirementParsing\.test_requirement_parsing.*|.*test_core\.TestCore\.test_setup_py_keywords.*)' endif override_dh_sphinxdoc: ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS))) - mkdir -p $(CURDIR)/debian/python-pbr-doc/usr/share/doc/python-pbr-doc - cp README.rst $(CURDIR)/debian/python-pbr-doc/usr/share/doc/python-pbr-doc -# PYTHONPATH=. PYTHON=python3 python3 -m sphinx -b html doc/source $(CURDIR)/debian/python-pbr-doc/usr/share/doc/python-pbr-doc/html -# dh_sphinxdoc + PYTHONPATH=. PYTHON=python3 python3 -m sphinx -b html doc/source $(CURDIR)/debian/python-pbr-doc/usr/share/doc/python-pbr-doc/html + dh_sphinxdoc endif override_dh_python3: -- GitLab From 8e939d27ef28892b25c238cbf3fbcb6e9c738c25 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Thu, 16 Apr 2020 09:15:12 +0200 Subject: [PATCH 12/16] Releasing to unstable. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a5189b6..f91100c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python-pbr (5.4.5-3) UNRELEASED; urgency=medium +python-pbr (5.4.5-3) unstable; urgency=medium * Reactivate tests and docs. -- GitLab From a3038c02a4549180528b8a40b5787e80fc2f258c Mon Sep 17 00:00:00 2001 From: Debian Janitor Date: Sun, 26 Apr 2020 15:22:05 +0000 Subject: [PATCH 13/16] Move source package lintian overrides to debian/source. Fixes: lintian: package-uses-deprecated-source-override-location See-also: https://lintian.debian.org/tags/package-uses-deprecated-source-override-location.html --- debian/changelog | 6 ++++++ .../{source.lintian-overrides => source/lintian-overrides} | 0 2 files changed, 6 insertions(+) rename debian/{source.lintian-overrides => source/lintian-overrides} (100%) diff --git a/debian/changelog b/debian/changelog index f91100c..3ca82aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-pbr (5.4.5-4) UNRELEASED; urgency=medium + + * Move source package lintian overrides to debian/source. + + -- Debian Janitor Sun, 26 Apr 2020 15:21:43 +0000 + python-pbr (5.4.5-3) unstable; urgency=medium * Reactivate tests and docs. diff --git a/debian/source.lintian-overrides b/debian/source/lintian-overrides similarity index 100% rename from debian/source.lintian-overrides rename to debian/source/lintian-overrides -- GitLab From b8c8dcfbd457e3f50d83ea4a1209e90eda70a6b3 Mon Sep 17 00:00:00 2001 From: Debian Janitor Date: Sun, 26 Apr 2020 15:22:59 +0000 Subject: [PATCH 14/16] Bump debhelper from old 10 to 12. + Replace python_distutils buildsystem with pybuild. Fixes: lintian: package-uses-old-debhelper-compat-version See-also: https://lintian.debian.org/tags/package-uses-old-debhelper-compat-version.html --- debian/changelog | 1 + debian/control | 2 +- debian/rules | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3ca82aa..66fe090 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ python-pbr (5.4.5-4) UNRELEASED; urgency=medium * Move source package lintian overrides to debian/source. + * Bump debhelper from old 10 to 12. -- Debian Janitor Sun, 26 Apr 2020 15:21:43 +0000 diff --git a/debian/control b/debian/control index 9cdd622..537c6a3 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Uploaders: Thomas Goirand , Prach Pongpanich , Build-Depends: - debhelper-compat (= 10), + debhelper-compat (= 12), dh-python, git, gnupg, diff --git a/debian/rules b/debian/rules index d160aad..a513cc8 100755 --- a/debian/rules +++ b/debian/rules @@ -7,7 +7,7 @@ export http_proxy=127.0.0.1:9 export https_proxy=127.0.0.1:9 %: - dh $@ --buildsystem=python_distutils --with python3,sphinxdoc + dh $@ --buildsystem=pybuild --with python3,sphinxdoc override_dh_auto_clean: rm -rf .stestr build __pycache__ -- GitLab From 55ca97ef96d7e38cbb9b2765ba51bb604070839c Mon Sep 17 00:00:00 2001 From: Debian Janitor Date: Sun, 26 Apr 2020 15:23:38 +0000 Subject: [PATCH 15/16] Set upstream metadata fields: Repository, Repository-Browse. Fixes: lintian: upstream-metadata-file-is-missing See-also: https://lintian.debian.org/tags/upstream-metadata-file-is-missing.html Fixes: lintian: upstream-metadata-missing-repository See-also: https://lintian.debian.org/tags/upstream-metadata-missing-repository.html --- debian/changelog | 1 + debian/upstream/metadata | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 debian/upstream/metadata diff --git a/debian/changelog b/debian/changelog index 66fe090..326f462 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ python-pbr (5.4.5-4) UNRELEASED; urgency=medium * Move source package lintian overrides to debian/source. * Bump debhelper from old 10 to 12. + * Set upstream metadata fields: Repository, Repository-Browse. -- Debian Janitor Sun, 26 Apr 2020 15:21:43 +0000 diff --git a/debian/upstream/metadata b/debian/upstream/metadata new file mode 100644 index 0000000..2f078cb --- /dev/null +++ b/debian/upstream/metadata @@ -0,0 +1,2 @@ +Repository: https://github.com/openstack-dev/pbr.git +Repository-Browse: https://github.com/openstack-dev/pbr -- GitLab From fd12a435e78178f1bb326b48d0a67e18c55e929e Mon Sep 17 00:00:00 2001 From: Debian Janitor Date: Sun, 26 Apr 2020 15:24:26 +0000 Subject: [PATCH 16/16] Update standards version to 4.5.0, no changes needed. Fixes: lintian: out-of-date-standards-version See-also: https://lintian.debian.org/tags/out-of-date-standards-version.html --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 326f462..4a1368f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ python-pbr (5.4.5-4) UNRELEASED; urgency=medium * Move source package lintian overrides to debian/source. * Bump debhelper from old 10 to 12. * Set upstream metadata fields: Repository, Repository-Browse. + * Update standards version to 4.5.0, no changes needed. -- Debian Janitor Sun, 26 Apr 2020 15:21:43 +0000 diff --git a/debian/control b/debian/control index 537c6a3..e9507b7 100644 --- a/debian/control +++ b/debian/control @@ -31,7 +31,7 @@ Build-Depends-Indep: python3-virtualenv , python3-wheel , subunit , -Standards-Version: 4.4.1 +Standards-Version: 4.5.0 Rules-Requires-Root: no Vcs-Browser: https://salsa.debian.org/openstack-team/libs/python-pbr Vcs-Git: https://salsa.debian.org/openstack-team/libs/python-pbr.git -- GitLab