File tree Expand file tree Collapse file tree 2 files changed +5
-23
lines changed Expand file tree Collapse file tree 2 files changed +5
-23
lines changed Original file line number Diff line number Diff line change 1- import platform
2- import sys
31from setuptools import setup , find_packages
4- from setuptools .command .build_ext import build_ext
52from codecs import open
63from os import path
74
118 long_description = f .read ()
129
1310
14- class custom_build_ext (build_ext ):
15- """Custom build_ext command that uses mingw32 when building on Python2.7
16- in Windows."""
17-
18- def finalize_options (self ):
19- build_ext .finalize_options (self )
20- is_windows = platform .system () == 'Windows'
21- is_py2 = sys .version_info [0 ] < 3
22- if self .compiler is None and is_windows and is_py2 :
23- self .compiler = 'mingw32'
24-
25-
2611setup (
2712 name = 'cmarkgfm' ,
2813 version = '2024.11.20' ,
@@ -58,7 +43,4 @@ def finalize_options(self):
5843 },
5944 zip_safe = False ,
6045 include_package_data = True ,
61- cmdclass = {
62- 'build_ext' : custom_build_ext ,
63- },
6446)
Original file line number Diff line number Diff line change 33import glob
44import io
55import os
6- import sys
76
87import cffi
98
@@ -58,10 +57,11 @@ def _compiler_type():
5857
5958
6059COMPILER_TYPE = _compiler_type ()
61- PY2 = sys .version_info [0 ] < 3
62- # Note: on Python 2.7 in Windows we're using mingw so we use the unix
63- # srcs for that as well.
64- if COMPILER_TYPE in {'unix' , 'mingw32' } or PY2 :
60+ # Note: on Windows with MSVC the compiler type is 'msvc'. On macOS and
61+ # Linux it is 'unix'. For MinGW on Windows distutils reports 'mingw32'.
62+ # Select the appropriate compile args and generated sources directory
63+ # based solely on the compiler type.
64+ if COMPILER_TYPE in {'unix' , 'mingw32' }:
6565 EXTRA_COMPILE_ARGS = ['-std=c99' ]
6666 GENERATED_SRC_DIR = UNIX_GENERATED_SRC_DIR
6767elif COMPILER_TYPE == 'msvc' :
You can’t perform that action at this time.
0 commit comments