-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdodo.py
67 lines (55 loc) · 2.22 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from doit.tools import PythonInteractiveAction
def task_build():
return {
'targets': ['build', 'dist', 'lspace.egg-info', '.pytest_cache', 'htmlcov'],
'actions': ['rm -fr %(targets)s', 'python3 -m build'],
'clean': ['rm -fr %(targets)s'],
'verbosity': 2
}
def task_bump_dryrun():
return {'actions': ['bump2version --verbose --dry-run --allow-dirty %(part)s'],
'params': [{'name': 'part',
'long': 'part',
'type': str,
'choices': (('patch', ''), ('minor', ''), ('major', '')),
'default': False,
'help': 'Choose between patch, minor, major'}],
'verbosity': 2, }
def task_bump():
return {'actions': ['bump2version --verbose %(part)s'],
'params': [{'name': 'part',
'long': 'part',
'type': str,
'choices': (('patch', ''), ('minor', ''), ('major', '')),
'default': False,
'help': 'Choose between patch, minor, major'}],
'verbosity': 2, }
def task_release_pypi():
def confirm():
res = input('running release on NON-test pypy!\n'
'remember to install from a build to test if everytihng is included!\n'
'is the version bumped and everything commited and pushed?\n'
'everything tested?\n'
'[yesanditsnotatest/OHMYGODNO] ')
if res != 'yesanditsnotatest':
raise Exception
return {
'task_dep': ['build'],
'actions': [
(PythonInteractiveAction(confirm)),
'twine upload --verbose --disable-progress-bar --repository pypi dist/*'],
'verbosity': 2
}
def task_release_test_pypi():
def confirm():
res = input('running release on test pypy!\n'
'[yes/NO] ')
if res != 'yes':
raise Exception
return {
'task_dep': ['build'],
'actions': [
(PythonInteractiveAction(confirm)),
'twine upload --verbose --disable-progress-bar --repository testpypi dist/*'],
'verbosity': 2,
}