Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
3317ad4a
Commit
3317ad4a
authored
Apr 10, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a debug helper test that prints information about the current C build environment.
parent
da191732
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
tests/compile/buildenv.pyx
tests/compile/buildenv.pyx
+75
-0
No files found.
tests/compile/buildenv.pyx
0 → 100644
View file @
3317ad4a
"""
Non-test that prints debug information about the current build environment.
"""
from
__future__
import
print_function
import
sys
cdef
extern
from
*
:
# Python runtime
cdef
long
PY_VERSION_HEX
# Cython config
cdef
int
CYTHON_COMPILING_IN_CPYTHON
cdef
int
CYTHON_COMPILING_IN_PYPY
cdef
int
CYTHON_COMPILING_IN_PYSTON
cdef
int
CYTHON_USE_PYLONG_INTERNALS
cdef
int
CYTHON_USE_PYLIST_INTERNALS
cdef
int
CYTHON_USE_UNICODE_INTERNALS
cdef
int
CYTHON_USE_UNICODE_WRITER
cdef
int
CYTHON_AVOID_BORROWED_REFS
cdef
int
CYTHON_ASSUME_SAFE_MACROS
cdef
int
CYTHON_UNPACK_METHODS
cdef
int
CYTHON_FAST_THREAD_STATE
cdef
int
CYTHON_FAST_PYCALL
cdef
int
CYTHON_PEP489_MULTI_PHASE_INIT
cdef
int
CYTHON_USE_TP_FINALIZE
# C and platform specifics
cdef
int
SIZEOF_INT
cdef
int
SIZEOF_LONG
cdef
int
SIZEOF_SIZE_T
cdef
int
SIZEOF_LONG_LONG
cdef
int
SIZEOF_VOID_P
# PyLong internals
cdef
long
PyLong_BASE
cdef
long
PyLong_MASK
cdef
int
PyLong_SHIFT
cdef
int
digit
cdef
int
sdigit
print
(
f"""Python build environment:
Python
{
sys
.
version_info
}
PY_VERSION_HEX 0x
{
PY_VERSION_HEX
:
X
}
CYTHON_COMPILING_IN_CPYTHON
{
CYTHON_COMPILING_IN_CPYTHON
}
CYTHON_COMPILING_IN_PYPY
{
CYTHON_COMPILING_IN_PYPY
}
CYTHON_COMPILING_IN_PYSTON
{
CYTHON_COMPILING_IN_PYSTON
}
CYTHON_USE_PYLONG_INTERNALS
{
CYTHON_USE_PYLONG_INTERNALS
}
CYTHON_USE_PYLIST_INTERNALS
{
CYTHON_USE_PYLIST_INTERNALS
}
CYTHON_USE_UNICODE_INTERNALS
{
CYTHON_USE_UNICODE_INTERNALS
}
CYTHON_USE_UNICODE_WRITER
{
CYTHON_USE_UNICODE_WRITER
}
CYTHON_AVOID_BORROWED_REFS
{
CYTHON_AVOID_BORROWED_REFS
}
CYTHON_ASSUME_SAFE_MACROS
{
CYTHON_ASSUME_SAFE_MACROS
}
CYTHON_UNPACK_METHODS
{
CYTHON_UNPACK_METHODS
}
CYTHON_FAST_THREAD_STATE
{
CYTHON_FAST_THREAD_STATE
}
CYTHON_FAST_PYCALL
{
CYTHON_FAST_PYCALL
}
CYTHON_PEP489_MULTI_PHASE_INIT
{
CYTHON_PEP489_MULTI_PHASE_INIT
}
CYTHON_USE_TP_FINALIZE
{
CYTHON_USE_TP_FINALIZE
}
PyLong_BASE 0x
{
PyLong_BASE
:
X
}
PyLong_MASK
{
PyLong_MASK
:
X
}
PyLong_SHIFT
{
PyLong_SHIFT
}
sizeof(digit)
{
sizeof
(
digit
)
}
sizeof(sdigit)
{
sizeof
(
sdigit
)
}
SIZEOF_INT
{
SIZEOF_INT
}
(
{
sizeof
(
int
)
}
)
SIZEOF_LONG
{
SIZEOF_LONG
}
(
{
sizeof
(
long
)
}
)
SIZEOF_SIZE_T
{
SIZEOF_SIZE_T
}
(
{
sizeof
(
Py_ssize_t
)
}
,
{
getattr
(
sys
,
'maxsize'
,
getattr
(
sys
,
'maxint'
,
None
))
}
)
SIZEOF_LONG_LONG
{
SIZEOF_LONG_LONG
}
(
{
sizeof
(
long
long
)
}
)
SIZEOF_VOID_P
{
SIZEOF_VOID_P
}
(
{
sizeof
(
void
*
)
}
)
"""
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment