diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-02-10 21:05:55 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-02-10 21:05:55 +0000 |
commit | 71deace00d1a2b091313fe137ab7092418c6f87c (patch) | |
tree | 9f1f0dee23e13658e52f49437befe78427148c51 /app-admin/ansible-lint | |
parent | 29aabba0ea759c6a2864ff5631735b67ee38e5e0 (diff) |
gentoo resync : 10.02.2020
Diffstat (limited to 'app-admin/ansible-lint')
3 files changed, 217 insertions, 0 deletions
diff --git a/app-admin/ansible-lint/Manifest b/app-admin/ansible-lint/Manifest index 45c2f8395334..b2f45b93b0a2 100644 --- a/app-admin/ansible-lint/Manifest +++ b/app-admin/ansible-lint/Manifest @@ -1,3 +1,6 @@ +AUX ansible-lint-4.1.0-specifierset-split-setuptools.patch 6509 BLAKE2B a2d9fe19d160a13213d822a195969e12b5f18843b2784c3d06460511867ee7b0198282888c945b37649f487d5e08d10a4c26ae808da11cb269cdc980db09287c SHA512 d2e79ec9dfb330182fae18f26bf0461c49e7c80d86ce65cbada672d70d69176a8880f4eae4125b2343a48ae0b793722a44aeebb3f4a7da99dd2fa44c4b67af29 DIST ansible-lint-4.0.1.tar.gz 2909257 BLAKE2B c030b6fc58eaeeec42e40dd5bc46e5181916433b905bfc4a82382bf6bba8536d2639172aab0e2928ce1dd5489f322e19ab1c0ea5abb637562616addb9733e81a SHA512 a2f3bd44287a2c72f79c5fbb4c02446484cf764d386d403694325bce172e2b195dd4812e0f89e5f4e1930db124e2b383e4f067bed5d4858c354c0ae0b3fb03e4 +DIST ansible-lint-4.1.0.tar.gz 2911091 BLAKE2B b6e414dbdeebcc1cae900736829abf2db0930e5e05ae7c2bbd6d30a89b6ac28485ddfb63528bdc3baae6ef97ae7536507632d43b16f9a16dd86887d781940aeb SHA512 c1d07093d68bf5f43c20c3a999adf26d23ba587d5008a35069dcbab514b208737f5d0ecaf032e43d313233ea06193db81b349d5fb62f3ac684af9e51d8bc6e08 EBUILD ansible-lint-4.0.1.ebuild 986 BLAKE2B fe971f6268c3eb0052c1141d76d484956a5b609d33e497514a7930c35617b88b3c9daee9c33d46595eede2a8e3a2081864eaab96c523af57a50d2d9f4b990f11 SHA512 71915f40aaba50616ea001757093f5d1fbaed634512b0194bac4b1b7cd41214aaa9328584744968a1e053ba1470e3a0c88226c87f2856fa8148fe66114c82f64 +EBUILD ansible-lint-4.1.0.ebuild 1079 BLAKE2B f0bb03705adcc23eea2fb539e1ad5d6c6ae3f869eb978b0f1eeddabb1a285db99934e7890cd3925071fc11c3f4d8a0daf35b4afd75ef36e5d252d673f35f7c49 SHA512 96558436ac44b149299c407965b91097998853f46b6844570f51f1d161ce67ac9d94865bdb6bed5cfc92b018f4bb88d4b8041e1fcbb8e10d9010dbe47c696a91 MISC metadata.xml 468 BLAKE2B 6c6ebea3538b994b0ed427d005d3d46fa5bf115f25ea4de3b00e9fba3eaf44831ef0b54af5ddc352ad292ac4b6bcbb859583fb34b5bb358bc03ff25d43997215 SHA512 4dd15de2b2d9caf6cfe4518e9e4fcb476838c78c20d4edbeab8d78a602969201d7bee7bce8af1406e5a7e171cb481e7a08c58db599618e66d1c681a1537dfcfc diff --git a/app-admin/ansible-lint/ansible-lint-4.1.0.ebuild b/app-admin/ansible-lint/ansible-lint-4.1.0.ebuild new file mode 100644 index 000000000000..46715fcb9b42 --- /dev/null +++ b/app-admin/ansible-lint/ansible-lint-4.1.0.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DISTUTILS_USE_SETUPTOOLS=rdepend +PYTHON_COMPAT=( python3_{6,7} ) + +inherit distutils-r1 + +DESCRIPTION="Checks ansible playbooks for practices and behaviour that can be improved" +HOMEPAGE="https://github.com/ansible/ansible-lint" +SRC_URI="https://github.com/ansible/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="test" +RESTRICT="!test? ( test )" +PATCHES="${FILESDIR}/${P}-specifierset-split-setuptools.patch" + +CDEPEND="app-admin/ansible[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/six[${PYTHON_USEDEP}]" +DEPEND="dev-python/ruamel-yaml[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + dev-python/setuptools_scm[${PYTHON_USEDEP}] + dev-python/setuptools_scm_git_archive[${PYTHON_USEDEP}] + test? ( + dev-python/flake8[${PYTHON_USEDEP}] + dev-python/nose[${PYTHON_USEDEP}] + dev-python/wheel[${PYTHON_USEDEP}] + ) + ${CDEPEND}" +RDEPEND="${CDEPEND}" + +python_test() { + nosetests || die +} diff --git a/app-admin/ansible-lint/files/ansible-lint-4.1.0-specifierset-split-setuptools.patch b/app-admin/ansible-lint/files/ansible-lint-4.1.0-specifierset-split-setuptools.patch new file mode 100644 index 000000000000..4e4ac16d2389 --- /dev/null +++ b/app-admin/ansible-lint/files/ansible-lint-4.1.0-specifierset-split-setuptools.patch @@ -0,0 +1,175 @@ +From c91d23b2f82b4efb540168132842b243eb2d8b0d Mon Sep 17 00:00:00 2001 +From: Sviatoslav Sydorenko <wk@sydorenko.org.ua> +Date: Thu, 24 Oct 2019 01:38:35 +0200 +Subject: [PATCH] Drop support for setuptools older than 34.4.0 + +Resolves #599 +--- + setup.py | 141 +++++-------------------------------------------------- + 1 file changed, 13 insertions(+), 128 deletions(-) + +diff --git a/setup.py b/setup.py +index 25cc9e80d09e4657b56c4c4ed68d9411b7d7eae9..ff4c5bd65a7f5786c5af32750fb83dd3f6d92cec 100644 +--- a/setup.py ++++ b/setup.py +@@ -1,138 +1,16 @@ + #! /usr/bin/env python + """Ansible-lint distribution package setuptools installer.""" + +-import setuptools +- +- +-try: +- from setuptools.config import read_configuration, ConfigOptionsHandler +- import setuptools.config +- import setuptools.dist +- +- # Set default value for 'use_scm_version' +- setattr(setuptools.dist.Distribution, 'use_scm_version', False) +- +- # Attach bool parser to 'use_scm_version' option +- class ShimConfigOptionsHandler(ConfigOptionsHandler): +- """Extension class for ConfigOptionsHandler.""" +- +- @property +- def parsers(self): +- """Return an option mapping with default data type parsers.""" +- _orig_parsers = super(ShimConfigOptionsHandler, self).parsers +- return dict(use_scm_version=self._parse_bool, **_orig_parsers) +- +- setuptools.config.ConfigOptionsHandler = ShimConfigOptionsHandler +-except ImportError: +- """This is a shim for setuptools<30.3.""" +- import io +- import json +- +- try: +- from configparser import ConfigParser, NoSectionError +- except ImportError: +- from ConfigParser import ConfigParser, NoSectionError +- ConfigParser.read_file = ConfigParser.readfp +- +- def maybe_read_files(d): +- """Read files if the string starts with `file:` marker.""" +- d = d.strip() +- if not d.startswith('file:'): +- return d +- descs = [] +- for fname in map(str.strip, str(d[5:]).split(',')): +- with io.open(fname, encoding='utf-8') as f: +- descs.append(f.read()) +- return ''.join(descs) +- +- def cfg_val_to_list(v): +- """Turn config val to list and filter out empty lines.""" +- return list(filter(bool, map(str.strip, str(v).strip().splitlines()))) + +- def cfg_val_to_dict(v): +- """Turn config val to dict and filter out empty lines.""" +- return dict( +- map(lambda l: list(map(str.strip, l.split('=', 1))), +- filter(bool, map(str.strip, str(v).strip().splitlines()))) +- ) ++__requires__ = ('setuptools >= 34.4', ) + +- def cfg_val_to_primitive(v): +- """Parse primitive config val to appropriate data type.""" +- return json.loads(v.strip().lower()) + +- def read_configuration(filepath): +- """Read metadata and options from setup.cfg located at filepath.""" +- cfg = ConfigParser() +- with io.open(filepath, encoding='utf-8') as f: +- cfg.read_file(f) +- +- md = dict(cfg.items('metadata')) +- for list_key in 'classifiers', 'keywords': +- try: +- md[list_key] = cfg_val_to_list(md[list_key]) +- except KeyError: +- pass +- try: +- md['long_description'] = maybe_read_files(md['long_description']) +- except KeyError: +- pass +- opt = dict(cfg.items('options')) +- for list_key in 'use_scm_version', 'zip_safe': +- try: +- opt[list_key] = cfg_val_to_primitive(opt[list_key]) +- except KeyError: +- pass +- for list_key in 'scripts', 'install_requires', 'setup_requires': +- try: +- opt[list_key] = cfg_val_to_list(opt[list_key]) +- except KeyError: +- pass +- try: +- opt['package_dir'] = cfg_val_to_dict(opt['package_dir']) +- except KeyError: +- pass +- try: +- opt_package_data = dict(cfg.items('options.package_data')) +- if not opt_package_data.get('', '').strip(): +- opt_package_data[''] = opt_package_data['*'] +- del opt_package_data['*'] +- except (KeyError, NoSectionError): +- opt_package_data = {} +- try: +- opt_extras_require = dict(cfg.items('options.extras_require')) +- opt['extras_require'] = {} +- for k, v in opt_extras_require.items(): +- opt['extras_require'][k] = cfg_val_to_list(v) +- except NoSectionError: +- pass +- opt['package_data'] = {} +- for k, v in opt_package_data.items(): +- opt['package_data'][k] = cfg_val_to_list(v) +- cur_pkgs = opt.get('packages', '').strip() +- if '\n' in cur_pkgs: +- opt['packages'] = cfg_val_to_list(opt['packages']) +- elif cur_pkgs.startswith('find:'): +- opt_packages_find = dict(cfg.items('options.packages.find')) +- opt['packages'] = setuptools.find_packages(**opt_packages_find) +- return {'metadata': md, 'options': opt} +- +- +-setup_params = {} +-declarative_setup_params = read_configuration('setup.cfg') +- +-# Patch incorrectly decoded package_dir option +-# ``egg_info`` demands native strings failing with unicode under Python 2 +-# Ref https://github.com/pypa/setuptools/issues/1136 +-declarative_setup_params['options']['package_dir'] = { +- str(k): str(v) +- for k, v in declarative_setup_params['options']['package_dir'].items() +-} +- +-setup_params = dict(setup_params, **declarative_setup_params['metadata']) +-setup_params = dict(setup_params, **declarative_setup_params['options']) ++import setuptools ++from setuptools.config import read_configuration + + + def cut_local_version_on_upload(version): ++ """Generate a PEP440 local version if uploading to PyPI.""" + import os + import setuptools_scm.version # only present during setup time + IS_PYPI_UPLOAD = os.getenv('PYPI_UPLOAD') == 'true' +@@ -142,8 +20,15 @@ def cut_local_version_on_upload(version): + ) + + +-setup_params['use_scm_version'] = { +- 'local_scheme': cut_local_version_on_upload, ++# This is needed because even new ++# setuptools don't parse ++# `setup_requires` from `setup.cfg`: ++declarative_setup_params = read_configuration('setup.cfg') ++setup_params = { ++ 'setup_requires': declarative_setup_params['options']['setup_requires'], ++ 'use_scm_version': { ++ 'local_scheme': cut_local_version_on_upload, ++ } + } + + |