From 5f35d2d650921226e267b92b0775bcf0fba6d079 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Aug 01 2017 07:06:42 +0000 Subject: [PATCH 1/2] Fix PEP8 error and tests for commit 83e73f3 Signed-off-by: Chenxiong Qi --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index ecafab7..1c80d2e 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -2211,7 +2211,7 @@ class Commands(object): subprocess.check_call( '%s; exit "${PIPESTATUS[0]} ${pipestatus[1]}"' % cmd, shell=True) - except subprocess.CalledProcessError as e: + except subprocess.CalledProcessError: raise rpkgError(cmd) # Not to be confused with mockconfig the property diff --git a/tests/test_cli.py b/tests/test_cli.py index d4517cb..ffa2c0c 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -398,8 +398,8 @@ class TestInstall(CliTestCase): class TestLocal(CliTestCase): - @patch('pyrpkg.Commands._run_command') - def test_local(self, _run_command): + @patch('pyrpkg.subprocess.check_call') + def test_local(self, check_call): cli_cmd = ['rpkg', '--path', self.cloned_repo_path, '--release', 'rhel-6', 'local'] with patch('sys.argv', new=cli_cmd): @@ -409,10 +409,13 @@ class TestLocal(CliTestCase): spec = os.path.join(cli.cmd.path, cli.cmd.spec) rpmbuild = ['rpmbuild'] + cli.cmd.rpmdefines + ['-ba', spec] tee = ['tee', '.build-%s-%s.log' % (cli.cmd.ver, cli.cmd.rel)] - _run_command.assert_called_once_with(rpmbuild, pipe=tee, shell=True) + cmd = '%s | %s; exit "${PIPESTATUS[0]} ${pipestatus[1]}"' % ( + ' '.join(rpmbuild), ' '.join(tee) + ) + check_call.assert_called_once_with(cmd, shell=True) - @patch('pyrpkg.Commands._run_command') - def test_local_with_options(self, _run_command): + @patch('pyrpkg.subprocess.check_call') + def test_local_with_options(self, check_call): builddir = os.path.join(self.cloned_repo_path, 'this-builddir') cli_cmd = ['rpkg', '--path', self.cloned_repo_path, '--release', 'rhel-6', '-q', 'local', @@ -427,7 +430,11 @@ class TestLocal(CliTestCase): ["--define '_builddir %s'" % builddir, '--target', 'i686', '--quiet', '-ba', spec] tee = ['tee', '.build-%s-%s.log' % (cli.cmd.ver, cli.cmd.rel)] - _run_command.assert_called_once_with(rpmbuild, pipe=tee, shell=True) + cmd = '%s | %s; exit "${PIPESTATUS[0]} ${pipestatus[1]}"' % ( + ' '.join(rpmbuild), ' '.join(tee) + ) + + check_call.assert_called_once_with(cmd, shell=True) class TestVerifyFiles(CliTestCase): From 4f943639103a4bf366678774d9dbea67a4119ce0 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Aug 01 2017 07:07:01 +0000 Subject: [PATCH 2/2] 1.50 Release Signed-off-by: Chenxiong Qi --- diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 823b18c..504480f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,10 +1,51 @@ ChangeLog ========= -NEXT ----- +v1.50 (2017-08-01) +------------------ +- Fix PEP8 error (cqi) +- Spelling fixes (ville.skytta) +- Reword help and description of new-sources and upload commands - 1248737 + (cqi) +- Set autorebuild enabled by default (bfontecc) +- Add commands to whitelist_externals (cqi) +- Declare Python 3 versions to support in setup.py (cqi) +- Replace unicode with six.text_type (cqi) +- Run tests in both Python 2 and 3 with tox (cqi) +- Make tests and covered code compatible with Py3 (cqi) +- Add requirements files (cqi) +- Do not build srpm in test (cqi) +- Do not actually run git-diff in tests (cqi) +- Remove deprecated modules used in koji (cqi) +- Non-zero exit when rpmbuild fails in local command (cqi) +- Report deprecation of config via logger (lsedlar) +- Print --dist deprecation warning explicitly (lsedlar) +- utils: Avoid DeprecationWarning for messages for users (lsedlar) +- Supply namespace to lookaside (if enabled) (lsedlar) +- Support reading koji config from profile - #187 (cqi) +- Remove kitchen (cqi) +- Fix string format (cqi) +- Recommend --release instead of --dist in mockbuild --help (tmz) +- Allow overriding container build target by downstream (lsedlar) +- Add a separate property for namespace (lsedlar) +- Allow container builds from any namespace (maxamillion) +- Make osbs support optional (cqi) +- make osbs dependency optional (pavlix) +- Allow explicit namespaces with slashes (lsedlar) +- Do not hang indefinitely when lookaside cache server stops sending data + (jkaluza) +- Make --module-name work with namespaces - #216 (lsedlar) +- Include README.rst in dist package (cqi) +- More document in README - #189 (cqi) +- Make new command be able to print unicode - #205 (cqi) +- Allow to specify custom info to a dummy commit (cqi) +- Load module name correctly even if push url ends in slash - #192 (cqi) +- Replace fedorahosted.org with pagure.io - #202 (cqi) - Fix rpm command to get changelog from SPEC - rhbz#1412224 (cqi) +- Rewrite tests to avoid running rpmbuild and rpmlint (cqi) +- Use fake value to make Command in test (cqi) +- Python 3.6 invalid escape sequence deprecation fixes (ville.skytta) v1.49 (2017-02-22) ------------------ diff --git a/setup.py b/setup.py index b907c42..4f97057 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup, find_packages setup( name="rpkg", - version="1.49", + version="1.50", author="Dennis Gilmore", author_email="ausil@fedoraproject.org", description=("A python library and runtime script for managing RPM"