FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-rapidjson/setup.py at master · python-rapidjson/python-rapidjson · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python-rapidjson
/
python-rapidjson
Public
Notifications
You must be signed in to change notification settings
Fork
53
Star
532
Code
Issues
18
Pull requests
4
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-rapidjson
/
setup.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
105 lines (88 loc) · 3.74 KB
Breadcrumbs
python-rapidjson
/
setup.py
Copy path
File metadata and controls
105 lines (88 loc) · 3.74 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# -*- coding: utf-8 -*-
# :Project: python-rapidjson -- Packaging
# :Author: Ken Robbins <ken@kenrobbins.com>
# :License: MIT License
# :Copyright: © 2015 Ken Robbins
# :Copyright: © 2016-2026 Lele Gaifax
#
import
os
.
path
import
sys
from
setuptools
import
setup
,
Extension
from
distutils
import
sysconfig
if
sys
.
version_info
<
(
3
,
10
):
raise
NotImplementedError
(
"Only Python 3.10+ is supported."
)
ROOT_PATH
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
rj_include_dir
=
'./rapidjson/include'
for
idx
,
arg
in
enumerate
(
sys
.
argv
[:]):
if
arg
.
startswith
(
'--rj-include-dir='
):
sys
.
argv
.
pop
(
idx
)
rj_include_dir
=
arg
.
split
(
'='
,
1
)[
1
]
break
else
:
if
not
os
.
path
.
isdir
(
os
.
path
.
join
(
ROOT_PATH
,
'rapidjson'
,
'include'
)):
raise
RuntimeError
(
"RapidJSON sources not found: if you cloned the git"
" repository, you should initialize the rapidjson submodule"
" as explained in the README.rst; in all other cases you may"
" want to report the issue."
)
# Automatically updated by bump-my-version at release time
VERSION
=
'1.23'
with
open
(
'README.rst'
,
encoding
=
'utf-8'
)
as
f
:
LONG_DESCRIPTION
=
f
.
read
()
with
open
(
'CHANGES.rst'
,
encoding
=
'utf-8'
)
as
f
:
CHANGES
=
f
.
read
()
extension_options
=
{
'sources'
: [
'./rapidjson.cpp'
],
'include_dirs'
: [
rj_include_dir
],
'define_macros'
: [(
'PYTHON_RAPIDJSON_VERSION'
,
VERSION
)],
'depends'
: [
'./rapidjson_exact_version.txt'
],
}
if
os
.
path
.
exists
(
'rapidjson_exact_version.txt'
):
with
open
(
'rapidjson_exact_version.txt'
,
encoding
=
'utf-8'
)
as
f
:
extension_options
[
'define_macros'
].
append
(
(
'RAPIDJSON_EXACT_VERSION'
,
f
.
read
().
strip
()))
cxx
=
sysconfig
.
get_config_var
(
'CXX'
)
if
cxx
and
'g++'
in
cxx
:
# Avoid warning about invalid flag for C++
for
varname
in
(
'CFLAGS'
,
'OPT'
):
value
=
sysconfig
.
get_config_var
(
varname
)
if
value
and
'-Wstrict-prototypes'
in
value
:
value
=
value
.
replace
(
'-Wstrict-prototypes'
,
''
)
sysconfig
.
get_config_vars
()[
varname
]
=
value
# Add -pedantic, so we get a warning when using non-standard features, and
# -Wno-long-long to pacify old gcc (or Apple's hybrids) that treat "long long" as an
# error under C++ (see issue #69). C++11 is required since commit
# https://github.com/Tencent/rapidjson/commit/9965ab37f6cfae3d58a0a6e34c76112866ace0b1
extension_options
[
'extra_compile_args'
]
=
[
'-pedantic'
,
'-Wno-long-long'
,
'-std=c++11'
]
setup
(
name
=
'python-rapidjson'
,
version
=
VERSION
,
description
=
'Python wrapper around rapidjson'
,
long_description
=
LONG_DESCRIPTION
+
'
\n
\n
'
+
CHANGES
,
long_description_content_type
=
'text/x-rst'
,
license
=
'MIT License'
,
keywords
=
'json jsonc rapidjson'
,
author
=
'Ken Robbins'
,
author_email
=
'ken@kenrobbins.com'
,
maintainer
=
'Lele Gaifax'
,
maintainer_email
=
'lele@metapensiero.it'
,
url
=
'https://github.com/python-rapidjson/python-rapidjson'
,
classifiers
=
[
'Development Status :: 5 - Production/Stable'
,
'Intended Audience :: Developers'
,
'Programming Language :: C++'
,
'Programming Language :: Python :: 3 :: Only'
,
'Programming Language :: Python :: 3'
,
'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'
,
'Programming Language :: Python'
,
],
ext_modules
=
[
Extension
(
'rapidjson'
,
**
extension_options
)],
package_dir
=
{
"rapidjson-stubs"
:
"typings/rapidjson"
},
packages
=
[
"rapidjson-stubs"
],
package_data
=
{
"rapidjson-stubs"
: [
"*.pyi"
]},
include_package_data
=
True
,
)
Back
|
FazBrowse Home
|
New Git URL