|
1 | 1 | import sys
|
| 2 | +import subprocess |
2 | 3 |
|
3 | 4 | from pathlib import Path
|
4 | 5 | from fnmatch import fnmatch
|
5 |
| -from subprocess import check_output, STDOUT |
6 | 6 |
|
7 | 7 | from doit.tools import PythonInteractiveAction
|
8 | 8 |
|
|
23 | 23 | }
|
24 | 24 |
|
25 | 25 |
|
26 |
| -def git(*args): |
27 |
| - return check_output( |
28 |
| - ["git", *args], stderr=STDOUT, timeout=3, universal_newlines=True, |
| 26 | +def git(*args, **kwargs): |
| 27 | + return subprocess.check_output( |
| 28 | + ["git", *args], stderr=subprocess.STDOUT, universal_newlines=True, |
29 | 29 | ).rstrip("\n")
|
30 | 30 |
|
31 | 31 |
|
@@ -77,10 +77,16 @@ def task_build():
|
77 | 77 |
|
78 | 78 |
|
79 | 79 | def task_publish_to_pypi():
|
| 80 | + |
80 | 81 | return {
|
81 | 82 | "task_dep": ["build"],
|
82 |
| - "file_dep": [DIST_DIR / f"zerobin-{ZEROBIN_VERSION}-py3-none-any.whl"], |
83 |
| - "actions": ["twine upload ./dist/*.whl"], |
| 83 | + "actions": ["echo twine upload ./dist/*.whl"], |
| 84 | + } |
| 85 | + |
| 86 | + |
| 87 | +def task_build_pyz(): |
| 88 | + return { |
| 89 | + "actions": ["shiv zerobin -o dist/zerobin.pyz -c zerobin"], |
84 | 90 | }
|
85 | 91 |
|
86 | 92 |
|
@@ -122,7 +128,10 @@ def bump():
|
122 | 128 | print("- Updating VERSION file")
|
123 | 129 | (SOURCE_DIR / "VERSION").write_text(new_version)
|
124 | 130 | print("- Commiting VERSION file")
|
125 |
| - git("commit", "-m", f"Bumping to version {new_version}") |
| 131 | + git("add", "zerobin/VERSION") |
| 132 | + git( |
| 133 | + "commit", "-m", f"Bumping to version {new_version}", |
| 134 | + ) |
126 | 135 | print(f"- Adding v{new_version} tag")
|
127 | 136 | git("tag", f"v{new_version}")
|
128 | 137 | print("- Pushing tag")
|
|
0 commit comments