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

Commit08344b7

Browse files
authored
Official python 3.7 support (#698)
* Create interop37.cs* try faking minimal crypt.h* Update appveyor.yml* Update test_exceptions.py* official python 3.7 on travis CI, but xenial with sudo* xenial support for mono and .netcore* Update .travis.yml* passing pthread support to clang based on:https://stackoverflow.com/questions/2391194/what-is-gs-pthread-equiv-in-clang* Update geninterop.py
2 parents784190a +222874c commit08344b7

File tree

10 files changed

+196
-21
lines changed

10 files changed

+196
-21
lines changed

‎.travis.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ matrix:
2222
-dotnet-hostfxr-2.0.0
2323
-dotnet-runtime-2.0.0
2424
-dotnet-sdk-2.0.0
25+
2526
-python:3.4
2627
env:*xplat-env
2728
addons:*xplat-addons
@@ -33,9 +34,24 @@ matrix:
3334
-python:3.6
3435
env:*xplat-env
3536
addons:*xplat-addons
36-
-python:"3.7-dev"
37+
38+
-python:3.7
3739
env:*xplat-env
38-
addons:*xplat-addons
40+
dist:xenial
41+
sudo:true
42+
addons:&xplat-addons-xenial
43+
apt:
44+
sources:
45+
-sourceline:deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main
46+
key_url:https://packages.microsoft.com/keys/microsoft.asc
47+
-sourceline:deb https://download.mono-project.com/repo/ubuntu stable-xenial main
48+
key_url:http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
49+
packages:
50+
-mono-devel
51+
-ca-certificates-mono
52+
-dotnet-hostfxr-2.0.0
53+
-dotnet-runtime-2.0.0
54+
-dotnet-sdk-2.0.0
3955

4056
# --------------------- Classic builds ------------------------
4157
-python:2.7
@@ -52,15 +68,18 @@ matrix:
5268
-python:3.6
5369
env:*classic-env
5470

55-
-python:"3.7-dev"
56-
env:*classic-env
57-
58-
allow_failures:
59-
-python:"3.7-dev"
60-
env:*xplat-env
61-
62-
-python:"3.7-dev"
71+
-python:3.7
6372
env:*classic-env
73+
dist:xenial
74+
sudo:true
75+
addons:
76+
apt:
77+
sources:
78+
-sourceline:deb http://download.mono-project.com/repo/ubuntu xenial main
79+
key_url:http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
80+
packages:
81+
-mono-devel
82+
-ca-certificates-mono
6483

6584
env:
6685
global:

‎CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
2020
- Implemented GetDynamicMemberNames() for PyObject to allow dynamic object members to be visible in the debugger ([#443][i443])([#690][p690])
2121
- Incorporated reference-style links to issues and pull requests in the CHANGELOG ([#608][i608])
2222
- Added detailed comments about aproaches and dangers to handle multi-app-domains ([#625][p625])
23+
- Python 3.7 support, builds and testing added. Defaults changed from Python 3.6 to 3.7 ([#698][p698])
2324

2425
###Changed
2526

‎appveyor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ environment:
2323
BUILD_OPTS:--xplat
2424
-PYTHON_VERSION:3.6
2525
BUILD_OPTS:--xplat
26+
-PYTHON_VERSION:3.7
27+
BUILD_OPTS:--xplat
2628
-PYTHON_VERSION:2.7
2729
-PYTHON_VERSION:3.4
2830
-PYTHON_VERSION:3.5
2931
-PYTHON_VERSION:3.6
32+
-PYTHON_VERSION:3.7
3033

3134
matrix:
3235
allow_failures:

‎setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# Allow config/verbosity to be set from cli
2323
# http://stackoverflow.com/a/4792601/5208670
2424
CONFIG="Release"# Release or Debug
25-
VERBOSITY="minimal"# quiet, minimal, normal, detailed, diagnostic
25+
VERBOSITY="normal"# quiet, minimal, normal, detailed, diagnostic
2626

2727
is_64bits=sys.maxsize>2**32
2828
DEVTOOLS="MsDev"ifsys.platform=="win32"else"Mono"
@@ -516,10 +516,10 @@ def run(self):
516516
'Programming Language :: Python :: 2',
517517
'Programming Language :: Python :: 2.7',
518518
'Programming Language :: Python :: 3',
519-
'Programming Language :: Python :: 3.3',
520519
'Programming Language :: Python :: 3.4',
521520
'Programming Language :: Python :: 3.5',
522521
'Programming Language :: Python :: 3.6',
522+
'Programming Language :: Python :: 3.7',
523523
'Operating System :: Microsoft :: Windows',
524524
'Operating System :: POSIX :: Linux',
525525
'Operating System :: MacOS :: MacOS X',

‎src/runtime/Python.Runtime.15.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<Python2Version>$(PYTHONNET_PY2_VERSION)</Python2Version>
3636
<Python2VersionCondition="'$(Python2Version)'==''">PYTHON27</Python2Version>
3737
<Python3Version>$(PYTHONNET_PY3_VERSION)</Python3Version>
38-
<Python3VersionCondition="'$(Python3Version)'==''">PYTHON36</Python3Version>
38+
<Python3VersionCondition="'$(Python3Version)'==''">PYTHON37</Python3Version>
3939
<PythonWinDefineConstants>$(PYTHONNET_WIN_DEFINE_CONSTANTS)</PythonWinDefineConstants>
4040
<PythonWinDefineConstantsCondition="'$(PythonWinDefineConstants)'==''">UCS2</PythonWinDefineConstants>
4141
<PythonMonoDefineConstants>$(PYTHONNET_MONO_DEFINE_CONSTANTS)</PythonMonoDefineConstants>

‎src/runtime/Python.Runtime.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<DebugType>pdbonly</DebugType>
3535
</PropertyGroup>
3636
<PropertyGroupCondition=" '$(Configuration)' == 'ReleaseMonoPY3'">
37-
<DefineConstantsCondition="'$(DefineConstants)' == ''">PYTHON3;PYTHON36;UCS4</DefineConstants>
37+
<DefineConstantsCondition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS4</DefineConstants>
3838
<Optimize>true</Optimize>
3939
<DebugType>pdbonly</DebugType>
4040
</PropertyGroup>
@@ -46,7 +46,7 @@
4646
</PropertyGroup>
4747
<PropertyGroupCondition=" '$(Configuration)' == 'DebugMonoPY3'">
4848
<DebugSymbols>true</DebugSymbols>
49-
<DefineConstantsCondition="'$(DefineConstants)' == ''">PYTHON3;PYTHON36;UCS4;TRACE;DEBUG</DefineConstants>
49+
<DefineConstantsCondition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS4;TRACE;DEBUG</DefineConstants>
5050
<Optimize>false</Optimize>
5151
<DebugType>full</DebugType>
5252
</PropertyGroup>
@@ -56,7 +56,7 @@
5656
<DebugType>pdbonly</DebugType>
5757
</PropertyGroup>
5858
<PropertyGroupCondition=" '$(Configuration)' == 'ReleaseWinPY3'">
59-
<DefineConstantsCondition="'$(DefineConstants)' == ''">PYTHON3;PYTHON36;UCS2</DefineConstants>
59+
<DefineConstantsCondition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS2</DefineConstants>
6060
<Optimize>true</Optimize>
6161
<DebugType>pdbonly</DebugType>
6262
</PropertyGroup>
@@ -68,7 +68,7 @@
6868
</PropertyGroup>
6969
<PropertyGroupCondition=" '$(Configuration)' == 'DebugWinPY3'">
7070
<DebugSymbols>true</DebugSymbols>
71-
<DefineConstantsCondition="'$(DefineConstants)' == ''">PYTHON3;PYTHON36;UCS2;TRACE;DEBUG</DefineConstants>
71+
<DefineConstantsCondition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS2;TRACE;DEBUG</DefineConstants>
7272
<Optimize>false</Optimize>
7373
<DebugType>full</DebugType>
7474
</PropertyGroup>
@@ -166,4 +166,4 @@
166166
<CopySourceFiles="$(TargetAssembly)"DestinationFolder="$(PythonBuildDir)" />
167167
<!--Copy SourceFiles="$(TargetAssemblyPdb)" Condition="Exists('$(TargetAssemblyPdb)')" DestinationFolder="$(PythonBuildDir)" /-->
168168
</Target>
169-
</Project>
169+
</Project>

‎src/runtime/interop37.cs

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
// Auto-generated by geninterop.py.
2+
// DO NOT MODIFIY BY HAND.
3+
4+
5+
#ifPYTHON37
6+
usingSystem;
7+
usingSystem.Collections;
8+
usingSystem.Collections.Specialized;
9+
usingSystem.Runtime.InteropServices;
10+
usingSystem.Reflection;
11+
usingSystem.Text;
12+
13+
namespacePython.Runtime
14+
{
15+
[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)]
16+
internalclassTypeOffset
17+
{
18+
staticTypeOffset()
19+
{
20+
Typetype=typeof(TypeOffset);
21+
FieldInfo[]fi=type.GetFields();
22+
intsize=IntPtr.Size;
23+
for(inti=0;i<fi.Length;i++)
24+
{
25+
fi[i].SetValue(null,i*size);
26+
}
27+
}
28+
29+
publicstaticintmagic()
30+
{
31+
returnob_size;
32+
}
33+
34+
// Auto-generated from PyHeapTypeObject in Python.h
35+
publicstaticintob_refcnt=0;
36+
publicstaticintob_type=0;
37+
publicstaticintob_size=0;
38+
publicstaticinttp_name=0;
39+
publicstaticinttp_basicsize=0;
40+
publicstaticinttp_itemsize=0;
41+
publicstaticinttp_dealloc=0;
42+
publicstaticinttp_print=0;
43+
publicstaticinttp_getattr=0;
44+
publicstaticinttp_setattr=0;
45+
publicstaticinttp_as_async=0;
46+
publicstaticinttp_repr=0;
47+
publicstaticinttp_as_number=0;
48+
publicstaticinttp_as_sequence=0;
49+
publicstaticinttp_as_mapping=0;
50+
publicstaticinttp_hash=0;
51+
publicstaticinttp_call=0;
52+
publicstaticinttp_str=0;
53+
publicstaticinttp_getattro=0;
54+
publicstaticinttp_setattro=0;
55+
publicstaticinttp_as_buffer=0;
56+
publicstaticinttp_flags=0;
57+
publicstaticinttp_doc=0;
58+
publicstaticinttp_traverse=0;
59+
publicstaticinttp_clear=0;
60+
publicstaticinttp_richcompare=0;
61+
publicstaticinttp_weaklistoffset=0;
62+
publicstaticinttp_iter=0;
63+
publicstaticinttp_iternext=0;
64+
publicstaticinttp_methods=0;
65+
publicstaticinttp_members=0;
66+
publicstaticinttp_getset=0;
67+
publicstaticinttp_base=0;
68+
publicstaticinttp_dict=0;
69+
publicstaticinttp_descr_get=0;
70+
publicstaticinttp_descr_set=0;
71+
publicstaticinttp_dictoffset=0;
72+
publicstaticinttp_init=0;
73+
publicstaticinttp_alloc=0;
74+
publicstaticinttp_new=0;
75+
publicstaticinttp_free=0;
76+
publicstaticinttp_is_gc=0;
77+
publicstaticinttp_bases=0;
78+
publicstaticinttp_mro=0;
79+
publicstaticinttp_cache=0;
80+
publicstaticinttp_subclasses=0;
81+
publicstaticinttp_weaklist=0;
82+
publicstaticinttp_del=0;
83+
publicstaticinttp_version_tag=0;
84+
publicstaticinttp_finalize=0;
85+
publicstaticintam_await=0;
86+
publicstaticintam_aiter=0;
87+
publicstaticintam_anext=0;
88+
publicstaticintnb_add=0;
89+
publicstaticintnb_subtract=0;
90+
publicstaticintnb_multiply=0;
91+
publicstaticintnb_remainder=0;
92+
publicstaticintnb_divmod=0;
93+
publicstaticintnb_power=0;
94+
publicstaticintnb_negative=0;
95+
publicstaticintnb_positive=0;
96+
publicstaticintnb_absolute=0;
97+
publicstaticintnb_bool=0;
98+
publicstaticintnb_invert=0;
99+
publicstaticintnb_lshift=0;
100+
publicstaticintnb_rshift=0;
101+
publicstaticintnb_and=0;
102+
publicstaticintnb_xor=0;
103+
publicstaticintnb_or=0;
104+
publicstaticintnb_int=0;
105+
publicstaticintnb_reserved=0;
106+
publicstaticintnb_float=0;
107+
publicstaticintnb_inplace_add=0;
108+
publicstaticintnb_inplace_subtract=0;
109+
publicstaticintnb_inplace_multiply=0;
110+
publicstaticintnb_inplace_remainder=0;
111+
publicstaticintnb_inplace_power=0;
112+
publicstaticintnb_inplace_lshift=0;
113+
publicstaticintnb_inplace_rshift=0;
114+
publicstaticintnb_inplace_and=0;
115+
publicstaticintnb_inplace_xor=0;
116+
publicstaticintnb_inplace_or=0;
117+
publicstaticintnb_floor_divide=0;
118+
publicstaticintnb_true_divide=0;
119+
publicstaticintnb_inplace_floor_divide=0;
120+
publicstaticintnb_inplace_true_divide=0;
121+
publicstaticintnb_index=0;
122+
publicstaticintnb_matrix_multiply=0;
123+
publicstaticintnb_inplace_matrix_multiply=0;
124+
publicstaticintmp_length=0;
125+
publicstaticintmp_subscript=0;
126+
publicstaticintmp_ass_subscript=0;
127+
publicstaticintsq_length=0;
128+
publicstaticintsq_concat=0;
129+
publicstaticintsq_repeat=0;
130+
publicstaticintsq_item=0;
131+
publicstaticintwas_sq_slice=0;
132+
publicstaticintsq_ass_item=0;
133+
publicstaticintwas_sq_ass_slice=0;
134+
publicstaticintsq_contains=0;
135+
publicstaticintsq_inplace_concat=0;
136+
publicstaticintsq_inplace_repeat=0;
137+
publicstaticintbf_getbuffer=0;
138+
publicstaticintbf_releasebuffer=0;
139+
publicstaticintname=0;
140+
publicstaticintht_slots=0;
141+
publicstaticintqualname=0;
142+
publicstaticintht_cached_keys=0;
143+
144+
/* here are optional user slots, followed by the members. */
145+
publicstaticintmembers=0;
146+
}
147+
}
148+
149+
#endif

‎src/tests/test_exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ def test_python_compat_of_managed_exceptions():
289289
asserte.args== (msg,)
290290
assertisinstance(e.args,tuple)
291291
ifPY3:
292-
assertrepr(e)=="OverflowException('Simple message',)"
292+
strexp="OverflowException('Simple message"
293+
assertrepr(e)[:len(strexp)]==strexp
293294
elifPY2:
294295
assertrepr(e)=="OverflowException(u'Simple message',)"
295296

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include"features.h"

‎tools/geninterop/geninterop.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ def preprocess_python_headers():
173173
"-D","__attribute__(x)=",
174174
"-D","__inline__=inline",
175175
"-D","__asm__=;#pragma asm",
176-
"-D","__int64=long long"
176+
"-D","__int64=long long",
177+
"-D","_POSIX_THREADS"
177178
]
178179

179180
ifhasattr(sys,"abiflags"):
@@ -185,7 +186,7 @@ def preprocess_python_headers():
185186
defines.extend(("-D","PYTHON_WITH_WIDE_UNICODE"))
186187

187188
python_h=os.path.join(include_py,"Python.h")
188-
cmd= ["clang","-I"]+include_dirs+defines+ ["-E",python_h]
189+
cmd= ["clang","-pthread","-I"]+include_dirs+defines+ ["-E",python_h]
189190

190191
# normalize as the parser doesn't like windows line endings.
191192
lines= []

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp