Gentoo Archives: gentoo-commits

From: Ian Delaney <idella4@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pep8/, dev-python/pep8/files/
Date: Fri, 25 Sep 2015 05:34:28
Message-Id: 1443159197.f9eac8f6c208ecdad7c3848b7becd6c426fee78b.idella4@gentoo
1 commit: f9eac8f6c208ecdad7c3848b7becd6c426fee78b
2 Author: Ian Delaney <idella4 <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 25 04:26:31 2015 +0000
4 Commit: Ian Delaney <idella4 <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 25 05:33:17 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9eac8f6
7
8 dev-python/pep8: revbump to 1.6.2-r1
9
10 backport upstream patch restoring flake8 compatibility, patch by maintainer
11 see https://github.com/gentoo/gentoo/pull/129/ and Bug #561394
12
13 Package-Manager: portage-2.2.20.1
14
15 .../pep8-1.6.2-restore-flake8-compatibility.patch | 69 ++++++++++++++++++++++
16 dev-python/pep8/pep8-1.6.2-r1.ebuild | 37 ++++++++++++
17 2 files changed, 106 insertions(+)
18
19 diff --git a/dev-python/pep8/files/pep8-1.6.2-restore-flake8-compatibility.patch b/dev-python/pep8/files/pep8-1.6.2-restore-flake8-compatibility.patch
20 new file mode 100644
21 index 0000000..f355772
22 --- /dev/null
23 +++ b/dev-python/pep8/files/pep8-1.6.2-restore-flake8-compatibility.patch
24 @@ -0,0 +1,69 @@
25 +commit 435d1cbf995a659a82d1d4b42d25e3459556ef21
26 +Author: Ian Lee <IanLee1521@×××××.com>
27 +Date: Tue Mar 17 21:52:23 2015 -0700
28 +
29 + Reverted fix for #368 which had unintended repurcussions in flake8 and other places.
30 +
31 + This fix reverts to the parsing of user config (~/.config/pep8), then local directory
32 + config files, and finally overrides with cli options as was the behavior back in 1.5.7
33 +
34 +diff --git a/CHANGES.txt b/CHANGES.txt
35 +index 85eb043..5499abd 100644
36 +--- a/CHANGES.txt
37 ++++ b/CHANGES.txt
38 +@@ -5,6 +5,12 @@ Changelog
39 + 1.6.x (unreleased)
40 + ------------------
41 +
42 ++Changes:
43 ++
44 ++* Reverted the fix in #368, "options passed on command line are only ones
45 ++ accepted" feature. This has many unintended consequences in pep8 and flake8
46 ++ and needs to be reworked when I have more time.
47 ++
48 + 1.6.2 (2015-02-15)
49 + ------------------
50 +
51 +diff --git a/pep8.py b/pep8.py
52 +index 9f40381..4d993da 100755
53 +--- a/pep8.py
54 ++++ b/pep8.py
55 +@@ -1984,24 +1984,24 @@ def read_config(options, args, arglist, parser):
56 +
57 + local_dir = os.curdir
58 +
59 ++ if USER_CONFIG and os.path.isfile(USER_CONFIG):
60 ++ if options.verbose:
61 ++ print('user configuration: %s' % USER_CONFIG)
62 ++ config.read(USER_CONFIG)
63 ++
64 ++ parent = tail = args and os.path.abspath(os.path.commonprefix(args))
65 ++ while tail:
66 ++ if config.read(os.path.join(parent, fn) for fn in PROJECT_CONFIG):
67 ++ local_dir = parent
68 ++ if options.verbose:
69 ++ print('local configuration: in %s' % parent)
70 ++ break
71 ++ (parent, tail) = os.path.split(parent)
72 ++
73 + if cli_conf and os.path.isfile(cli_conf):
74 + if options.verbose:
75 + print('cli configuration: %s' % cli_conf)
76 + config.read(cli_conf)
77 +- else:
78 +- if USER_CONFIG and os.path.isfile(USER_CONFIG):
79 +- if options.verbose:
80 +- print('user configuration: %s' % USER_CONFIG)
81 +- config.read(USER_CONFIG)
82 +-
83 +- parent = tail = args and os.path.abspath(os.path.commonprefix(args))
84 +- while tail:
85 +- if config.read(os.path.join(parent, fn) for fn in PROJECT_CONFIG):
86 +- local_dir = parent
87 +- if options.verbose:
88 +- print('local configuration: in %s' % parent)
89 +- break
90 +- (parent, tail) = os.path.split(parent)
91 +
92 + pep8_section = parser.prog
93 + if config.has_section(pep8_section):
94
95 diff --git a/dev-python/pep8/pep8-1.6.2-r1.ebuild b/dev-python/pep8/pep8-1.6.2-r1.ebuild
96 new file mode 100644
97 index 0000000..c9ac898
98 --- /dev/null
99 +++ b/dev-python/pep8/pep8-1.6.2-r1.ebuild
100 @@ -0,0 +1,37 @@
101 +# Copyright 1999-2015 Gentoo Foundation
102 +# Distributed under the terms of the GNU General Public License v2
103 +# $Id$
104 +
105 +EAPI=5
106 +PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy pypy3 )
107 +
108 +inherit distutils-r1
109 +
110 +DESCRIPTION="Python style guide checker"
111 +HOMEPAGE="https://github.com/jcrocholl/pep8 https://pypi.python.org/pypi/pep8"
112 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
113 +
114 +LICENSE="MIT"
115 +SLOT="0"
116 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
117 +IUSE="doc"
118 +
119 +DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
120 + doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
121 +RDEPEND="${DEPEND}"
122 +
123 +PATCHES=( "${FILESDIR}/${P}-restore-flake8-compatibility.patch" )
124 +
125 +python_compile_all() {
126 + use doc && emake -C docs html
127 +}
128 +
129 +python_test() {
130 + PYTHONPATH="${S}" "${PYTHON}" pep8.py -v --testsuite=testsuite || die
131 + PYTHONPATH="${S}" "${PYTHON}" pep8.py --doctest -v || die
132 +}
133 +
134 +python_install_all() {
135 + use doc && local HTML_DOCS=( docs/_build/html/. )
136 + distutils-r1_python_install_all
137 +}