def build() -> None: # if running in RTD, skip compilation if os.environ.get("READTHEDOCS") == "True": return # compile FLI library os.system("cd lib && make && cd ..") extensions = [ Extension( "pyobs_fli.flidriver", ["pyobs_fli/flidriver.pyx"], library_dirs=["lib/"], libraries=["fli", "cfitsio"], include_dirs=[numpy.get_include()], extra_compile_args=["-fPIC"], ) ] ext_modules = cythonize(extensions) distribution = Distribution( { "name": "extended", "ext_modules": ext_modules, "cmdclass": { "build_ext": cython_build_ext, }, } ) distribution.run_command("build_ext") build_ext_cmd = distribution.get_command_obj("build_ext") build_ext_cmd.copy_extensions_to_source()
def run_command(self, command): '''Builds the documentation if needed, then passes control to the superclass' run_command(...) method. ''' if command == 'install_data' and docutils: print 'creating doc/index.html' docutils.core.publish_file(writer_name='html', source=open('doc/index.rst'), source_path='doc', destination=open('doc/index.html', 'w'), destination_path='doc', settings_overrides={'stylesheet_path': 'doc/documentation.css'} ) Distribution.run_command(self, command)
def run_command(self, command): '''Builds the documentation if needed, then passes control to the superclass' run_command(...) method. ''' if command == 'install_data' and docutils: print 'creating doc/index.html' docutils.core.publish_file(writer_name='html', source=open('doc/index.rst'), source_path='doc', destination=open('doc/index.html', 'w'), destination_path='doc', settings_overrides={ 'stylesheet_path': 'doc/documentation.css' }) Distribution.run_command(self, command)
def build() -> None: # if running in RTD, skip compilation if os.environ.get("READTHEDOCS") == "True": return extensions = [ Extension( "pyobs_sbig.sbigudrv", [ "pyobs_sbig/sbigudrv.pyx", "src/csbigcam.cpp", "src/csbigimg.cpp" ], libraries=["sbigudrv", "cfitsio"], include_dirs=[numpy.get_include(), "/usr/include/cfitsio"], extra_compile_args=["-fPIC"], ) ] ext_modules = cythonize( extensions, compiler_directives={ "binding": True, "language_level": "3" }, ) distribution = Distribution({ "name": "extended", "ext_modules": ext_modules, "cmdclass": { "build_ext": cython_build_ext, }, }) # distribution.package_dir = "extended" distribution.run_command("build_ext") build_ext_cmd = distribution.get_command_obj("build_ext") build_ext_cmd.copy_extensions_to_source()
def run_command(self, command): self._last_run_command = command Distribution.run_command(self, command)