forked from msgspec/msgspec
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
122 lines (109 loc) · 3.79 KB
/
Copy pathsetup.py
File metadata and controls
122 lines (109 loc) · 3.79 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import sys
import os
from setuptools import setup
from setuptools.extension import Extension
import versioneer
# Check for 32-bit windows builds, which currently aren't supported. We can't
# rely on `platform.architecture` here since users can still run 32-bit python
# builds on 64 bit architectures.
if sys.platform == "win32" and sys.maxsize == (2**31 - 1):
import textwrap
error = """
====================================================================
`msgspec` currently doesn't support 32-bit Python windows builds. If
this is important for your use case, please comment on this issue:
https://github.com/jcrist/msgspec/issues/845
====================================================================
"""
print(textwrap.dedent(error))
exit(1)
SANITIZE = os.environ.get("MSGSPEC_SANITIZE", False)
COVERAGE = os.environ.get("MSGSPEC_COVERAGE", False)
DEBUG = os.environ.get("MSGSPEC_DEBUG", SANITIZE or COVERAGE)
extra_compile_args = []
extra_link_args = []
if SANITIZE:
extra_compile_args.extend(["-fsanitize=address", "-fsanitize=undefined"])
extra_link_args.extend(["-lasan", "-lubsan"])
if COVERAGE:
extra_compile_args.append("--coverage")
extra_link_args.append("-lgcov")
if DEBUG:
extra_compile_args.extend(["-O0", "-g", "-UNDEBUG"])
# from https://py-free-threading.github.io/faq/#im-trying-to-build-a-library-on-windows-but-msvc-says-c-atomic-support-is-not-enabled
if sys.platform == "win32":
extra_compile_args.extend(
[
"/std:c11",
"/experimental:c11atomics",
]
)
ext_modules = [
Extension(
"msgspec._core",
[os.path.join("msgspec", "_core.c")],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
)
]
yaml_deps = ["pyyaml"]
toml_deps = ['tomli ; python_version < "3.11"', "tomli_w"]
doc_deps = ["sphinx", "furo", "sphinx-copybutton", "sphinx-design", "ipython"]
test_deps = [
"pytest",
"msgpack",
"attrs",
'eval-type-backport ; python_version < "3.10"',
*yaml_deps,
*toml_deps,
]
dev_deps = ["pre-commit", "coverage", "mypy", "pyright", *doc_deps, *test_deps]
extras_require = {
"yaml": yaml_deps,
"toml": toml_deps,
"doc": doc_deps,
"test": test_deps,
"dev": dev_deps,
}
setup(
name="msgspec_m",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
maintainer="marimo team",
maintainer_email="contact@marimo.io",
url="https://github.com/marimo-team/msgspec",
project_urls={
"Documentation": "https://jcristharif.com/msgspec/",
"Source": "https://github.com/marimo-team/msgspec",
"Issue Tracker": "https://github.com/marimo-team/msgspec/issues",
"Original Source": "https://github.com/jcrist/msgspec",
},
description=(
"A fast serialization and validation library, with builtin support for "
"JSON, MessagePack, YAML, and TOML."
),
keywords="JSON msgpack MessagePack TOML YAML serialization validation schema",
classifiers=[
"License :: OSI Approved :: BSD License",
"Development Status :: 4 - Beta",
"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.14",
],
extras_require=extras_require,
license="BSD",
packages=["msgspec"],
package_data={"msgspec": ["py.typed", "*.pyi"]},
ext_modules=ext_modules,
long_description=(
open("README.md", encoding="utf-8").read()
if os.path.exists("README.md")
else ""
),
long_description_content_type="text/markdown",
python_requires=">=3.9",
zip_safe=False,
)