forked from vaexio/vaex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dodo.py
40 lines (32 loc) · 1016 Bytes
/
dodo.py
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
37
38
39
40
# this uses https://pydoit.org/ to run tasks/chores
# pip install doit
# $ doit
import pkg_resources
import vaex.meta._version
import re
import shutil
def task_mybinder():
"""Make the mybinder files up to date"""
def action(targets):
filename = targets[0]
with open(filename) as f:
content = f.read()
version = vaex.meta._version.__version__
content = re.sub('vaex==(.*)', f'vaex=={version}', content)
with open(filename, "w") as f:
f.write(content)
print(f"{filename} updated")
return {
'actions': [action],
'targets': ["binder/requirements.txt"],
'file_dep': ['packages/vaex-meta/vaex/meta/_version.py']
}
def task_sync_readme():
"""Make the README for veax-meta up to date"""
def action(targets):
shutil.copy('README.md', targets[0])
return {
'actions': [action],
'targets': ["packages/vaex-meta/README.md"],
'file_dep': ['README.md']
}