From 40e993261f57a940111a75c4a49fe69ecd05f58e Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Jul 26 2017 04:44:36 +0000 Subject: depend on flake8 binary not package In recent Fedora rawhide, /usr/bin/flake8 is provided by python3-flake8 not python(2)-flake8. --- diff --git a/ansible-review.spec b/ansible-review.spec index 26465bc..fef95e5 100644 --- a/ansible-review.spec +++ b/ansible-review.spec @@ -1,6 +1,6 @@ Name: ansible-review Version: 0.13.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Reviews Ansible playbooks, roles and inventory and suggests improvements License: MIT URL: https://github.com/willthames/ansible-review @@ -8,17 +8,17 @@ Source0: https://files.pythonhosted.org/packages/source/a/%{name}/%{name} BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-nose -BuildRequires: python-flake8 Requires: ansible-lint >= 3.0 Requires: python-yaml Requires: python-appdirs Requires: python2-unidiff -Requires: python-flake8 +Requires: /usr/bin/flake8 # Runtime requirements also needed in the build to run tests: BuildRequires: ansible-lint >= 3.0 BuildRequires: python-yaml BuildRequires: python-appdirs BuildRequires: python2-unidiff +BuildRequires: /usr/bin/flake8 %description Tool to review Ansible playbooks, roles, and inventory and suggest improvements. @@ -28,6 +28,16 @@ Tool to review Ansible playbooks, roles, and inventory and suggest improvements. rm -r lib/ansible_review.egg-info sed -e '1 { /^#!/d }' -i lib/ansiblereview/utils/yamlindent.py +# Upstream declares a Python-level dependency on flake8, so that when you +# "pip install ansible-review" you get a copy of flake8. But actually +# ansible-review only invokes the flake8 command as a subprocess, it doesn't +# import any flake8 Python modules. In Fedora 27+ the flake8 command is in +# Python 3 not Python 2, so if we have a Python-level dependency it won't +# necessarily be satisfied, leading to: +# pkg_resources.DistributionNotFound: The 'flake8' distribution was not found and is required by ansible-review +# So let's just edit that out. +sed -e "/install_requires=/s@'flake8'@@" -i setup.py + %build %py2_build @@ -45,6 +55,9 @@ nosetests -v test/ %{python2_sitelib}/ansible_review*.egg-info %changelog +* Wed Jul 26 2017 Dan Callaghan - 0.13.0-5 +- depend on flake8 binary not package + * Wed Jul 26 2017 Fedora Release Engineering - 0.13.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild