Skip to content

Add CI support for py3.8. #988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ projects using pythonnet can be found in the Wiki:

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

Python 3.8.0 support
--------------------

Some features are disabled in Python 3.8.0 because of
`this bug in Python <https://bugs.python.org/issue37633>`_. The error is
``System.EntryPointNotFoundException : Unable to find an entry point named
'Py_CompileString' in DLL 'python38'``. This will be fixed in Python 3.8.1.

.. |Join the chat at https://gitter.im/pythonnet/pythonnet| image:: https://badges.gitter.im/pythonnet/pythonnet.svg
:target: https://gitter.im/pythonnet/pythonnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. |appveyor shield| image:: https://img.shields.io/appveyor/ci/pythonnet/pythonnet/master.svg?label=AppVeyor
Expand Down
6 changes: 6 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,22 @@ environment:
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.7
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.8
BUILD_OPTS: --xplat
- PYTHON_VERSION: 2.7
- PYTHON_VERSION: 3.5
- PYTHON_VERSION: 3.6
- PYTHON_VERSION: 3.7
- PYTHON_VERSION: 3.8

matrix:
allow_failures:
- PYTHON_VERSION: 3.4
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.4
- PYTHON_VERSION: 3.8
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.8

init:
# Update Environment Variables based on matrix/platform
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/Python.Runtime.15.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<Python2Version>$(PYTHONNET_PY2_VERSION)</Python2Version>
<Python2Version Condition="'$(Python2Version)'==''">PYTHON27</Python2Version>
<Python3Version>$(PYTHONNET_PY3_VERSION)</Python3Version>
<Python3Version Condition="'$(Python3Version)'==''">PYTHON37</Python3Version>
<Python3Version Condition="'$(Python3Version)'==''">PYTHON38</Python3Version>
<PythonWinDefineConstants>$(PYTHONNET_WIN_DEFINE_CONSTANTS)</PythonWinDefineConstants>
<PythonWinDefineConstants Condition="'$(PythonWinDefineConstants)'==''">UCS2</PythonWinDefineConstants>
<PythonMonoDefineConstants>$(PYTHONNET_MONO_DEFINE_CONSTANTS)</PythonMonoDefineConstants>
Expand Down
27 changes: 14 additions & 13 deletions src/runtime/Python.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
</PropertyGroup>
<!--We can relax binding to platform because code references no any platform dependent assemblies-->
<!--This will allows to use any build of this assebly as a compile ref assebly-->
<!--<PropertyGroup Condition=" '$(Platform)' == 'x86'">
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x64'">
<PlatformTarget>x64</PlatformTarget>
<!--<PropertyGroup Condition=" '$(Platform)' == 'x86'">
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x64'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>-->
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseMono'">
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2;PYTHON27;UCS4</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseMonoPY3'">
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS4</DefineConstants>
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON38;UCS4</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
</PropertyGroup>
Expand All @@ -46,7 +46,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'DebugMonoPY3'">
<DebugSymbols>true</DebugSymbols>
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS4;TRACE;DEBUG</DefineConstants>
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON38;UCS4;TRACE;DEBUG</DefineConstants>
<Optimize>false</Optimize>
<DebugType>full</DebugType>
</PropertyGroup>
Expand All @@ -56,7 +56,7 @@
<DebugType>pdbonly</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseWinPY3'">
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS2</DefineConstants>
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON38;UCS2</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
</PropertyGroup>
Expand All @@ -68,7 +68,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'DebugWinPY3'">
<DebugSymbols>true</DebugSymbols>
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON37;UCS2;TRACE;DEBUG</DefineConstants>
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON3;PYTHON38;UCS2;TRACE;DEBUG</DefineConstants>
<Optimize>false</Optimize>
<DebugType>full</DebugType>
</PropertyGroup>
Expand Down Expand Up @@ -140,8 +140,8 @@
<Compile Include="typemanager.cs" />
<Compile Include="typemethod.cs" />
<Compile Include="Util.cs" />
<Compile Include="platform\Types.cs" />
<Compile Include="platform\LibraryLoader.cs" />
<Compile Include="platform\Types.cs" />
<Compile Include="platform\LibraryLoader.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(PythonInteropFile)' != '' ">
<Compile Include="$(PythonInteropFile)" />
Expand All @@ -151,7 +151,8 @@
<Compile Include="interop34.cs" />
<Compile Include="interop35.cs" />
<Compile Include="interop36.cs" />
<Compile Include="interop37.cs" />
<Compile Include="interop37.cs" />
<Compile Include="interop38.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\pythonnet.snk" />
Expand All @@ -170,4 +171,4 @@
<Copy SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
<!--Copy SourceFiles="$(TargetAssemblyPdb)" Condition="Exists('$(TargetAssemblyPdb)')" DestinationFolder="$(PythonBuildDir)" /-->
</Target>
</Project>
</Project>
152 changes: 152 additions & 0 deletions src/runtime/interop38.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@

// Auto-generated by geninterop.py.
// DO NOT MODIFIY BY HAND.


#if PYTHON38
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Text;

namespace Python.Runtime
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
internal class TypeOffset
{
static TypeOffset()
{
Type type = typeof(TypeOffset);
FieldInfo[] fi = type.GetFields();
int size = IntPtr.Size;
for (int i = 0; i < fi.Length; i++)
{
fi[i].SetValue(null, i * size);
}
}

public static int magic()
{
return ob_size;
}

// Auto-generated from PyHeapTypeObject in Python.h
public static int ob_refcnt = 0;
public static int ob_type = 0;
public static int ob_size = 0;
public static int tp_name = 0;
public static int tp_basicsize = 0;
public static int tp_itemsize = 0;
public static int tp_dealloc = 0;
public static int tp_vectorcall_offset = 0;
public static int tp_getattr = 0;
public static int tp_setattr = 0;
public static int tp_as_async = 0;
public static int tp_repr = 0;
public static int tp_as_number = 0;
public static int tp_as_sequence = 0;
public static int tp_as_mapping = 0;
public static int tp_hash = 0;
public static int tp_call = 0;
public static int tp_str = 0;
public static int tp_getattro = 0;
public static int tp_setattro = 0;
public static int tp_as_buffer = 0;
public static int tp_flags = 0;
public static int tp_doc = 0;
public static int tp_traverse = 0;
public static int tp_clear = 0;
public static int tp_richcompare = 0;
public static int tp_weaklistoffset = 0;
public static int tp_iter = 0;
public static int tp_iternext = 0;
public static int tp_methods = 0;
public static int tp_members = 0;
public static int tp_getset = 0;
public static int tp_base = 0;
public static int tp_dict = 0;
public static int tp_descr_get = 0;
public static int tp_descr_set = 0;
public static int tp_dictoffset = 0;
public static int tp_init = 0;
public static int tp_alloc = 0;
public static int tp_new = 0;
public static int tp_free = 0;
public static int tp_is_gc = 0;
public static int tp_bases = 0;
public static int tp_mro = 0;
public static int tp_cache = 0;
public static int tp_subclasses = 0;
public static int tp_weaklist = 0;
public static int tp_del = 0;
public static int tp_version_tag = 0;
public static int tp_finalize = 0;
public static int tp_vectorcall = 0;
public static int am_await = 0;
public static int am_aiter = 0;
public static int am_anext = 0;
public static int nb_add = 0;
public static int nb_subtract = 0;
public static int nb_multiply = 0;
public static int nb_remainder = 0;
public static int nb_divmod = 0;
public static int nb_power = 0;
public static int nb_negative = 0;
public static int nb_positive = 0;
public static int nb_absolute = 0;
public static int nb_bool = 0;
public static int nb_invert = 0;
public static int nb_lshift = 0;
public static int nb_rshift = 0;
public static int nb_and = 0;
public static int nb_xor = 0;
public static int nb_or = 0;
public static int nb_int = 0;
public static int nb_reserved = 0;
public static int nb_float = 0;
public static int nb_inplace_add = 0;
public static int nb_inplace_subtract = 0;
public static int nb_inplace_multiply = 0;
public static int nb_inplace_remainder = 0;
public static int nb_inplace_power = 0;
public static int nb_inplace_lshift = 0;
public static int nb_inplace_rshift = 0;
public static int nb_inplace_and = 0;
public static int nb_inplace_xor = 0;
public static int nb_inplace_or = 0;
public static int nb_floor_divide = 0;
public static int nb_true_divide = 0;
public static int nb_inplace_floor_divide = 0;
public static int nb_inplace_true_divide = 0;
public static int nb_index = 0;
public static int nb_matrix_multiply = 0;
public static int nb_inplace_matrix_multiply = 0;
public static int mp_length = 0;
public static int mp_subscript = 0;
public static int mp_ass_subscript = 0;
public static int sq_length = 0;
public static int sq_concat = 0;
public static int sq_repeat = 0;
public static int sq_item = 0;
public static int was_sq_slice = 0;
public static int sq_ass_item = 0;
public static int was_sq_ass_slice = 0;
public static int sq_contains = 0;
public static int sq_inplace_concat = 0;
public static int sq_inplace_repeat = 0;
public static int bf_getbuffer = 0;
public static int bf_releasebuffer = 0;
public static int name = 0;
public static int ht_slots = 0;
public static int qualname = 0;
public static int ht_cached_keys = 0;

/* here are optional user slots, followed by the members. */
public static int members = 0;
}
}

#endif

5 changes: 4 additions & 1 deletion src/runtime/runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ public class Runtime
#elif PYTHON37
internal const string _pyversion = "3.7";
internal const string _pyver = "37";
#elif PYTHON38
internal const string _pyversion = "3.8";
internal const string _pyver = "38";
#else
#error You must define one of PYTHON34 to PYTHON37 or PYTHON27
#error You must define one of PYTHON34 to PYTHON38 or PYTHON27
#endif

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