MCPcopy
hub / github.com/pandas-dev/pandas / render_templates

Method render_templates

setup.py:78–96  ·  view source on GitHub ↗
(cls, pxifiles)

Source from the content-addressed store, hash-verified

76class build_ext(_build_ext):
77 @classmethod
78 def render_templates(cls, pxifiles) -> None:
79 for pxifile in pxifiles:
80 # build pxifiles first, template extension must be .pxi.in
81 assert pxifile.endswith(".pxi.in")
82 outfile = pxifile[:-3]
83
84 if (
85 os.path.exists(outfile)
86 and os.stat(pxifile).st_mtime < os.stat(outfile).st_mtime
87 ):
88 # if .pxi.in is not updated, no need to output .pxi
89 continue
90
91 with open(pxifile, encoding="utf-8") as f:
92 tmpl = f.read()
93 pyxcontent = Tempita.sub(tmpl)
94
95 with open(outfile, "w", encoding="utf-8") as f:
96 f.write(pyxcontent)
97
98 def build_extensions(self) -> None:
99 # if building from c files, don't need to

Callers 2

build_extensionsMethod · 0.95
maybe_cythonizeFunction · 0.80

Calls 5

endswithMethod · 0.80
existsMethod · 0.80
readMethod · 0.45
subMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected