8000 Add CI support for py3.8. (#988) · sabeelcoder/pythonnet@2736094 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2736094

Browse files
mathamfilmor
authored andcommitted
Add CI support for py3.8. (pythonnet#988)
* Add CI support for py3.8 * Add interop38.cs * Add PYTHON38 * Add support for 3.8 * Bump 3.7 to 3.8 * Allow failures for py3.8 because it's a Python 3.8.0 bug * Add note about py3.8.0 to readme
1 parent e193126 commit 2736094

File tree

6 files changed

+185
-15
lines changed

6 files changed

+185
-15
lines changed

README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ projects using pythonnet can be found in the Wiki:
9595

9696
https://github.com/pythonnet/pythonnet/wiki
9797

98+
Python 3.8.0 support
99+
--------------------
100+
101+
Some features are disabled in Python 3.8.0 because of
102+
`this bug in Python <https://bugs.python.org/issue37633>`_. The error is
103+
``System.EntryPointNotFoundException : Unable to find an entry point named
104+
'Py_CompileString' in DLL 'python38'``. This will be fixed in Python 3.8.1.
105+
98106
.. |Join the chat at https://gitter.im/pythonnet/pythonnet| image:: https://badges.gitter.im/pythonnet/pythonnet.svg
99107
:target: https://gitter.im/pythonnet/pythonnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
100108
.. |appveyor shield| image:: https://img.shields.io/appveyor/ci/pythonnet/pythonnet/master.svg?label=AppVeyor

appveyor.yml

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

3134
matrix:
3235
allow_failures:
3336
- PYTHON_VERSION: 3.4
3437
BUILD_OPTS: --xplat
3538
- PYTHON_VERSION: 3.4
39+
- PYTHON_VERSION: 3.8
40+
BUILD_OPTS: --xplat
41+
- PYTHON_VERSION: 3.8
3642

3743
init:
3844
# Update Environment Variables based on matrix/platform

src/runtime/Python.Runtime.15.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<Python2Version>$(PYTHONNET_PY2_VERSION)</Python2Version>
4343
<Python2Version Condition="'$(Python2Version)'==''">PYTHON27</Python2Version>
4444
<Python3Version>$(PYTHONNET_PY3_VERSION)</Python3Version>
45-
<Python3Version Condition="'$(Python3Version)'==''">PYTHON37</Python3Version>
45+
<Python3Version Condition="'$(Python3Version)'==''">PYTHON38</Python3Version>
4646
<PythonWinDefineConstants>$(PYTHONNET_WIN_DEFINE_CONSTANTS)</PythonWinDefineConstants>
4747
<PythonWinDefineConstants Condition="'$(PythonWinDefineConstants)'==''">UCS2</PythonWinDefineConstants>
4848
<PythonMonoDefineConstants>$(PYTHONNET_MONO_DEFINE_CONSTANTS)</PythonMonoDefineConstants>

src/runtime/Python.Runtime.csproj

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@
2222
</PropertyGroup>
2323
<!--We can relax binding to platform because code references no any platform dependent assemblies-->
2424
<!--This will allows to use any build of this assebly as a compile ref assebly-->
25-
<!--<PropertyGroup Condition=" '$(Platform)' == 'x86'">
26-
<PlatformTarget>x86</PlatformTarget>
27-
</PropertyGroup>
28-
<PropertyGroup Condition=" '$(Platform)' == 'x64'">
29-
<PlatformTarget>x64</PlatformTarget>
25+
<!--<PropertyGroup Condition=" '$(Platform)' == 'x86'">
26+
<PlatformTarget>x86</PlatformTarget>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Platform)' == 'x64'">
29+
<PlatformTarget>x64</PlatformTarget>
3030
</PropertyGroup>-->
3131
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseMono'">
3232
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2;PYTHON27;UCS4</DefineConstants>
3333
<Optimize>true</Optimize>
3434
<DebugType>pdbonly</DebugType>
3535
</PropertyGroup>
3636
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseMonoPY3'">
37-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS4</DefineConstants>
37+
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON38;UCS4</DefineConstants>
3838
<Optimize>true</Optimize>
3939
<DebugType>pdbonly</DebugType>
4040
</PropertyGroup>
@@ -46,7 +46,7 @@
4646
</PropertyGroup>
4747
<PropertyGroup Condition=" '$(Configuration)' == 'DebugMonoPY3'">
4848
<DebugSymbols>true</DebugSymbols>
49-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS4;TRACE;DEBUG</DefineConstants>
49+
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON38;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
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseWinPY3'">
59-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS2</DefineConstants>
59+
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON38;UCS2</DefineConstants>
6060
<Optimize>true</Optimize>
6161
<DebugType>pdbonly</DebugType>
6262
</PropertyGroup>
@@ -68,7 +68,7 @@
6868
</PropertyGroup>
6969
<PropertyGroup Condition=" '$(Configuration)' == 'DebugWinPY3'">
7070
<DebugSymbols>true</DebugSymbols>
71-
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS2;TRACE;DEBUG</DefineConstants>
71+
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON38;UCS2;TRACE;DEBUG</DefineConstants>
7272
<Optimize>false</Optimize>
7373
<DebugType>full</DebugType>
7474
</PropertyGroup>
@@ -140,8 +140,8 @@
140140
<Compile Include="typemanager.cs" />
141141
<Compile Include="typemethod.cs" />
142142
<Compile Include="Util.cs" />
143-
<Compile Include="platform\Types.cs" />
144-
<Compile Include="platform\LibraryLoader.cs" />
143+
<Compile Include="platform\Types.cs" />
144+
<Compile Include="platform\LibraryLoader.cs" />
145145
</ItemGroup>
146146
<ItemGroup Condition=" '$(PythonInteropFile)' != '' ">
147147
<Compile Include="$(PythonInteropFile)" />
@@ -151,7 +151,8 @@
151151
<Compile Include="interop34.cs" />
152152
<Compile Include="interop35.cs" />
153153
<Compile Include="interop36.cs" />
154-
<Compile Include="interop37.cs" />
154+
<Compile Include="interop37.cs" />
155+
<Compile Include="interop38.cs" />
155156
</ItemGroup>
156157
<ItemGroup>
157158
<None Include="..\pythonnet.snk" />
@@ -170,4 +171,4 @@
170171
<Copy SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
171172
<!--Copy SourceFiles="$(TargetAssemblyPdb)" Condition="Exists('$(TargetAssemblyPdb)')" DestinationFolder="$(PythonBuildDir)" /-->
172173
</Target>
173-
</Project>
174+
</Project>

src/runtime/interop38.cs

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
2+
// Auto-generated by geninterop.py.
3+
// DO NOT MODIFIY BY HAND.
4+
5+
6+
#if PYTHON38
7+
using System;
8+
using System.Collections;
9+
using System.Collections.Specialized;
10+
using System.Runtime.InteropServices;
11+
using System.Reflection;
12+
using System.Text;
13+
14+
namespace Python.Runtime
15+
{
16+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
17+
internal class TypeOffset
18+
{
19+
static TypeOffset()
20+
{
21+
Type type = typeof(TypeOffset);
22+
FieldInfo[] fi = type.GetFields();
23+
int size = IntPtr.Size;
24+
for (int i = 0; i < fi.Length; i++)
25+
{
26+
fi[i].SetValue(null, i * size);
27+
}
28+
}
29+
30+
public static int magic()
31+
{
32+
return ob_size;
33+
}
34+
35+
// Auto-generated from PyHeapTypeObject in Python.h
36+
public static int ob_refcnt = 0;
37+
public static int ob_type = 0;
38+
public static int ob_size = 0;
39+
public static int tp_name = 0;
40+
public static int tp_basicsize = 0;
41+
public static int tp_itemsize = 0;
42+
public static int tp_dealloc = 0;
43+
public static int tp_vectorcall_offset = 0;
44+
public static int tp_getattr = 0;
45+
public static int tp_setattr = 0;
46+
public static int tp_as_async = 0;
47+
public static int tp_repr = 0;
48+
public static int tp_as_number = 0;
49+
public static int tp_as_sequence = 0;
50+
public static int tp_as_mapping = 0;
51+
public static int tp_hash = 0;
52+
public static int tp_call = 0;
53+
public static int tp_str = 0;
54+
public static int tp_getattro = 0;
55+
public static int tp_setattro = 0;
56+
public static int tp_as_buffer = 0;
57+
public static int tp_flags = 0;
58+
public static int tp_doc = 0;
59+
public static int tp_traverse = 0;
60+
public static int tp_clear = 0;
61+
public static int tp_richcompare = 0;
62+
public static int tp_weaklistoffset = 0;
63+
public static int tp_iter = 0;
64+
public static int tp_iternext = 0;
65+
public static int tp_methods = 0;
66+
public static int tp_members = 0;
67+
public static int tp_getset = 0;
68+
public static int tp_base = 0;
69+
public static int tp_dict = 0;
70+
public static int tp_descr_get = 0;
71+
public static int tp_descr_set = 0;
72+
public static int tp_dictoffset = 0;
73+
public static int tp_init = 0;
74+
public static int tp_alloc = 0;
75+
public static int tp_new = 0;
76+
public static int tp_free = 0;
77+
public static int tp_is_gc = 0;
78+
public static int tp_bases = 0;
79+
public static int tp_mro = 0;
80+
public static int tp_cache = 0;
81+
public static int tp_subclasses = 0;
82+
public static int tp_weaklist = 0;
83+
public static int tp_del = 0;
84+
public static int tp_version_tag = 0;
85+
public static int tp_finalize = 0;
86+
public static int tp_vectorcall = 0;
87+
public static int am_await = 0;
88+
public static int am_aiter = 0;
89+
public static int am_anext = 0;
90+
public static int nb_add = 0;
91+
public static int nb_subtract = 0;
92+
public static int nb_multiply = 0;
93+
public static int nb_remainder = 0;
94+
public static int nb_divmod = 0;
95+
public static int nb_power = 0;
96+
public static int nb_negative = 0;
97+
public static int nb_positive = 0;
98+
public static int nb_absolute = 0;
99+
public static int nb_bool = 0;
100+
public static int nb_invert = 0;
101+
public static int nb_lshift = 0;
102+
public static int nb_rshift = 0;
103+
public static int nb_and = 0;
104+
public static int nb_xor = 0;
105+
public static int nb_or = 0;
106+
public static int nb_int = 0;
107+
public static int nb_reserved = 0;
108+
public static int nb_float = 0;
109+
public static int nb_inplace_add = 0;
110+
public static int nb_inplace_subtract = 0;
111+
public static int nb_inplace_multiply = 0;
112+
public static int nb_inplace_remainder = 0;
113+
public static int nb_inplace_power = 0;
114+
public static int nb_inplace_lshift = 0;
115+
public static int nb_inplace_rshift = 0;
116+
public static int nb_inplace_and = 0;
117+
public static int nb_inplace_xor = 0;
118+
public static int nb_inplace_or = 0;
119+
public static int nb_floor_divide = 0;
120+
public static int nb_true_divide = 0;
121+
public static int nb_inplace_floor_divide = 0;
122+
public static int nb_inplace_true_divide = 0;
123+
public static int nb_index = 0;
124+
public static int nb_matrix_multiply = 0;
125+
public static int nb_inplace_matrix_multiply = 0;
126+
public static int mp_length = 0;
127+
public static int mp_subscript = 0;
128+
public static int mp_ass_subscript = 0;
129+
public static int sq_length = 0;
130+
public static int sq_concat = 0;
131+
public static int sq_repeat = 0;
132+
public static int sq_item = 0;
133+
public static int was_sq_slice = 0;
134+
public static int sq_ass_item = 0;
135+
public static int was_sq_ass_slice = 0;
136+
public static int sq_contains = 0;
137+
public static int sq_inplace_concat = 0;
138+
public static int sq_inplace_repeat = 0;
139+
public static int bf_getbuffer = 0;
140+
public static int bf_releasebuffer = 0;
141+
public static int name = 0;
142+
public static int ht_slots = 0;
143+
public static int qualname = 0;
144+
public static int ht_cached_keys = 0;
145+
146+
/* here are optional user slots, followed by the members. */
147+
public static int members = 0;
148+
}
149+
}
150+
151+
#endif
152+

src/runtime/runtime.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ public class Runtime
6464
#elif PYTHON37
6565
internal const string _pyversion = "3.7";
6666
internal const string _pyver = "37";
67+
#elif PYTHON38
68+
internal const string _pyversion = "3.8";
69+
internal const string _pyver = "38";
6770
#else
68-
#error You must define one of PYTHON34 to PYTHON37 or PYTHON27
71+
#error You must define one of PYTHON34 to PYTHON38 or PYTHON27
6972
#endif
7073

7174
#if MONO_LINUX || MONO_OSX // Linux/macOS use dotted version string

0 commit comments

Comments
 (0)
0