Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdb23464

Browse files
committed
plpython: Remove regression test infrastructure for Python 2.
Since19252e8 we reject Python 2 during build configuration. Now that thedust on the buildfarm has settled, remove regression testing infrastructuredealing with differing output between Python 2 / 3.Reviewed-By: Peter Eisentraut <peter@eisentraut.org>Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/20211031184548.g4sxfe47n2kyi55r@alap3.anarazel.de
1 parent76a29ad commitdb23464

File tree

60 files changed

+625
-2236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+625
-2236
lines changed

‎contrib/hstore_plpython/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# Generated subdirectories
2-
/expected/python3/
32
/log/
43
/results/
5-
/sql/python3/
64
/tmp_check/

‎contrib/hstore_plpython/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ EXTENSION = hstore_plpython3u
1010
DATA = hstore_plpython3u--1.0.sql
1111

1212
REGRESS = hstore_plpython
13-
REGRESS_PLPYTHON3_MANGLE :=$(REGRESS)
1413

1514
PG_CPPFLAGS =$(python_includespec) -DPLPYTHON_LIBNAME='"plpython$(python_majorversion)"'
1615

@@ -37,9 +36,4 @@ SHLIB_LINK += $(python_libspec) $(python_additional_libs)
3736
endif
3837

3938
REGRESS_OPTS += --load-extension=hstore
40-
ifeq ($(python_majorversion),2)
41-
REGRESS_OPTS += --load-extension=plpythonu --load-extension=hstore_plpythonu
42-
endif
4339
EXTRA_INSTALL += contrib/hstore
44-
45-
include$(top_srcdir)/src/pl/plpython/regress-python3-mangle.mk

‎contrib/hstore_plpython/expected/hstore_plpython.out

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
CREATE EXTENSIONhstore_plpython2u CASCADE;
2-
NOTICE: installing required extension "plpython2u"
1+
CREATE EXTENSIONhstore_plpython3u CASCADE;
2+
NOTICE: installing required extension "plpython3u"
33
-- test hstore -> python
44
CREATE FUNCTION test1(val hstore) RETURNS int
5-
LANGUAGEplpythonu
5+
LANGUAGEplpython3u
66
TRANSFORM FOR TYPE hstore
77
AS $$
88
assert isinstance(val, dict)
@@ -18,7 +18,7 @@ INFO: [('aa', 'bb'), ('cc', None)]
1818

1919
-- the same with the versioned language name
2020
CREATE FUNCTION test1n(val hstore) RETURNS int
21-
LANGUAGEplpython2u
21+
LANGUAGEplpython3u
2222
TRANSFORM FOR TYPE hstore
2323
AS $$
2424
assert isinstance(val, dict)
@@ -34,7 +34,7 @@ INFO: [('aa', 'bb'), ('cc', None)]
3434

3535
-- test hstore[] -> python
3636
CREATE FUNCTION test1arr(val hstore[]) RETURNS int
37-
LANGUAGEplpythonu
37+
LANGUAGEplpython3u
3838
TRANSFORM FOR TYPE hstore
3939
AS $$
4040
assert(val == [{'aa': 'bb', 'cc': None}, {'dd': 'ee'}])
@@ -48,7 +48,7 @@ SELECT test1arr(array['aa=>bb, cc=>NULL'::hstore, 'dd=>ee']);
4848

4949
-- test python -> hstore
5050
CREATE FUNCTION test2(a int, b text) RETURNS hstore
51-
LANGUAGEplpythonu
51+
LANGUAGEplpython3u
5252
TRANSFORM FOR TYPE hstore
5353
AS $$
5454
val = {'a': a, 'b': b, 'c': None}
@@ -65,14 +65,14 @@ SELECT test2(1, 'boo');
6565
CREATE OR REPLACE FUNCTION public.test2(a integer, b text)
6666
RETURNS hstore
6767
TRANSFORM FOR TYPE hstore
68-
LANGUAGEplpythonu
68+
LANGUAGEplpython3u
6969
AS $function$
7070
val = {'a': a, 'b': b, 'c': None}
7171
return val
7272
$function$
7373
-- test python -> hstore[]
7474
CREATE FUNCTION test2arr() RETURNS hstore[]
75-
LANGUAGEplpythonu
75+
LANGUAGEplpython3u
7676
TRANSFORM FOR TYPE hstore
7777
AS $$
7878
val = [{'a': 1, 'b': 'boo', 'c': None}, {'d': 2}]
@@ -87,7 +87,7 @@ SELECT test2arr();
8787
-- test python -> domain over hstore
8888
CREATE DOMAIN hstore_foo AS hstore CHECK(VALUE ? 'foo');
8989
CREATE FUNCTION test2dom(fn text) RETURNS hstore_foo
90-
LANGUAGEplpythonu
90+
LANGUAGEplpython3u
9191
TRANSFORM FOR TYPE hstore
9292
AS $$
9393
return {'a': 1, fn: 'boo', 'c': None}
@@ -104,7 +104,7 @@ CONTEXT: while creating return value
104104
PL/Python function "test2dom"
105105
-- test as part of prepare/execute
106106
CREATE FUNCTION test3() RETURNS void
107-
LANGUAGEplpythonu
107+
LANGUAGEplpython3u
108108
TRANSFORM FOR TYPE hstore
109109
AS $$
110110
rv = plpy.execute("SELECT 'aa=>bb, cc=>NULL'::hstore AS col1")
@@ -131,7 +131,7 @@ SELECT * FROM test1;
131131
(1 row)
132132

133133
CREATE FUNCTION test4() RETURNS trigger
134-
LANGUAGEplpythonu
134+
LANGUAGEplpython3u
135135
TRANSFORM FOR TYPE hstore
136136
AS $$
137137
assert(TD["new"] == {'a': 1, 'b': {'aa': 'bb', 'cc': None}})

‎contrib/hstore_plpython/sql/hstore_plpython.sql

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
CREATE EXTENSIONhstore_plpython2u CASCADE;
1+
CREATE EXTENSIONhstore_plpython3u CASCADE;
22

33

44
-- test hstore -> python
55
CREATEFUNCTIONtest1(val hstore) RETURNSint
6-
LANGUAGEplpythonu
6+
LANGUAGEplpython3u
77
TRANSFORM FOR TYPE hstore
88
AS $$
99
assert isinstance(val, dict)
@@ -16,7 +16,7 @@ SELECT test1('aa=>bb, cc=>NULL'::hstore);
1616

1717
-- the same with the versioned language name
1818
CREATEFUNCTIONtest1n(val hstore) RETURNSint
19-
LANGUAGEplpython2u
19+
LANGUAGEplpython3u
2020
TRANSFORM FOR TYPE hstore
2121
AS $$
2222
assert isinstance(val, dict)
@@ -29,7 +29,7 @@ SELECT test1n('aa=>bb, cc=>NULL'::hstore);
2929

3030
-- test hstore[] -> python
3131
CREATEFUNCTIONtest1arr(val hstore[]) RETURNSint
32-
LANGUAGEplpythonu
32+
LANGUAGEplpython3u
3333
TRANSFORM FOR TYPE hstore
3434
AS $$
3535
assert(val== [{'aa':'bb','cc': None}, {'dd':'ee'}])
@@ -41,7 +41,7 @@ SELECT test1arr(array['aa=>bb, cc=>NULL'::hstore, 'dd=>ee']);
4141

4242
-- test python -> hstore
4343
CREATEFUNCTIONtest2(aint, btext) RETURNS hstore
44-
LANGUAGEplpythonu
44+
LANGUAGEplpython3u
4545
TRANSFORM FOR TYPE hstore
4646
AS $$
4747
val= {'a': a,'b': b,'c': None}
@@ -56,7 +56,7 @@ SELECT test2(1, 'boo');
5656

5757
-- test python -> hstore[]
5858
CREATEFUNCTIONtest2arr() RETURNS hstore[]
59-
LANGUAGEplpythonu
59+
LANGUAGEplpython3u
6060
TRANSFORM FOR TYPE hstore
6161
AS $$
6262
val= [{'a':1,'b':'boo','c': None}, {'d':2}]
@@ -70,7 +70,7 @@ SELECT test2arr();
7070
CREATEDOMAINhstore_fooAS hstoreCHECK(VALUE ?'foo');
7171

7272
CREATEFUNCTIONtest2dom(fntext) RETURNS hstore_foo
73-
LANGUAGEplpythonu
73+
LANGUAGEplpython3u
7474
TRANSFORM FOR TYPE hstore
7575
AS $$
7676
return {'a':1, fn:'boo','c': None}
@@ -82,7 +82,7 @@ SELECT test2dom('bar'); -- fail
8282

8383
-- test as part of prepare/execute
8484
CREATEFUNCTIONtest3() RETURNS void
85-
LANGUAGEplpythonu
85+
LANGUAGEplpython3u
8686
TRANSFORM FOR TYPE hstore
8787
AS $$
8888
rv=plpy.execute("SELECT 'aa=>bb, cc=>NULL'::hstore AS col1")
@@ -103,7 +103,7 @@ INSERT INTO test1 VALUES (1, 'aa=>bb, cc=>NULL');
103103
SELECT*FROM test1;
104104

105105
CREATEFUNCTIONtest4() RETURNS trigger
106-
LANGUAGEplpythonu
106+
LANGUAGEplpython3u
107107
TRANSFORM FOR TYPE hstore
108108
AS $$
109109
assert(TD["new"]== {'a':1,'b': {'aa':'bb','cc': None}})

‎contrib/jsonb_plpython/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# Generated subdirectories
2-
/expected/python3/
32
/log/
43
/results/
5-
/sql/python3/
64
/tmp_check/

‎contrib/jsonb_plpython/Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ EXTENSION = jsonb_plpython3u
1212
DATA = jsonb_plpython3u--1.0.sql
1313

1414
REGRESS = jsonb_plpython
15-
REGRESS_PLPYTHON3_MANGLE :=$(REGRESS)
1615

1716
ifdefUSE_PGXS
1817
PG_CONFIG = pg_config
@@ -33,9 +32,3 @@ else
3332
rpathdir =$(python_libdir)
3433
SHLIB_LINK +=$(python_libspec)$(python_additional_libs)
3534
endif
36-
37-
ifeq ($(python_majorversion),2)
38-
REGRESS_OPTS += --load-extension=plpythonu --load-extension=jsonb_plpythonu
39-
endif
40-
41-
include$(top_srcdir)/src/pl/plpython/regress-python3-mangle.mk

‎contrib/jsonb_plpython/expected/jsonb_plpython.out

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
CREATE EXTENSIONjsonb_plpython2u CASCADE;
2-
NOTICE: installing required extension "plpython2u"
1+
CREATE EXTENSIONjsonb_plpython3u CASCADE;
2+
NOTICE: installing required extension "plpython3u"
33
-- test jsonb -> python dict
44
CREATE FUNCTION test1(val jsonb) RETURNS int
5-
LANGUAGEplpythonu
5+
LANGUAGEplpython3u
66
TRANSFORM FOR TYPE jsonb
77
AS $$
88
assert isinstance(val, dict)
@@ -18,7 +18,7 @@ SELECT test1('{"a": 1, "c": "NULL"}'::jsonb);
1818
-- test jsonb -> python dict
1919
-- complex dict with dicts as value
2020
CREATE FUNCTION test1complex(val jsonb) RETURNS int
21-
LANGUAGEplpython2u
21+
LANGUAGEplpython3u
2222
TRANSFORM FOR TYPE jsonb
2323
AS $$
2424
assert isinstance(val, dict)
@@ -34,7 +34,7 @@ SELECT test1complex('{"d": {"d": 1}}'::jsonb);
3434
-- test jsonb[] -> python dict
3535
-- dict with array as value
3636
CREATE FUNCTION test1arr(val jsonb) RETURNS int
37-
LANGUAGEplpythonu
37+
LANGUAGEplpython3u
3838
TRANSFORM FOR TYPE jsonb
3939
AS $$
4040
assert isinstance(val, dict)
@@ -50,7 +50,7 @@ SELECT test1arr('{"d":[12, 1]}'::jsonb);
5050
-- test jsonb[] -> python list
5151
-- simple list
5252
CREATE FUNCTION test2arr(val jsonb) RETURNS int
53-
LANGUAGEplpythonu
53+
LANGUAGEplpython3u
5454
TRANSFORM FOR TYPE jsonb
5555
AS $$
5656
assert isinstance(val, list)
@@ -66,7 +66,7 @@ SELECT test2arr('[12, 1]'::jsonb);
6666
-- test jsonb[] -> python list
6767
-- array of dicts
6868
CREATE FUNCTION test3arr(val jsonb) RETURNS int
69-
LANGUAGEplpythonu
69+
LANGUAGEplpython3u
7070
TRANSFORM FOR TYPE jsonb
7171
AS $$
7272
assert isinstance(val, list)
@@ -81,7 +81,7 @@ SELECT test3arr('[{"a": 1, "b": 2}, {"c": 3,"d": 4}]'::jsonb);
8181

8282
-- test jsonb int -> python int
8383
CREATE FUNCTION test1int(val jsonb) RETURNS int
84-
LANGUAGEplpythonu
84+
LANGUAGEplpython3u
8585
TRANSFORM FOR TYPE jsonb
8686
AS $$
8787
assert(val == 1)
@@ -95,7 +95,7 @@ SELECT test1int('1'::jsonb);
9595

9696
-- test jsonb string -> python string
9797
CREATE FUNCTION test1string(val jsonb) RETURNS text
98-
LANGUAGEplpythonu
98+
LANGUAGEplpython3u
9999
TRANSFORM FOR TYPE jsonb
100100
AS $$
101101
assert(val == "a")
@@ -109,7 +109,7 @@ SELECT test1string('"a"'::jsonb);
109109

110110
-- test jsonb null -> python None
111111
CREATE FUNCTION test1null(val jsonb) RETURNS int
112-
LANGUAGEplpythonu
112+
LANGUAGEplpython3u
113113
TRANSFORM FOR TYPE jsonb
114114
AS $$
115115
assert(val == None)
@@ -123,7 +123,7 @@ SELECT test1null('null'::jsonb);
123123

124124
-- test python -> jsonb
125125
CREATE FUNCTION roundtrip(val jsonb) RETURNS jsonb
126-
LANGUAGEplpythonu
126+
LANGUAGEplpython3u
127127
TRANSFORM FOR TYPE jsonb
128128
as $$
129129
return val
@@ -238,7 +238,7 @@ SELECT roundtrip('["string", "string2"]'::jsonb);
238238

239239
-- complex numbers -> jsonb
240240
CREATE FUNCTION testComplexNumbers() RETURNS jsonb
241-
LANGUAGEplpythonu
241+
LANGUAGEplpython3u
242242
TRANSFORM FOR TYPE jsonb
243243
AS $$
244244
x = 1 + 2j
@@ -250,7 +250,7 @@ CONTEXT: while creating return value
250250
PL/Python function "testcomplexnumbers"
251251
-- range -> jsonb
252252
CREATE FUNCTION testRange() RETURNS jsonb
253-
LANGUAGEplpythonu
253+
LANGUAGEplpython3u
254254
TRANSFORM FOR TYPE jsonb
255255
AS $$
256256
x = range(3)
@@ -264,7 +264,7 @@ SELECT testRange();
264264

265265
-- 0xff -> jsonb
266266
CREATE FUNCTION testDecimal() RETURNS jsonb
267-
LANGUAGEplpythonu
267+
LANGUAGEplpython3u
268268
TRANSFORM FOR TYPE jsonb
269269
AS $$
270270
x = 0xff
@@ -278,7 +278,7 @@ SELECT testDecimal();
278278

279279
-- tuple -> jsonb
280280
CREATE FUNCTION testTuple() RETURNS jsonb
281-
LANGUAGEplpythonu
281+
LANGUAGEplpython3u
282282
TRANSFORM FOR TYPE jsonb
283283
AS $$
284284
x = (1, 'String', None)
@@ -292,7 +292,7 @@ SELECT testTuple();
292292

293293
-- interesting dict -> jsonb
294294
CREATE FUNCTION test_dict1() RETURNS jsonb
295-
LANGUAGEplpythonu
295+
LANGUAGEplpython3u
296296
TRANSFORM FOR TYPE jsonb
297297
AS $$
298298
x = {"a": 1, None: 2, 33: 3}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp