diff --git a/ptvsd/pydevd/_pydevd_bundle/pydevd_frame.py b/ptvsd/pydevd/_pydevd_bundle/pydevd_frame.py index 0cc4f787..22daa2aa 100644 --- a/ptvsd/pydevd/_pydevd_bundle/pydevd_frame.py +++ b/ptvsd/pydevd/_pydevd_bundle/pydevd_frame.py @@ -36,7 +36,7 @@ TRACE_PROPERTY = 'pydevd_traceproperty.py' get_file_type = DONT_TRACE.get -def handle_breakpoint_condition(py_db, info, breakpoint, new_frame): +def handle_breakpoint_condition(py_db, info, breakpoint, new_frame, default_return_value=None): condition = breakpoint.condition try: return eval(condition, new_frame.f_globals, new_frame.f_locals) diff --git a/setup.py b/setup.py index 28bcae46..1219aa1b 100644 --- a/setup.py +++ b/setup.py @@ -6,14 +6,13 @@ import os import os.path +import subprocess import sys from setuptools import setup, Extension - ROOT = os.path.dirname(os.path.abspath(__file__)) - # Add pydevd files as data files for this package. They are not treated # as a package of their own, because we don't actually want to provide # pydevd - just use our own copy internally. @@ -32,22 +31,13 @@ def get_pydevd_package_data(): files[:] = [f for f in files if f.endswith('.py') and 'pydev' in f] + dirs[:] = [d for d in dirs if d != '__pycache__'] for f in files: yield os.path.join(root[len(ptvsd_prefix) + 1:], f) - -cmdclass = {} - -if sys.version_info[0] == 2: - from setuptools.command.build_ext import build_ext - - class build_optional_ext(build_ext): - def build_extension(self, ext): - try: - super(build_optional_ext, self).build_extension(ext) - except Exception: - pass - cmdclass = {'build_ext': build_optional_ext} +PACKAGE_DATA = { + 'ptvsd': list(get_pydevd_package_data()) + ['ThirdPartyNotices.txt'] +} setup( name='ptvsd', @@ -65,15 +55,5 @@ setup( 'License :: OSI Approved :: MIT License', ], packages=['ptvsd'], - package_data={ - 'ptvsd': list(get_pydevd_package_data()) + [ - 'ThirdPartyNotices.txt', - ], - }, - ext_modules=[ - Extension('ptvsd.pydevd._pydevd_bundle.pydevd_cython', - ['ptvsd/pydevd/_pydevd_bundle/pydevd_cython.c'], - optional=True), - ], - cmdclass=cmdclass, + package_data=PACKAGE_DATA, ) diff --git a/win/build_all.ps1 b/win/build_all.ps1 new file mode 100644 index 00000000..d0601dc5 --- /dev/null +++ b/win/build_all.ps1 @@ -0,0 +1,35 @@ +param($packages, [switch]$pack) + +$root = $script:MyInvocation.MyCommand.Path | Split-Path -parent; +if ($env:BUILD_BINARIESDIRECTORY) { + $bin = mkdir -Force $env:BUILD_BINARIESDIRECTORY\$bin + $obj = mkdir -Force $env:BUILD_BINARIESDIRECTORY\$obj + $dist = mkdir -Force $env:BUILD_BINARIESDIRECTORY\$dist +} else { + $bin = mkdir -Force $root\bin + $obj = mkdir -Force $root\obj + $dist = mkdir -Force $root\dist +} + +if (-not $pack) { + (gci $packages\python* -Directory) | %{ gi $_\tools\python.exe } | ?{ Test-Path $_ } | %{ + Write-Host "Building with $_" + & $_ -m pip install -U D:\repos\pyfindvs setuptools wheel cython + pushd "$root\..\ptvsd\pydevd" + & $_ setup_cython.py enable_msbuildcompiler build_ext -b "$bin" -t "$obj" + popd + } + +} else { + gci $dist\*.whl | Remove-Item -Force + + (gci $packages\python* -Directory) | %{ gi $_\tools\python.exe } | ?{ Test-Path $_ } | select -last 1 | %{ + Write-Host "Building wheel with $_" + & $_ setup.py build -b "$bin" -t "$obj" bdist_wheel -d "$dist" + gci $dist\ptvsd-*.whl | %{ + Copy-Item $_ (Join-Path $_.Directory ($_.Name -replace '(ptvsd-.+?)-any\.whl', '$1-win_amd64.whl')) + Copy-Item $_ (Join-Path $_.Directory ($_.Name -replace '(ptvsd-.+?)-any\.whl', '$1-win32.whl')) + } + } +} + diff --git a/win/packages.config b/win/packages.config new file mode 100644 index 00000000..26ec1a59 --- /dev/null +++ b/win/packages.config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/win/sign.proj b/win/sign.proj new file mode 100644 index 00000000..5428e0b9 --- /dev/null +++ b/win/sign.proj @@ -0,0 +1,63 @@ + + + $(MSBuildThisFileDirectory)\..\ptvsd\ + + + + $(BUILD_BinariesDirectory)\obj\sign\ + $(BUILD_BinariesDirectory)\bin\sign\ + $(BUILD_BinariesDirectory)\bin\ + $(BUILD_BinariesDirectory)\packages + + + $(MSBuildThisFileDirectory)\obj\sign\ + $(MSBuildThisFileDirectory)\bin\sign\ + $(MSBuildThisFileDirectory)\bin\ + $(MSBuildThisFileDirectory) + + $(IntDir) + $(OutDir) + + + + + + + $(MSBuildThisFileDirectory)..\ptvsd\pydevd\_pydevd_bundle\%(Filename)%(Extension) + + + $(MSBuildThisFileDirectory)..\ptvsd\pydevd\_pydevd_frame_eval\%(Filename)%(Extension) + + + %(FullPath) + + + + + + + + + + + 3PartySHA2 + + + + + + + + + <_SignedFile Include="$(OutDir)%(SourceFiles.Filename)%(SourceFiles.Extension)"> + %(SourceFiles.TargetPath) + + + + + + + + + +