Fixes issue with building windows wheels (#1098)

* Try building ABI specific wheels

* Fix typo

* Fix another typo

* Skip cython rebuild

* Try some tweaks

* Revert "Skip cython rebuild"

This reverts commit 3ba6002e9cc1715d9202ec778adc52e6dc7b1732.

* More tweaks

* Fix pathlib install

* Disable 2.7 builds

* Try pure python builds

* Tweak and test pure builds

* Tweak pure builds

* Add universal wheel

* Try universal wheel

* Attempt to fix pyds

* Try re adding platform

* Keep install structure between builds

* Split how we build wheels for windows

* Fix broken sys argv

* Fix setup platform

* Adding some logging for filter

* Fix platform build script

* Ensure ABI tag

* Fix platform abi

* Test platform build of wheels

* fix platform metadata

* Log pyd file generation

* Log dir location for pyd

* recursively include *win*.pyd

* limit to pydevd pyds

* tweak manifest

* remove unused code

* restore manifest changes

* fix proj path

* Remove logging

* Add script for linux wheels (#3)

* Add linux builds

* Simplify building bdist and sdist wheels.

* Try with frame eval off

* Ensure imports

* Add instructions to build linux wheels locally.
This commit is contained in:
Karthik Nadig 2019-01-18 10:26:55 -08:00 committed by GitHub
parent f3289d040d
commit 4877164466
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 140 additions and 35 deletions

View file

@ -9,13 +9,23 @@ import os.path
import subprocess
import sys
from setuptools import setup
pure = None
if '--pure' in sys.argv:
pure = True
sys.argv.remove('--pure')
elif '--universal' in sys.argv:
pure = True
elif '--abi' in sys.argv:
pure = False
sys.argv.remove('--abi')
import versioneer
from setuptools import setup # noqa
import versioneer # noqa
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'src'))
import ptvsd
import ptvsd._vendored
import ptvsd # noqa
import ptvsd._vendored # noqa
del sys.path[0]
@ -23,6 +33,11 @@ PYDEVD_ROOT = ptvsd._vendored.project_root('pydevd')
PTVSD_ROOT = os.path.dirname(os.path.abspath(ptvsd.__file__))
def get_buildplatform():
if '-p' in sys.argv:
return sys.argv[sys.argv.index('-p') + 1]
return None
def cython_build():
print('Compiling extension modules (set SKIP_CYTHON_BUILD=1 to omit)')
subprocess.call([
@ -46,10 +61,29 @@ with open('DESCRIPTION.md', 'r') as fh:
long_description = fh.read()
try:
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
class bdist_wheel(_bdist_wheel):
def finalize_options(self):
_bdist_wheel.finalize_options(self)
self.root_is_pure = pure
except ImportError:
bdist_wheel = None
if __name__ == '__main__':
if not os.getenv('SKIP_CYTHON_BUILD'):
cython_build()
cmds = versioneer.get_cmdclass()
cmds['bdist_wheel'] = bdist_wheel
extras = {}
platforms = get_buildplatform()
if platforms is not None:
extras['platforms'] = platforms
setup(
name='ptvsd',
version=versioneer.get_version(),
@ -82,5 +116,6 @@ if __name__ == '__main__':
'ptvsd': ['ThirdPartyNotices.txt'],
'ptvsd._vendored': list(iter_vendored_files()),
},
cmdclass=versioneer.get_cmdclass(),
cmdclass=cmds,
**extras
)