-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
79 lines (72 loc) · 2.72 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/env python
# -*- coding: utf-8 -*-
import shutil
import subprocess
from glob import glob
from pathlib import Path
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext as _build_ext
from wheel.bdist_wheel import bdist_wheel
class bdist_wheel_abi3(bdist_wheel):
def get_tag(self):
python, abi, plat = super().get_tag()
if python.startswith("cp"):
return "cp38", "abi3", plat
return python, abi, plat
class build_ext(_build_ext):
def run(self):
cmark_build = Path(__file__).parent / "third_party" / "cmark" / "build"
if cmark_build.exists():
shutil.rmtree(cmark_build)
cmark_build.mkdir(exist_ok=True)
subprocess.check_call(["cmake", ".."], cwd=cmark_build)
return super().run()
setup(
name="umarkdown",
author="Kumar Aditya",
author_email="",
url="https://umarkdown.netlify.app/",
description="Python wrapper of Markdown using CMark.",
keywords=["Markdown", "CMark"],
long_description=Path("README.md").read_text(encoding="utf-8"),
long_description_content_type="text/markdown",
license="BSD License",
packages=["umarkdown"],
include_package_data=True,
zip_safe=False,
entry_points={"console_scripts": ["umarkdown=umarkdown.cli:main"]},
ext_modules=[
Extension(
"umarkdown._internal",
sources=["./umarkdown/_internal.c", *glob("./third_party/cmark/src/*.c")],
include_dirs=["./third_party/cmark/src/", "./third_party/cmark/build/src/"],
define_macros=[("Py_LIMITED_API", "0x03060000")],
py_limited_api=True,
)
],
cmdclass={"build_ext": build_ext, "bdist_wheel": bdist_wheel_abi3},
classifiers=[
"Programming Language :: C",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: OS Independent",
"Topic :: Internet :: WWW/HTTP :: Site Management",
"Topic :: Software Development :: Documentation",
"Topic :: Text Processing :: Filters",
"Topic :: Text Processing :: Markup :: HTML",
"Topic :: Text Processing :: Markup :: Markdown",
"License :: OSI Approved :: BSD License",
],
use_scm_version=True,
python_requires=">=3.9",
extras_require={
"cli": ["click==8.1.7"],
},
)