Skip to content

Commit

Permalink
Merge pull request python#11 from paulmon/win-arm32-pip
Browse files Browse the repository at this point in the history
pip requires distutils
  • Loading branch information
paulmon authored Oct 8, 2018
2 parents 6657d0d + 7bac6bc commit 2f233f6
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Lib/distutils/tests/test_bdist.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
"""Tests for distutils.command.bdist."""
import os
import platform
import unittest
from test.support import run_unittest

from distutils.command.bdist import bdist
from distutils.tests import support


SKIP_MESSAGE = (None if platform.win32_editionId() != 'IoTUAP' else
"These tests don't work on windows arm32")

@unittest.skipUnless(SKIP_MESSAGE is None, SKIP_MESSAGE)
class BuildTestCase(support.TempdirManager,
unittest.TestCase):

Expand Down
6 changes: 5 additions & 1 deletion Lib/distutils/tests/test_bdist_msi.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
"""Tests for distutils.command.bdist_msi."""
import platform
import sys
import unittest
from test.support import run_unittest
from distutils.tests import support


@unittest.skipUnless(sys.platform == 'win32', 'these tests require Windows')
SKIP_MESSAGE = (None if sys.platform == "win32" and platform.win32_editionId() != 'IoTUAP' else
"These tests require Windows x86 or x64. ARM is not supported")

@unittest.skipUnless(SKIP_MESSAGE is None, SKIP_MESSAGE)
class BDistMSITestCase(support.TempdirManager,
support.LoggingSilencer,
unittest.TestCase):
Expand Down
5 changes: 5 additions & 0 deletions Lib/distutils/tests/test_bdist_wininst.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
"""Tests for distutils.command.bdist_wininst."""
import platform
import unittest
from test.support import run_unittest

from distutils.command.bdist_wininst import bdist_wininst
from distutils.tests import support

SKIP_MESSAGE = (None if platform.win32_editionId() != 'IoTUAP' else
"These tests don't work on windows arm32")

@unittest.skipUnless(SKIP_MESSAGE is None, SKIP_MESSAGE)
class BuildWinInstTestCase(support.TempdirManager,
support.LoggingSilencer,
unittest.TestCase):
Expand Down
5 changes: 5 additions & 0 deletions Lib/distutils/tests/test_build_ext.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
import os
import platform
from io import StringIO
import textwrap

Expand All @@ -21,6 +22,10 @@
ALREADY_TESTED = False


SKIP_MESSAGE = (None if platform.win32_editionId() != 'IoTUAP' else
"These tests don't work on windows arm32")

@unittest.skipUnless(SKIP_MESSAGE is None, SKIP_MESSAGE)
class BuildExtTestCase(TempdirManager,
LoggingSilencer,
unittest.TestCase):
Expand Down
3 changes: 2 additions & 1 deletion Lib/distutils/tests/test_msvc9compiler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for distutils.msvc9compiler."""
import platform
import sys
import unittest
import os
Expand Down Expand Up @@ -90,7 +91,7 @@
</dependency>
</assembly>"""

if sys.platform=="win32":
if sys.platform=="win32" and platform.win32_editionId() != 'IoTUAP':
from distutils.msvccompiler import get_build_version
if get_build_version()>=8.0:
SKIP_MESSAGE = None
Expand Down
3 changes: 2 additions & 1 deletion Lib/distutils/tests/test_msvccompiler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for distutils._msvccompiler."""
import platform
import sys
import unittest
import os
Expand All @@ -8,7 +9,7 @@
from test.support import run_unittest


SKIP_MESSAGE = (None if sys.platform == "win32" else
SKIP_MESSAGE = (None if sys.platform == "win32" and platform.win32_editionId() != 'IoTUAP' else
"These tests are only for win32")

@unittest.skipUnless(SKIP_MESSAGE is None, SKIP_MESSAGE)
Expand Down
2 changes: 2 additions & 0 deletions Lib/distutils/tests/test_sysconfig.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Tests for distutils.sysconfig."""
import os
import platform
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -168,6 +169,7 @@ def test_SO_in_vars(self):
self.assertIsNotNone(vars['SO'])
self.assertEqual(vars['SO'], vars['EXT_SUFFIX'])

@unittest.skipIf(platform.win32_editionId() == 'IoTUAP', "API not present on Windows 10 IoT Core")
def test_customize_compiler_before_get_config_vars(self):
# Issue #21923: test that a Distribution compiler
# instance can be called without an explicit call to
Expand Down
18 changes: 17 additions & 1 deletion PCbuild/_distutils_findvs.vcxproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
Expand All @@ -9,6 +13,10 @@
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGInstrument|ARM">
<Configuration>PGInstrument</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGInstrument|Win32">
<Configuration>PGInstrument</Configuration>
<Platform>Win32</Platform>
Expand All @@ -17,6 +25,10 @@
<Configuration>PGInstrument</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGUpdate|ARM">
<Configuration>PGUpdate</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGUpdate|Win32">
<Configuration>PGUpdate</Configuration>
<Platform>Win32</Platform>
Expand All @@ -25,6 +37,10 @@
<Configuration>PGUpdate</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
Expand Down Expand Up @@ -61,7 +77,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>version.lib;ole32.lib;oleaut32.lib;Microsoft.VisualStudio.Setup.Configuration.Native.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>version.lib;ole32.lib;oleaut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(PySourcePath)PC\external\$(PlatformToolset)\$(ArchName)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
Expand Down
6 changes: 4 additions & 2 deletions PCbuild/pcbuild.sln
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,8 @@ Global
{12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|Win32.Build.0 = Release|Win32
{12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|x64.ActiveCfg = Release|x64
{12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|x64.Build.0 = Release|x64
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|ARM.ActiveCfg = Debug|Win32
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|ARM.ActiveCfg = Debug|ARM
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|ARM.Build.0 = Debug|ARM
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|Win32.ActiveCfg = Debug|Win32
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|Win32.Build.0 = Debug|Win32
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Debug|x64.ActiveCfg = Debug|x64
Expand All @@ -1007,7 +1008,8 @@ Global
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.PGUpdate|x64.Build.0 = PGUpdate|x64
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|ARM.ActiveCfg = Release|Win32
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|ARM.ActiveCfg = Release|ARM
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|ARM.Build.0 = Release|ARM
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|Win32.ActiveCfg = Release|Win32
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|Win32.Build.0 = Release|Win32
{41ADEDF9-11D8-474E-B4D7-BB82332C878E}.Release|x64.ActiveCfg = Release|x64
Expand Down
2 changes: 1 addition & 1 deletion Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
exc = POP(); /* exc */
/* fall through */
case 0:
#ifdef _M_ARM
#if defined(_M_ARM) && !defined(DEBUG)
// work around optimizer problem on windows arm32
if (oparg == 2)
{
Expand Down
15 changes: 14 additions & 1 deletion Tools/winiot/sync_win_iot.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

EXCLUDE_FILE_FROM_LIBRARY = {
'bdist_wininst.py',
#'bdist_wininst.py',
}

EXCLUDE_FILE_FROM_LIBS = {
Expand Down Expand Up @@ -107,6 +107,13 @@ def include_in_lib(p):
suffix = p.suffix.lower()
return suffix not in {'.pyc', '.pyo', '.exe'}

def include_in_libs(p):
# if is_debug(p):
# print ('include_in_libs: {} is debug'.format(p))
# return False

return p.stem.lower() not in EXCLUDE_FILE_FROM_LIBS

def include_in_tools(p):
if p.is_dir() and p.name.lower() in {'scripts', 'i18n', 'pynche', 'demo', 'parser'}:
return True
Expand All @@ -122,7 +129,10 @@ def include_in_tools(p):
('/', '$source', '{}.dll'.format(BASE_NAME), is_not_debug),
('DLLs/', '$source', '*.pyd', is_not_debug),
('DLLs/', '$source', '*.dll', is_not_python),
('include/', 'include', '*.h', None),
('include/', 'PC', 'pyconfig.h', None),
('Lib/', 'Lib', '**/*', include_in_lib),
('libs/', '$source', '*.lib', include_in_libs),
('Tools/', 'Tools', '**/*', include_in_tools),
]

Expand All @@ -131,9 +141,12 @@ def include_in_tools(p):
('/', '$source', 'pythonw_d.exe', is_debug),
('/', '$source', 'python{}_d.dll'.format(sys.version_info.major), is_debug),
('/', '$source', '{}_d.dll'.format(BASE_NAME), is_debug),
('include/', 'include', '*.h', None),
('include/', 'PC', 'pyconfig.h', None),
('DLLs/', '$source', '*.pyd', is_debug),
('DLLs/', '$source', '*.dll', is_not_python),
('Lib/', 'Lib', '**/*', include_in_lib),
('libs/', '$source', '*.lib', include_in_libs),
('Tools/', 'Tools', '**/*', include_in_tools),
]

Expand Down

0 comments on commit 2f233f6

Please sign in to comment.