summaryrefslogtreecommitdiff
blob: 0d2ff91b620e612c285728aac097baabf9d11700 (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
From: Lukas Fleischer
Subject: python tests: Do not require .pyo files
Date: Sun, 20 May 2018 17:28:52 +0200

As of Python 3.5, but unoptimized and optimized bytecode are stored
within .pyc files; .pyo files are no longer generated. Update the Python
tests such that the test do not fail if .pyo files are missing.

Source: https://lists.gnu.org/archive/html/automake-patches/2018-05/msg00002.html
Reviewed-by: Andreas K. Hüttel <dilfridge@gentoo.org>

* t/py-compile-basedir.sh: Remove all .pyo checks.
* t/py-compile-basic.sh: Likewise.
* t/py-compile-destdir.sh: Likewise.
* t/py-compile-option-terminate.sh: Likewise.
* t/python-virtualenv.sh: Likewise.
* t/python10.sh: Likewise.
* t/python12.sh: Likewise.
* t/python3.sh: Likewise.
---
 t/py-compile-basedir.sh          |  2 --
 t/py-compile-basic.sh            |  3 ---
 t/py-compile-destdir.sh          | 12 +++++-------
 t/py-compile-option-terminate.sh |  5 -----
 t/python-virtualenv.sh           |  4 ----
 t/python10.sh                    |  6 ------
 t/python12.sh                    |  3 +--
 t/python3.sh                     |  1 -
 8 files changed, 6 insertions(+), 30 deletions(-)

diff --git a/t/py-compile-basedir.sh b/t/py-compile-basedir.sh
index 6921d16d5..9f927d066 100644
--- a/t/py-compile-basedir.sh
+++ b/t/py-compile-basedir.sh
@@ -40,9 +40,7 @@ for d in foo foo/bar "$(pwd)/foo" . .. ../foo ''; do
   ./py-compile --basedir "$d" "$f.py" "sub/$f.py"
   find "$d2" # For debugging.
   py_installed "$d2/$f.pyc"
-  py_installed "$d2/$f.pyo"
   py_installed "$d2/sub/$f.pyc"
-  py_installed "$d2/sub/$f.pyo"
   files=$(find "$d2" | grep '\.py[co]$')
   test $(echo "$files" | wc -l) -eq 4
   case $d2 in
diff --git a/t/py-compile-basic.sh b/t/py-compile-basic.sh
index 24df600cb..4c5cf57aa 100644
--- a/t/py-compile-basic.sh
+++ b/t/py-compile-basic.sh
@@ -61,10 +61,7 @@ mkdir -p 1/_/2/_/3/_
 
 ./py-compile foo.py sub/bar.py 1/_/2/_/3/_/0.py
 py_installed foo.pyc
-py_installed foo.pyo
 py_installed sub/bar.pyc
-py_installed sub/bar.pyo
 py_installed 1/_/2/_/3/_/0.pyc
-py_installed 1/_/2/_/3/_/0.pyo
 
 :
diff --git a/t/py-compile-destdir.sh b/t/py-compile-destdir.sh
index 07aa1f44f..d2ccafee5 100644
--- a/t/py-compile-destdir.sh
+++ b/t/py-compile-destdir.sh
@@ -34,13 +34,11 @@ echo 'def bar (): return "bar"' > $destdir/sub/bar.py
 
 find $destdir # For debugging.
 st=0
-for x in c o; do
-  for b in foo sub/bar; do
-    f=$(pyc_location -p "$destdir/$b.py$x")
-    test -f "$f"
-    strings "$f" || : # For debugging.
-    $FGREP $destdir $f && { echo BAD: $f; st=1; }
-  done
+for b in foo sub/bar; do
+  f=$(pyc_location -p "$destdir/$b.pyc")
+  test -f "$f"
+  strings "$f" || : # For debugging.
+  $FGREP $destdir $f && { echo BAD: $f; st=1; }
 done
 exit $st
 
diff --git a/t/py-compile-option-terminate.sh b/t/py-compile-option-terminate.sh
index 1aaeec21b..80ae55a88 100644
--- a/t/py-compile-option-terminate.sh
+++ b/t/py-compile-option-terminate.sh
@@ -27,17 +27,12 @@ cp "$am_scriptdir/py-compile" . \
 : > ./--foo.py
 ./py-compile -- -o.py --foo.py
 py_installed ./-o.pyc
-py_installed ./-o.pyo
 py_installed ./--foo.pyc
-py_installed ./--foo.pyo
 rm -f ./-*.py[co]
 : > x.py
 ./py-compile x.py -o.py --foo.py
 py_installed ./x.pyc
-py_installed ./x.pyo
 py_installed ./-o.pyc
-py_installed ./-o.pyo
 py_installed ./--foo.pyc
-py_installed ./--foo.pyo
 
 :
diff --git a/t/python-virtualenv.sh b/t/python-virtualenv.sh
index 3bcd6ec76..7f9708866 100644
--- a/t/python-virtualenv.sh
+++ b/t/python-virtualenv.sh
@@ -124,10 +124,8 @@ check_install ()
 
   test -f      "$py_site"/am_foo.py
   py_installed "$py_site"/am_foo.pyc
-  py_installed "$py_site"/am_foo.pyo
   py_installed "$py_site"/am_virtenv/__init__.py
   py_installed "$py_site"/am_virtenv/__init__.pyc
-  py_installed "$py_site"/am_virtenv/__init__.pyo
   test -f      "$py_site"/libquux.a
   test -f      "$py_site"/am_virtenv/libzardoz.a
 }
@@ -138,10 +136,8 @@ check_uninstall ()
 
   test ! -e          "$py_site"/am_foo.py
   py_installed --not "$py_site"/am_foo.pyc
-  py_installed --not "$py_site"/am_foo.pyo
   test ! -e          "$py_site"/am_virtenv/__init__.py
   py_installed --not "$py_site"/am_virtenv/__init__.pyc
-  py_installed --not "$py_site"/am_virtenv/__init__.pyo
   test ! -e          "$py_site"/libquux.a
   test ! -e          "$py_site"/am_virtenv/libzardoz.a
 }
diff --git a/t/python10.sh b/t/python10.sh
index 4def103ff..9c7a46175 100644
--- a/t/python10.sh
+++ b/t/python10.sh
@@ -60,27 +60,21 @@ cwd=$(pwd) || fatal_ "getting current working directory"
 $MAKE install
 test -f            "$inst/your/two.py"
 py_installed       "$inst/your/two.pyc"
-py_installed       "$inst/your/two.pyo"
 py_installed --not "$inst/my/one.py"
 py_installed --not "$inst/my/one.pyc"
-py_installed --not "$inst/my/one.pyo"
 $MAKE uninstall
 py_installed --not "$inst/your/two.py"
 py_installed --not "$inst/your/two.pyc"
-py_installed --not "$inst/your/two.pyo"
 
 ../configure --prefix=$cwd/"$inst" one=1
 $MAKE install
 py_installed --not "$inst/your/two.py"
 py_installed --not "$inst/your/two.pyc"
-py_installed --not "$inst/your/two.pyo"
 test -f            "$inst/my/one.py"
 py_installed       "$inst/my/one.pyc"
-py_installed       "$inst/my/one.pyo"
 $MAKE uninstall
 py_installed --not "$inst/my/one.py"
 py_installed --not "$inst/my/one.pyc"
-py_installed --not "$inst/my/one.pyo"
 
 $MAKE disttest
 
diff --git a/t/python12.sh b/t/python12.sh
index d998ae8ad..cca057e6d 100644
--- a/t/python12.sh
+++ b/t/python12.sh
@@ -44,11 +44,10 @@ $MAKE install DESTDIR=$destdir
 
 # Perfunctory test that the files were created.
 test -f "$destdir/usr/share/my/my.py"
-pyo=$(pyc_location -p "$destdir/usr/share/my/my.pyo")
 pyc=$(pyc_location -p "$destdir/usr/share/my/my.pyc")
 
 # If DESTDIR has made it into the byte compiled files, fail the test.
-st=0; $FGREP "$destdir" "$pyc" "$pyo" || st=$?
+st=0; $FGREP "$destdir" "$pyc" || st=$?
 test $st -eq 1
 
 :
diff --git a/t/python3.sh b/t/python3.sh
index 0008eadd7..131aeb48d 100644
--- a/t/python3.sh
+++ b/t/python3.sh
@@ -42,6 +42,5 @@ cd build
 $MAKE install
 py_installed inst/my/one.py
 py_installed inst/my/one.pyc
-py_installed inst/my/one.pyo
 
 :
-- 
2.17.0