Merge branch 'python' of https://github.com/KmolYuan/solvespace into python

pull/493/head
KmolYuan 2019-10-27 20:58:35 +08:00
commit d7af07e6ad
3 changed files with 10 additions and 12 deletions

View File

@ -59,7 +59,7 @@ matrix:
python: "3.7" python: "3.7"
- <<: *linux - <<: *linux
python: "3.8-dev" python: "3.8"
- &osx - &osx
os: osx os: osx
@ -90,7 +90,7 @@ matrix:
env: PYTHON=3.7.0 env: PYTHON=3.7.0
- <<: *osx - <<: *osx
env: PYTHON=3.8-dev env: PYTHON=3.8.0
before_cache: before_cache:
- rm -rf $HOME/.cache/pip/log - rm -rf $HOME/.cache/pip/log

View File

@ -11,13 +11,13 @@ environment:
PYTHON_DIR: C:\Python37-x64 PYTHON_DIR: C:\Python37-x64
COMPILER: mingw32 COMPILER: mingw32
# Cython not yet support # Cython not yet support
# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# PYTHON_DEV: 3.8.0
# PYTHON_DIR: C:\Python38
# COMPILER: mingw32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_DEV: 3.8.0 PYTHON_DEV: 3.8.0
PYTHON_DIR: C:\Python38-x64 PYTHON_DIR: C:\Python38
COMPILER: mingw32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_DEV: 3.8.0
PYTHON_DIR: C:\Python38-x64
COMPILER: msvc COMPILER: msvc
for: for:
- matrix: - matrix:

View File

@ -17,13 +17,10 @@ from setuptools.command.build_ext import build_ext
from setuptools.command.sdist import sdist from setuptools.command.sdist import sdist
from distutils import file_util, dir_util from distutils import file_util, dir_util
from platform import system from platform import system
from distutils import sysconfig
include_path = pth_join('python_solvespace', 'include') include_path = pth_join('python_solvespace', 'include')
src_path = pth_join('python_solvespace', 'src') src_path = pth_join('python_solvespace', 'src')
platform_path = pth_join(src_path, 'platform') platform_path = pth_join(src_path, 'platform')
ver = sysconfig.get_config_var('VERSION')
lib = sysconfig.get_config_var('BINDIR')
def write(doc, *parts): def write(doc, *parts):
@ -44,7 +41,6 @@ def find_version(*file_paths):
macros = [ macros = [
('_hypot', 'hypot'),
('M_PI', 'PI'), ('M_PI', 'PI'),
('_USE_MATH_DEFINES', None), ('_USE_MATH_DEFINES', None),
('ISOLATION_AWARE_ENABLED', None), ('ISOLATION_AWARE_ENABLED', None),
@ -82,6 +78,8 @@ elif system() == 'Windows':
# Platform sources # Platform sources
sources.append(pth_join(platform_path, 'utilwin.cpp')) sources.append(pth_join(platform_path, 'utilwin.cpp'))
sources.append(pth_join(platform_path, 'platform.cpp')) sources.append(pth_join(platform_path, 'platform.cpp'))
if sys.version_info < (3, 7):
macros.append(('_hypot', 'hypot'))
else: else:
sources.append(pth_join(platform_path, 'utilunix.cpp')) sources.append(pth_join(platform_path, 'utilunix.cpp'))
@ -112,7 +110,7 @@ class Build(build_ext):
e.extra_compile_args = compile_args e.extra_compile_args = compile_args
elif compiler == 'msvc': elif compiler == 'msvc':
for e in self.extensions: for e in self.extensions:
e.define_macros = macros[2:] e.define_macros = macros[1:]
e.libraries = ['shell32'] e.libraries = ['shell32']
super(Build, self).build_extensions() super(Build, self).build_extensions()