-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsetup.py
More file actions
36 lines (27 loc) · 1016 Bytes
/
setup.py
File metadata and controls
36 lines (27 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from setuptools import setup
import os.path as op
import glob
from setuptools.command.build_py import build_py
class build_py_with_references(build_py):
def run(self):
references_src = op.join("docs", "source", "references.bib")
references_dst = op.join("AFQ", "_references.bib")
with open(references_src) as f:
references = f.read()
references = """
#######################################################################
## AUTOGENERATED FILE. DO NOT EDIT. ##
## This file is generated from docs/source/references.bib ##
#######################################################################
""" + references
with open(references_dst, "w") as f:
f.write(references)
super().run()
opts = dict(
scripts=[op.join('bin', op.split(f)[-1]) for f in glob.glob('bin/*')],
cmdclass={"build_py": build_py_with_references},
package_data={
"AFQ": ["_references.bib"],
})
if __name__ == '__main__':
setup(**opts)