include_path=include_path)
else:
sys.exit(1)
+cython_build_dir=os.environ.get("CYTHON_BUILD_DIR", None)
cmdclass = {}
try:
source = "cephfs.c"
else:
# Process Tempita template
- source_pyx = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "cephfs.pyx"
- )
+ source_dir = os.path.dirname(os.path.abspath(__file__))
+ source_pyx = os.path.join(source_dir, "cephfs.pyx")
+ build_dir = cython_build_dir or source_dir
+ output_pyx = os.path.join(build_dir, "cephfs_processed.pyx")
- # Read the template from source
with open(source_pyx) as f:
template_content = f.read()
-
- # Process the template with cython_constants
processed = Tempita.sub(template_content, **cython_constants)
-
- # Write processed output to current working directory
- # (which is the build directory when invoked by CMake)
- output_pyx = "cephfs_processed.pyx"
-
with open(output_pyx, 'w') as f:
f.write(processed)
- source = output_pyx
+ source = os.path.relpath(output_pyx, os.getcwd())
# Disable cythonification if we're not really building anything
if (len(sys.argv) >= 2 and
**ext_args
)
],
- build_dir=os.environ.get("CYTHON_BUILD_DIR", None),
+ build_dir=cython_build_dir,
**cythonize_args
),
classifiers=[
cython_constants = dict(BUILD_DOC=False, UNAME_SYSNAME=platform.system())
else:
sys.exit(1)
+cython_build_dir=os.environ.get("CYTHON_BUILD_DIR", None)
cmdclass = {}
try:
source = "rados.c"
else:
# Process Tempita template
- source_pyx = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "rados.pyx"
- )
+ source_dir = os.path.dirname(os.path.abspath(__file__))
+ source_pyx = os.path.join(source_dir, "rados.pyx")
+ build_dir = cython_build_dir or source_dir
+ output_pyx = os.path.join(build_dir, "rados_processed.pyx")
- # Read the template from source
with open(source_pyx) as f:
template_content = f.read()
-
- # Process the template with cython_constants
processed = Tempita.sub(template_content, **cython_constants)
-
- # Write processed output to current working directory
- # (which is the build directory when invoked by CMake)
- output_pyx = "rados_processed.pyx"
-
with open(output_pyx, 'w') as f:
f.write(processed)
- source = output_pyx
+ source = os.path.relpath(output_pyx, os.getcwd())
# Disable cythonification if we're not really building anything
if (len(sys.argv) >= 2 and
)
],
compile_time_env=cython_constants,
- build_dir=os.environ.get("CYTHON_BUILD_DIR", None),
+ build_dir=cython_build_dir,
),
classifiers=[
'Intended Audience :: Developers',
include_path=include_path)
else:
sys.exit(1)
+cython_build_dir=os.environ.get("CYTHON_BUILD_DIR", None)
cmdclass = {}
compiler_directives = {}
source = "rbd.c"
else:
# Process Tempita template
- source_pyx = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "rbd.pyx"
- )
+ source_dir = os.path.dirname(os.path.abspath(__file__))
+ source_pyx = os.path.join(source_dir, "rbd.pyx")
+ build_dir = cython_build_dir or source_dir
+ output_pyx = os.path.join(build_dir, "rbd_processed.pyx")
- # Read the template from source
with open(source_pyx) as f:
template_content = f.read()
-
- # Process the template with cython_constants
processed = Tempita.sub(template_content, **cython_constants)
-
- # Write processed output to current working directory
- # (which is the build directory when invoked by CMake)
- source = "rbd_processed.pyx"
-
- with open(source, 'w') as f:
+ with open(output_pyx, 'w') as f:
f.write(processed)
+ source = os.path.relpath(output_pyx, os.getcwd())
+
# Disable cythonification if we're not really building anything
if (len(sys.argv) >= 2 and
any(i in sys.argv[1:] for i in ('--help', 'clean', 'egg_info', '--version')
)
],
compiler_directives=compiler_directives,
- build_dir=os.environ.get("CYTHON_BUILD_DIR", None),
+ build_dir=cython_build_dir,
**cythonize_args
),
classifiers=[
include_path=include_path)
else:
sys.exit(1)
+cython_build_dir=os.environ.get("CYTHON_BUILD_DIR", None)
cmdclass = {}
try:
source = "rgw.c"
else:
# Process Tempita template
- source_pyx = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "rgw.pyx"
- )
+ source_dir = os.path.dirname(os.path.abspath(__file__))
+ source_pyx = os.path.join(source_dir, "rgw.pyx")
+ build_dir = cython_build_dir or source_dir
+ output_pyx = os.path.join(build_dir, "rgw_processed.pyx")
- # Read the template from source
with open(source_pyx) as f:
template_content = f.read()
-
- # Process the template with cython_constants
processed = Tempita.sub(template_content, **cython_constants)
-
- # Write processed output to current working directory
- # (which is the build directory when invoked by CMake)
- output_pyx = "rgw_processed.pyx"
-
with open(output_pyx, 'w') as f:
f.write(processed)
- source = output_pyx
+ source = os.path.relpath(output_pyx, os.getcwd())
# Disable cythonification if we're not really building anything
if (len(sys.argv) >= 2 and
**ext_args
)
],
- build_dir=os.environ.get("CYTHON_BUILD_DIR", None),
+ build_dir=cython_build_dir,
**cythonize_args
),
classifiers=[