Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import platform
import sys
from setuptools import setup, find_packages
from setuptools.command.build_ext import build_ext
from codecs import open
from os import path

Expand All @@ -11,18 +8,6 @@
long_description = f.read()


class custom_build_ext(build_ext):
"""Custom build_ext command that uses mingw32 when building on Python2.7
in Windows."""

def finalize_options(self):
build_ext.finalize_options(self)
is_windows = platform.system() == 'Windows'
is_py2 = sys.version_info[0] < 3
if self.compiler is None and is_windows and is_py2:
self.compiler = 'mingw32'


setup(
name='cmarkgfm',
version='2024.11.20',
Expand Down Expand Up @@ -58,7 +43,4 @@ def finalize_options(self):
},
zip_safe=False,
include_package_data=True,
cmdclass={
'build_ext': custom_build_ext,
},
)
10 changes: 5 additions & 5 deletions src/cmarkgfm/build_cmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import glob
import io
import os
import sys

import cffi

Expand Down Expand Up @@ -58,10 +57,11 @@ def _compiler_type():


COMPILER_TYPE = _compiler_type()
PY2 = sys.version_info[0] < 3
# Note: on Python 2.7 in Windows we're using mingw so we use the unix
# srcs for that as well.
if COMPILER_TYPE in {'unix', 'mingw32'} or PY2:
# Note: on Windows with MSVC the compiler type is 'msvc'. On macOS and
# Linux it is 'unix'. For MinGW on Windows distutils reports 'mingw32'.
# Select the appropriate compile args and generated sources directory
# based solely on the compiler type.
if COMPILER_TYPE in {'unix', 'mingw32'}:
EXTRA_COMPILE_ARGS = ['-std=c99']
GENERATED_SRC_DIR = UNIX_GENERATED_SRC_DIR
elif COMPILER_TYPE == 'msvc':
Expand Down