all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 343c121b20520df1408d4d6febaf525e902a5845 2000 bytes (raw)
name: gnu/packages/patches/python-contextlib2.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
Make it so the test script included in the contextlib2 tarball will be run
when setup.py is invoked with the "test" target. Succeed if and only if the
tests pass.

--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,36 @@
 #!/usr/bin/env python
+import subprocess
+import sys
+
 from distutils.core import setup
+from distutils.cmd import Command
+
+
+class TestRunner(Command):
+    description = "run the test script"
+    # distutils requires that user_options be set, but we don't actually need
+    # to create any special options for this command, so we use an empty list.
+    user_options = []
+    def initialize_options(self):
+        # All Command subclasses are required to implement this method,
+        # but we don't actually need to set up any options for this command.
+        pass
+
+    def finalize_options(self):
+        # Same as above.
+        pass
+
+    def run(self):
+        # The absolute path to the executable file for the currently
+        # running Python interpreter is in sys.executable. Let's just
+        # use that to invoke the tests like someone might from the
+        # shell. If the tests fail, this method call will raise an
+        # exception. The exception will not be caught, so it will cause
+        # the current Python interpreter to print a stack trace and exit
+        # with a non-zero exit code. The test output will go to
+        # stdout/stderr regardless of whether the tests succeed or fail.
+        subprocess.check_call([sys.executable, "./test_contextlib2.py", "-v"])
+
 
 # Technically, unittest2 is a dependency to run the tests on 2.6 and 3.1
 # This file ignores that, since I don't want to depend on distribute
@@ -10,6 +41,7 @@ setup(
     version=open('VERSION.txt').read().strip(),
     py_modules=['contextlib2'],
     license='PSF License',
+    cmdclass={'test': TestRunner},
     description='Backports and enhancements for the contextlib module',
     long_description=open('README.txt').read(),
     author='Nick Coghlan',

debug log:

solving 343c121 ...
found 343c121 in https://yhetil.org/guix/CAEKzfHki1Nq01yUrDf08gFfc+dxahS2kBcoqwhn_1zWWt8Lq8w@mail.gmail.com/

applying [1/1] https://yhetil.org/guix/CAEKzfHki1Nq01yUrDf08gFfc+dxahS2kBcoqwhn_1zWWt8Lq8w@mail.gmail.com/
diff --git a/gnu/packages/patches/python-contextlib2.patch b/gnu/packages/patches/python-contextlib2.patch
new file mode 100644
index 0000000..343c121

1:47: trailing whitespace.
 
Checking patch gnu/packages/patches/python-contextlib2.patch...
Applied patch gnu/packages/patches/python-contextlib2.patch cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 343c121b20520df1408d4d6febaf525e902a5845	gnu/packages/patches/python-contextlib2.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.