Skip to content

Commit db50bd8

Browse files
committed
BLD: Avoid unnecessary recompilation
Only run templates if underlying files have changed
1 parent d1ea86d commit db50bd8

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

.coveragerc

Whitespace-only changes.

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ def cythonize(e, *args, **kwargs):
215215
files = glob.glob('./randomstate/*.in')
216216
for templated_file in files:
217217
output_file_name = os.path.splitext(templated_file)[0]
218+
if (os.path.exists(output_file_name) and
219+
(os.path.getmtime(templated_file) < os.path.getmtime(output_file_name))):
220+
continue
218221
with open(templated_file, 'r') as source_file:
219222
template = tempita.Template(source_file.read())
220223
with open(output_file_name, 'w') as output_file:

0 commit comments

Comments
 (0)