* [gentoo-commits] repo/gentoo:master commit in: dev-python/python-distutils-extra/, dev-python/python-distutils-extra/files/
@ 2020-04-27 19:52 Michał Górny
0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2020-04-27 19:52 UTC (permalink / raw
To: gentoo-commits
commit: 9ca86cb31b2ddf3740a4e9ee11437f5f09a49ce8
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 27 19:48:41 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Apr 27 19:48:41 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ca86cb3
dev-python/python-distutils-extra: Fix tests
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
| 27 ++++++++++++++++++++++
| 15 ++++++++----
2 files changed, 37 insertions(+), 5 deletions(-)
--git a/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-test.patch b/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-test.patch
new file mode 100644
index 00000000000..b00fc32d017
--- /dev/null
+++ b/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-test.patch
@@ -0,0 +1,27 @@
+From 33026583f3b2f59bcc415fae4c1ae84bfd058817 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 27 Apr 2020 21:25:37 +0200
+Subject: [PATCH] test: Find .egg-info file rather than guessing path (wrong)
+
+---
+ test/auto.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/test/auto.py b/test/auto.py
+index b9644ba..1d605e6 100755
+--- a/test/auto.py
++++ b/test/auto.py
+@@ -734,7 +734,9 @@ print ('import iamnota.module')
+ # parse .egg-info
+ (o, e, s) = self.setup_py(['install_egg_info', '-d', self.install_tree])
+ self.assertEqual(e, 'ERROR: Python module unknown not found\n')
+- egg = self._installed_contents('foo-0.1.egg-info').splitlines()
++ egg_paths = [x for x in inst if x.endswith('.egg-info')]
++ self.assertEqual(len(egg_paths), 1)
++ egg = self._installed_contents(egg_paths[0].strip(os.path.sep)).splitlines()
+ self.assertIn('Name: foo', egg)
+
+ # check provides
+--
+2.26.2
+
--git a/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild b/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild
index c279a3684ff..8952cf77dcd 100644
--- a/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild
+++ b/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild
@@ -18,14 +18,19 @@ SRC_URI="
LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
DOCS=( doc/{README,FAQ} )
-src_prepare() {
- sed -e 's:test_requires_provides:_&:' \
- -i test/auto.py || die
- distutils-r1_src_prepare
-}
+BDEPEND="
+ dev-libs/gobject-introspection
+ dev-python/httplib2
+ dev-python/pygobject"
+
+PATCHES=(
+ "${FILESDIR}"/python-distutils-extra-2.44-test.patch
+)
python_test() {
unset PYTHONDONTWRITEBYTECODE
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/python-distutils-extra/, dev-python/python-distutils-extra/files/
@ 2020-04-28 9:09 Michał Górny
0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2020-04-28 9:09 UTC (permalink / raw
To: gentoo-commits
commit: 989d3afa60f33f990a777c254afe4dfe4e248f3a
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 28 09:06:24 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Apr 28 09:09:24 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=989d3afa
dev-python/python-distutils-extra: Fix --skip-build support
Closes: https://bugs.gentoo.org/718394
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
| 63 ++++++++++++++++++++++
| 1 +
2 files changed, 64 insertions(+)
--git a/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-skip-build.patch b/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-skip-build.patch
new file mode 100644
index 00000000000..f2a19990ed3
--- /dev/null
+++ b/dev-python/python-distutils-extra/files/python-distutils-extra-2.44-skip-build.patch
@@ -0,0 +1,63 @@
+From 4f5e11110ce9cc3f511c798acfc009ce5db4e9ef Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Tue, 28 Apr 2020 10:48:18 +0200
+Subject: [PATCH] Fix install_auto command with --skip-build
+
+python-distutils-extra seems to rely on a very bad practice of modifying
+internal state (file lists) in middle of `build` commands. As a result,
+if the package is installed via `build` command followed by `install
+--skip-build` (since everything was built already!), most of the files
+are not installed.
+
+Ideally, this would be resolved by making internal state updates
+independent of `build` command execution. However, given that
+the package is not really alive and worth the effort, let's settle
+on a cheap hack of calling all `build_*` subcommands from `install`
+if `--skip-build` is used. This partially reverses what standard
+distutils `install` command does but it will rebuild only the data files
+rather than all C extensions.
+
+Modify tests to use `--skip-build` unconditionally to test this better.
+Testing both scenarios probably makes little sense.
+---
+ DistUtilsExtra/auto.py | 7 +++++++
+ test/auto.py | 5 +++--
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/DistUtilsExtra/auto.py b/DistUtilsExtra/auto.py
+index ea15183..db45f7a 100644
+--- a/DistUtilsExtra/auto.py
++++ b/DistUtilsExtra/auto.py
+@@ -711,6 +711,13 @@ class sdist_auto(distutils.command.sdist.sdist):
+
+ class install_auto(distutils.command.install.install):
+ def run(self):
++ # run build_* subcommands to get file lists if install command
++ # won't run 'build' for us
++ if self.skip_build:
++ self.run_command('build_help')
++ self.run_command('build_i18n')
++ self.run_command('build_icons')
++
+ # install files from etc/
+ if os.path.isdir('etc'):
+ # work around a bug in copy_tree() which fails with "File exists" on
+diff --git a/test/auto.py b/test/auto.py
+index b9644ba..15780c6 100755
+--- a/test/auto.py
++++ b/test/auto.py
+@@ -873,8 +873,9 @@ print ('import iamnota.module')
+ '''
+ self.install_tree = tempfile.mkdtemp()
+
+- return self.setup_py(['install', '--no-compile', '--prefix=/usr',
+- '--root=' + self.install_tree])
++ self.setup_py(['build'])
++ return self.setup_py(['install', '--no-compile', '--skip-build',
++ '--prefix=/usr', '--root=' + self.install_tree])
+
+ def installed_files(self):
+ '''Return list of file paths in install tree.'''
+--
+2.26.2
+
diff --git a/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild b/dev-python/python-distutils-extra/python-distutils-extra-2.44-r1.ebuild
similarity index 94%
rename from dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild
rename to dev-python/python-distutils-extra/python-distutils-extra-2.44-r1.ebuild
index 7b03b650654..459bb16f3d8 100644
--- a/dev-python/python-distutils-extra/python-distutils-extra-2.44.ebuild
+++ b/dev-python/python-distutils-extra/python-distutils-extra-2.44-r1.ebuild
@@ -32,6 +32,7 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/python-distutils-extra-2.44-test.patch
+ "${FILESDIR}"/python-distutils-extra-2.44-skip-build.patch
)
python_test() {
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-28 9:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-27 19:52 [gentoo-commits] repo/gentoo:master commit in: dev-python/python-distutils-extra/, dev-python/python-distutils-extra/files/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2020-04-28 9:09 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox