diff --git a/.travis.yml b/.travis.yml index 6804b53..7b3c05a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,18 +4,16 @@ services: - docker env: - - FEDORA=28 TOXENV=integration - - FEDORA=28 TOXENV=py3 - FEDORA=29 TOXENV=integration - FEDORA=29 TOXENV=py3 - - FEDORA=29 TOXENV=style - FEDORA=30 TOXENV=integration - FEDORA=30 TOXENV=py3 + - FEDORA=30 TOXENV=style - FEDORA=rawhide TOXENV=integration - FEDORA=rawhide TOXENV=py3 install: - - sed -i "s/fedora-28-x86_64/fedora-${FEDORA}-x86_64/" mock.cfg + - sed -i "s/fedora-30-x86_64/fedora-${FEDORA}-x86_64/" mock.cfg - sed -i "s/\$releasever/${FEDORA}/" mock.cfg # needed on rawhide - sed -i "s|FROM fedora|FROM registry.fedoraproject.org/fedora:${FEDORA}|" Dockerfile - docker build -t taskotron . diff --git a/README.rst b/README.rst index 69118da..c676723 100644 --- a/README.rst +++ b/README.rst @@ -15,8 +15,6 @@ Currently the following checks are available: - Whether only Python 2 version of the package contains the executables; -- Whether the package uses versioned shebangs in its executables; - - Whether the package supports Python 3 upstream but not in the package; - Whether the package requires ``/usr/bin/python`` (or ``python-unversioned-command``). diff --git a/mock.cfg b/mock.cfg index 6ad302d..ab5de4e 100644 --- a/mock.cfg +++ b/mock.cfg @@ -1,4 +1,4 @@ -include('/etc/mock/fedora-28-x86_64.cfg') +include('/etc/mock/fedora-30-x86_64.cfg') config_opts['chroot_setup_cmd'] = 'install ansible dnf' config_opts['use_host_resolv'] = True diff --git a/python_versions_check.py b/python_versions_check.py index 30fd944..762ff0b 100644 --- a/python_versions_check.py +++ b/python_versions_check.py @@ -24,7 +24,6 @@ task_unversioned_shebangs, task_py3_support, task_python_usage, - task_python_usage_obsoleted, ) from taskotron_python_versions.common import log, Package, PackageException @@ -82,8 +81,6 @@ def run(koji_build, workdir='.', artifactsdir='artifacts', srpm_packages + packages, koji_build, artifact)) details.append(task_python_usage( srpm_packages + packages, koji_build, artifact)) - details.append(task_python_usage_obsoleted( - logs, koji_build, artifact)) # TODO: remove with Fedora 28 EOL. for detail in details: # update testcase for all subtasks (use their existing testcase as a diff --git a/taskotron_python_versions/__init__.py b/taskotron_python_versions/__init__.py index 7c14688..c0d1068 100644 --- a/taskotron_python_versions/__init__.py +++ b/taskotron_python_versions/__init__.py @@ -5,7 +5,6 @@ from .unversioned_shebangs import task_unversioned_shebangs from .py3_support import task_py3_support from .python_usage import task_python_usage -from .python_usage_obsoleted import task_python_usage_obsoleted __all__ = ( @@ -16,5 +15,4 @@ 'task_unversioned_shebangs', 'task_py3_support', 'task_python_usage', - 'task_python_usage_obsoleted', ) diff --git a/taskotron_python_versions/python_usage_obsoleted.py b/taskotron_python_versions/python_usage_obsoleted.py deleted file mode 100644 index af35d5f..0000000 --- a/taskotron_python_versions/python_usage_obsoleted.py +++ /dev/null @@ -1,65 +0,0 @@ -"""Remove after Fedora 28 EOL. - -Obsoleted by https://fedoraproject.org/wiki/Changes/ -Move_usr_bin_python_into_separate_package. -""" -from .common import log, write_to_artifact, file_contains - - -WARNING = 'DEPRECATION WARNING: python2 invoked with /usr/bin/python' - -MESSAGE = """You've used /usr/bin/python during build on the following arches: - - {{}} - -Use /usr/bin/python3 or /usr/bin/python2 explicitly. -/usr/bin/python will be removed or switched to Python 3 in the future. - -Grep the build.log for the following to find out where: - - {} -""".format(WARNING) - -INFO_URL = ('https://fedoraproject.org/wiki/Changes/' - 'Avoid_usr_bin_python_in_RPM_Build') - - -def task_python_usage_obsoleted(logs, koji_build, artifact): - """Parses the build.logs for /usr/bin/python invocation warning - """ - # libtaskotron is not available on Python 3, so we do it inside - # to make the above functions testable anyway - from libtaskotron import check - - outcome = 'PASSED' - - problem_arches = set() - - for buildlog in logs: # not "log" because we use that name for logging - log.debug('Will parse {}'.format(buildlog)) - - if file_contains(buildlog, WARNING): - log.debug('{} contains our warning'.format(buildlog)) - arch = buildlog.suffix.lstrip('.') - problem_arches.add(arch) - outcome = 'FAILED' - - detail = check.CheckDetail( - checkname='python_usage_obsoleted', - item=koji_build, - report_type=check.ReportType.KOJI_BUILD, - outcome=outcome) - - if problem_arches: - info = '{}: {}'.format(koji_build, ', '.join(sorted(problem_arches))) - write_to_artifact(artifact, MESSAGE.format(info), INFO_URL) - detail.artifact = str(artifact) - problems = 'Problematic architectures: ' + info - else: - problems = 'No problems found.' - - summary = 'subcheck python_usage {} for {}. {}'.format( - outcome, koji_build, problems) - log.info(summary) - - return detail diff --git a/test/integration/test_integration.py b/test/integration/test_integration.py index 223306e..9794af6 100644 --- a/test/integration/test_integration.py +++ b/test/integration/test_integration.py @@ -191,10 +191,6 @@ def results(request): _pycallgraph = fixtures_factory('python-pycallgraph-0.5.1-13.fc28') pycallgraph = fixtures_factory('_pycallgraph') -# TODO: remove with Fedora 28 EOL. -_jsonrpc = fixtures_factory('jsonrpc-glib-3.27.4-2.fc28') -jsonrpc = fixtures_factory('_jsonrpc') - _teeworlds = fixtures_factory('teeworlds-0.6.4-8.fc29') teeworlds = fixtures_factory('_teeworlds') @@ -211,7 +207,7 @@ def test_number_of_results(results, request): results = request.getfixturevalue(results) # Each time a new check is added, this number needs to be increased - assert len(results) == 9 + assert len(results) == 8 @parametrize('eric', 'six', 'admesh', 'copr', 'epub', 'twine', 'pycallgraph') @@ -487,47 +483,6 @@ def test_artifact_contains_py3_support_and_looks_as_expected( """).strip() in artifact.strip() -# TODO: remove with Fedora 28 EOL. -@parametrize('eric', 'six', 'admesh', 'tracer', - 'copr', 'epub', 'twine', 'docutils') -def test_python_usage_obsoleted_passed(results, request): - results = request.getfixturevalue(results) - task_result = results['dist.python-versions.python_usage_obsoleted'] - assert task_result.outcome == 'PASSED' - - -# TODO: remove with Fedora 28 EOL. -@parametrize('jsonrpc') -def test_python_usage_obsoleted_failed(results, request): - results = request.getfixturevalue(results) - task_result = results['dist.python-versions.python_usage_obsoleted'] - assert task_result.outcome == 'FAILED' - - -# TODO: remove with Fedora 28 EOL. -@parametrize('jsonrpc') -def test_artifact_of_python_usage_obsoleted_looks_as_expected(results, - request): - results = request.getfixturevalue(results) - result = results['dist.python-versions.python_usage_obsoleted'] - artifact = result.artifact.read_text() - - print(artifact) - - assert dedent(""" - You've used /usr/bin/python during build on the following arches: - - jsonrpc-glib-3.27.4-2.fc28: x86_64 - - Use /usr/bin/python3 or /usr/bin/python2 explicitly. - /usr/bin/python will be removed or switched to Python 3 in the future. - - Grep the build.log for the following to find out where: - - DEPRECATION WARNING: python2 invoked with /usr/bin/python - """).strip() in artifact.strip() - - @parametrize('eric', 'six', 'admesh', 'copr', 'epub', 'twine', 'docutils') def test_python_usage_passed(results, request):