Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove regeneration of AUTHORS list and Qiskit.bib in release process #35

Merged
merged 2 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 0 additions & 28 deletions qiskit_bot/release_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import os
import re
import shutil
import subprocess

import fasteners
from packaging.version import parse
Expand All @@ -30,31 +29,6 @@
LOG = logging.getLogger(__name__)


def _regenerate_authors(repo):
try:
LOG.info('Regenerating authors list')
res = subprocess.run(['python', 'tools/generate_authors.py'],
capture_output=True, check=True,
cwd=repo.local_path)
LOG.debug('generate_authors called\nstdout:\n%s\nstderr:\n%s' % (
res.stdout, res.stderr))
except subprocess.CalledProcessError as e:
LOG.exception("Failed to generate_authors\nstdout:\n%s\nstderr:\n%s"
% (e.stdout, e.stderr))
return
try:
LOG.info('Regenerating bibtex file')
res = subprocess.run(['python', 'tools/generate_bibtex.py'],
jakelishman marked this conversation as resolved.
Show resolved Hide resolved
capture_output=True, check=True,
cwd=repo.local_path)
LOG.debug('generate_bibtex called\nstdout:\n%s\nstderr:\n%s' % (
res.stdout, res.stderr))
except subprocess.CalledProcessError as e:
LOG.exception("Failed to generate_authors\nstdout:\n%s\nstderr:\n%s"
% (e.stdout, e.stderr))
return


def bump_meta(meta_repo, repo, version_number):
repo_config = repo.repo_config
git.checkout_default_branch(meta_repo, pull=True)
Expand Down Expand Up @@ -143,8 +117,6 @@ def bump_meta(meta_repo, repo, version_number):
with open(docs_conf_path, 'w') as fd:
shutil.copyfileobj(buf, fd)

_regenerate_authors(meta_repo)

body = """Bump the meta repo version to include:

%s
Expand Down
33 changes: 0 additions & 33 deletions tests/test_release_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ class TestReleaseProcess(fixtures.TestWithFixtures, unittest.TestCase):
def setUp(self):
self.temp_dir = fixtures.TempDir()
self.useFixture(self.temp_dir)
self.generate = unittest.mock.patch.object(
release_process, '_regenerate_authors')
self.generate_mock = self.generate.start()

def tearDown(self):
self.generate.stop()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_minor_no_pulls(self, git_mock):
Expand Down Expand Up @@ -91,7 +85,6 @@ def test_bump_meta_patch_release_from_minor_no_pulls(self, git_mock):
"qiskit-terra==0.16.1\n\n")
meta_repo.gh_repo.create_pull.assert_called_once_with(
'Bump Meta', base='master', head='bump_meta', body=body)
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_minor_with_unrelated_pulls(self,
Expand Down Expand Up @@ -153,7 +146,6 @@ def test_bump_meta_patch_release_from_minor_with_unrelated_pulls(self,
"qiskit-terra==0.16.1\n\n")
meta_repo.gh_repo.create_pull.assert_called_once_with(
'Bump Meta', base='master', head='bump_meta', body=body)
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_minor_with_existing_pulls(self,
Expand Down Expand Up @@ -219,7 +211,6 @@ def test_bump_meta_patch_release_from_minor_with_existing_pulls(self,
meta_repo.gh_repo.create_pull.assert_not_called()
existing_pull_mock.edit.assert_called_once_with(
body='Fake old body\nqiskit-terra==0.16.1')
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_patch_with_no_pulls(self,
Expand Down Expand Up @@ -277,7 +268,6 @@ def test_bump_meta_patch_release_from_patch_with_no_pulls(self,
"qiskit-terra==0.9.1\n\n")
meta_repo.gh_repo.create_pull.assert_called_once_with(
'Bump Meta', base='master', head='bump_meta', body=body)
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_patch_with_unrelated_pulls(self,
Expand Down Expand Up @@ -341,7 +331,6 @@ def test_bump_meta_patch_release_from_patch_with_unrelated_pulls(self,
"qiskit-terra==0.9.1\n\n")
meta_repo.gh_repo.create_pull.assert_called_once_with(
'Bump Meta', base='master', head='bump_meta', body=body)
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_pending_patch_release_pr(self,
Expand Down Expand Up @@ -407,7 +396,6 @@ def test_bump_meta_patch_release_from_pending_patch_release_pr(self,
meta_repo.gh_repo.create_pull.assert_not_called()
existing_pull_mock.edit.assert_called_once_with(
body='Fake old body\nqiskit-terra==0.16.1')
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_pending_minor_release_pr(self,
Expand Down Expand Up @@ -474,7 +462,6 @@ def test_bump_meta_patch_release_from_pending_minor_release_pr(self,
meta_repo.gh_repo.create_pull.assert_not_called()
existing_pull_mock.edit.assert_called_once_with(
body='Fake old body\nqiskit-terra==0.16.1')
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_minor_release_from_minor_no_pulls(self, git_mock):
Expand Down Expand Up @@ -531,7 +518,6 @@ def test_bump_meta_minor_release_from_minor_no_pulls(self, git_mock):
"qiskit-terra==0.17.0\n\n")
meta_repo.gh_repo.create_pull.assert_called_once_with(
'Bump Meta', base='master', head='bump_meta', body=body)
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_minor_release_from_minor_with_unrelated_pulls(self,
Expand Down Expand Up @@ -595,7 +581,6 @@ def test_bump_meta_minor_release_from_minor_with_unrelated_pulls(self,
"qiskit-terra==0.17.0\n\n")
meta_repo.gh_repo.create_pull.assert_called_once_with(
'Bump Meta', base='master', head='bump_meta', body=body)
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_minor_release_from_minor_with_existing_pulls(self,
Expand Down Expand Up @@ -661,7 +646,6 @@ def test_bump_meta_minor_release_from_minor_with_existing_pulls(self,
meta_repo.gh_repo.create_pull.assert_not_called()
existing_pull_mock.edit.assert_called_once_with(
body='Fake old body\nqiskit-terra==0.17.0')
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_minor_release_from_patch_with_no_pulls(self,
Expand Down Expand Up @@ -719,7 +703,6 @@ def test_bump_meta_minor_release_from_patch_with_no_pulls(self,
"qiskit-terra==0.10.0\n\n")
meta_repo.gh_repo.create_pull.assert_called_once_with(
'Bump Meta', base='master', head='bump_meta', body=body)
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_minor_release_from_patch_with_unrelated_pulls(self,
Expand Down Expand Up @@ -783,7 +766,6 @@ def test_bump_meta_minor_release_from_patch_with_unrelated_pulls(self,
"qiskit-terra==0.10.0\n\n")
meta_repo.gh_repo.create_pull.assert_called_once_with(
'Bump Meta', base='master', head='bump_meta', body=body)
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
def test_bump_minor_release_from_pending_patch_release_pr(self,
Expand Down Expand Up @@ -849,7 +831,6 @@ def test_bump_minor_release_from_pending_patch_release_pr(self,
meta_repo.gh_repo.create_pull.assert_not_called()
existing_pull_mock.edit.assert_called_once_with(
body='Fake old body\nqiskit-terra==0.16.0')
self.generate_mock.called_once_with(meta_repo)

def test_get_log_string(self):
version_obj = parse("0.10.2")
Expand Down Expand Up @@ -1020,7 +1001,6 @@ def test_bump_meta_patch_release_from_minor_no_pulls_optional_package(
self.fail('Release not updated in doc config')

meta_repo.gh_repo.create_pull.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_minor_with_unrelated_pulls_optional(
Expand Down Expand Up @@ -1069,7 +1049,6 @@ def test_bump_meta_patch_release_from_minor_with_unrelated_pulls_optional(
else:
self.fail('Release not updated in doc config')
meta_repo.gh_repo.create_pull.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_minor_with_existing_pulls_optional(
Expand Down Expand Up @@ -1125,7 +1104,6 @@ def test_bump_meta_patch_release_from_minor_with_existing_pulls_optional(
self.fail('Release not updated in doc config')
meta_repo.gh_repo.create_pull.assert_not_called()
existing_pull_mock.edit.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_patch_with_no_pulls_optional_package(
Expand Down Expand Up @@ -1170,7 +1148,6 @@ def test_bump_meta_patch_release_from_patch_with_no_pulls_optional_package(
else:
self.fail('Release not updated in doc config')
meta_repo.gh_repo.create_pull.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_patch_with_unrelated_pulls_optional(
Expand Down Expand Up @@ -1221,7 +1198,6 @@ def test_bump_meta_patch_release_from_patch_with_unrelated_pulls_optional(
else:
self.fail('Release not updated in doc config')
meta_repo.gh_repo.create_pull.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_pending_patch_release_pr_optional(
Expand Down Expand Up @@ -1277,7 +1253,6 @@ def test_bump_meta_patch_release_from_pending_patch_release_pr_optional(
self.fail('Release not updated in doc config')
meta_repo.gh_repo.create_pull.assert_not_called()
existing_pull_mock.edit.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_pending_minor_release_pr_optional(
Expand Down Expand Up @@ -1334,7 +1309,6 @@ def test_bump_meta_patch_release_from_pending_minor_release_pr_optional(

meta_repo.gh_repo.create_pull.assert_not_called()
existing_pull_mock.edit.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_minor_release_from_minor_no_pulls_optional(self,
Expand Down Expand Up @@ -1379,7 +1353,6 @@ def test_bump_meta_minor_release_from_minor_no_pulls_optional(self,
else:
self.fail('Release not updated in doc config')
meta_repo.gh_repo.create_pull.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_minor_release_from_minor_with_unrelated_pulls_optional(
Expand Down Expand Up @@ -1430,7 +1403,6 @@ def test_bump_meta_minor_release_from_minor_with_unrelated_pulls_optional(
self.fail('Release not updated in doc config')

meta_repo.gh_repo.create_pull.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_minor_release_from_minor_with_existing_pulls_optional(
Expand Down Expand Up @@ -1486,7 +1458,6 @@ def test_bump_meta_minor_release_from_minor_with_existing_pulls_optional(
self.fail('Release not updated in doc config')
meta_repo.gh_repo.create_pull.assert_not_called()
existing_pull_mock.edit.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_minor_release_from_patch_with_no_pulls_optional(
Expand Down Expand Up @@ -1531,7 +1502,6 @@ def test_bump_meta_minor_release_from_patch_with_no_pulls_optional(
else:
self.fail('Release not updated in doc config')
meta_repo.gh_repo.create_pull.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_minor_release_from_patch_with_unrelated_pulls_optional(
Expand Down Expand Up @@ -1582,7 +1552,6 @@ def test_bump_meta_minor_release_from_patch_with_unrelated_pulls_optional(
else:
self.fail('Release not updated in doc config')
meta_repo.gh_repo.create_pull.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_minor_release_from_pending_patch_release_pr_optional(
Expand Down Expand Up @@ -1638,7 +1607,6 @@ def test_bump_minor_release_from_pending_patch_release_pr_optional(
self.fail('Release not updated in doc config')
meta_repo.gh_repo.create_pull.assert_not_called()
existing_pull_mock.edit.assert_not_called()
self.generate_mock.assert_not_called()

@unittest.mock.patch.object(release_process, 'git')
def test_bump_meta_patch_release_from_minor_no_pulls_main(self, git_mock):
Expand Down Expand Up @@ -1695,7 +1663,6 @@ def test_bump_meta_patch_release_from_minor_no_pulls_main(self, git_mock):
"qiskit-terra==0.16.1\n\n")
meta_repo.gh_repo.create_pull.assert_called_once_with(
'Bump Meta', base='main', head='bump_meta', body=body)
self.generate_mock.called_once_with(meta_repo)

@unittest.mock.patch.object(release_process, 'git')
@unittest.mock.patch.object(release_process, 'create_github_release')
Expand Down