PyProd 0.9.0__py3-none-any.whl → 0.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyprod/__init__.py +1 -1
- pyprod/main.py +50 -1
- pyprod/prod.py +2 -1
- {pyprod-0.9.0.dist-info → pyprod-0.10.0.dist-info}/METADATA +2 -1
- pyprod-0.10.0.dist-info/RECORD +11 -0
- pyprod-0.9.0.dist-info/RECORD +0 -11
- {pyprod-0.9.0.dist-info → pyprod-0.10.0.dist-info}/WHEEL +0 -0
- {pyprod-0.9.0.dist-info → pyprod-0.10.0.dist-info}/entry_points.txt +0 -0
- {pyprod-0.9.0.dist-info → pyprod-0.10.0.dist-info}/licenses/LICENSE +0 -0
pyprod/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.
|
1
|
+
__version__ = "0.10.0"
|
pyprod/main.py
CHANGED
@@ -3,8 +3,13 @@ import asyncio
|
|
3
3
|
import logging
|
4
4
|
import os
|
5
5
|
import sys
|
6
|
+
import threading
|
7
|
+
import time
|
6
8
|
from pathlib import Path
|
7
9
|
|
10
|
+
from watchdog.events import FileSystemEventHandler
|
11
|
+
from watchdog.observers import Observer
|
12
|
+
|
8
13
|
import pyprod
|
9
14
|
import pyprod.prod
|
10
15
|
|
@@ -45,6 +50,13 @@ parser.add_argument(
|
|
45
50
|
help="Get file timestamps from Git",
|
46
51
|
)
|
47
52
|
|
53
|
+
parser.add_argument(
|
54
|
+
"-w",
|
55
|
+
"--watch",
|
56
|
+
nargs="*",
|
57
|
+
help="directories to watch",
|
58
|
+
)
|
59
|
+
|
48
60
|
parser.add_argument(
|
49
61
|
"-v",
|
50
62
|
dest="verbose",
|
@@ -81,6 +93,23 @@ def init_args(args=None):
|
|
81
93
|
return args
|
82
94
|
|
83
95
|
|
96
|
+
class Handler(FileSystemEventHandler):
|
97
|
+
def __init__(self, ev):
|
98
|
+
self._ev = ev
|
99
|
+
|
100
|
+
def on_created(self, event):
|
101
|
+
print(event)
|
102
|
+
self._ev.set()
|
103
|
+
|
104
|
+
def on_modified(self, event):
|
105
|
+
print(event)
|
106
|
+
self._ev.set()
|
107
|
+
|
108
|
+
def on_deleted(self, event):
|
109
|
+
print(event)
|
110
|
+
self._ev.set()
|
111
|
+
|
112
|
+
|
84
113
|
def main():
|
85
114
|
args = init_args()
|
86
115
|
if args.version:
|
@@ -127,9 +156,29 @@ def main():
|
|
127
156
|
else:
|
128
157
|
targets.append(target)
|
129
158
|
|
159
|
+
run(mod, args.job, params, targets)
|
160
|
+
|
161
|
+
if args.watch:
|
162
|
+
ev = threading.Event()
|
163
|
+
observer = Observer()
|
164
|
+
|
165
|
+
for watch in args.watch:
|
166
|
+
d = Path(watch).absolute()
|
167
|
+
print(d)
|
168
|
+
observer.schedule(Handler(ev), str(d), recursive=True)
|
169
|
+
|
170
|
+
observer.start()
|
171
|
+
while True:
|
172
|
+
ev.wait()
|
173
|
+
time.sleep(0.1)
|
174
|
+
ev.clear()
|
175
|
+
run(mod, args.job, params, targets)
|
176
|
+
|
177
|
+
|
178
|
+
def run(mod, job, params, targets):
|
130
179
|
try:
|
131
180
|
# load module
|
132
|
-
prod = pyprod.prod.Prod(mod,
|
181
|
+
prod = pyprod.prod.Prod(mod, job, params)
|
133
182
|
# select targets
|
134
183
|
if not targets:
|
135
184
|
target = prod.get_default_target()
|
pyprod/prod.py
CHANGED
@@ -637,7 +637,8 @@ class Prod:
|
|
637
637
|
["git", "log", "-1", "--format=%ai", "--", name], text=True
|
638
638
|
).strip()
|
639
639
|
if not ret:
|
640
|
-
|
640
|
+
logger.warning("%s did not match any file in git", name)
|
641
|
+
return self.get_file_mtime(name)
|
641
642
|
|
642
643
|
# 2025-01-17 00:05:48 +0900
|
643
644
|
return dateutil.parser.parse(ret)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: PyProd
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.10.0
|
4
4
|
Summary: PyProd: More Makeable than Make
|
5
5
|
Project-URL: Homepage, https://github.com/atsuoishimoto/pyprod
|
6
6
|
Project-URL: Documentation, https://pyprod.readthedocs.io/en/latest/
|
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3
|
|
13
13
|
Classifier: Topic :: Software Development :: Build Tools
|
14
14
|
Requires-Python: >=3.10
|
15
15
|
Requires-Dist: python-dateutil
|
16
|
+
Requires-Dist: watchdog>=6.0.0
|
16
17
|
Description-Content-Type: text/x-rst
|
17
18
|
|
18
19
|
PyProd - More Makeable than Make
|
@@ -0,0 +1,11 @@
|
|
1
|
+
pyprod/__init__.py,sha256=v4zmKjsKOPZbp6BrWoz7iK4ST0sdZdUh9bQSJmluZ5o,23
|
2
|
+
pyprod/__main__.py,sha256=Vdhw8YA1K3wPMlbJQYL5WqvRzAKVeZ16mZQFO9VRmCo,62
|
3
|
+
pyprod/main.py,sha256=jykm2yxqem9RV-eTdWrk03cXLGaS1OTFaeyw_DmTbZk,4141
|
4
|
+
pyprod/prod.py,sha256=_FGLJlDB2zVgsGgJ13VdXvoK0bpdkfdHwfvePf0Db9Q,21263
|
5
|
+
pyprod/utils.py,sha256=6bA06MtxvzcEArAozeJVMgCvoTT185OPEGypM1jjoG0,481
|
6
|
+
pyprod/venv.py,sha256=ZNMtHDBdC-eNFJE0-GxDlh6tlGy5Y-2m1r86SqxJJR0,1229
|
7
|
+
pyprod-0.10.0.dist-info/METADATA,sha256=SlnUNgvOd2Iw75g5ilKj-8Y-An2V9EoffOqcae6ZdBA,2715
|
8
|
+
pyprod-0.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
+
pyprod-0.10.0.dist-info/entry_points.txt,sha256=zFycf8BYSMRDTiI0jftmcvtkf9XM4MZ4BL3JaIer_ZM,44
|
10
|
+
pyprod-0.10.0.dist-info/licenses/LICENSE,sha256=OtPgwnlLrsVEYPnTraun5AqftAT5vUv4rIan-qYj7nE,1071
|
11
|
+
pyprod-0.10.0.dist-info/RECORD,,
|
pyprod-0.9.0.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
pyprod/__init__.py,sha256=H9NWRZb7NbeRRPLP_V1fARmLNXranorVM-OOY-8_2ug,22
|
2
|
-
pyprod/__main__.py,sha256=Vdhw8YA1K3wPMlbJQYL5WqvRzAKVeZ16mZQFO9VRmCo,62
|
3
|
-
pyprod/main.py,sha256=_JuQCgGAGIx_hRc4U2BtsXRfUNKaqhnM3TndsqNcOac,3115
|
4
|
-
pyprod/prod.py,sha256=H6Ssxbh4p0Q7azB_st3qr1d3RwgIiqMekk_WSDt-xeg,21226
|
5
|
-
pyprod/utils.py,sha256=6bA06MtxvzcEArAozeJVMgCvoTT185OPEGypM1jjoG0,481
|
6
|
-
pyprod/venv.py,sha256=ZNMtHDBdC-eNFJE0-GxDlh6tlGy5Y-2m1r86SqxJJR0,1229
|
7
|
-
pyprod-0.9.0.dist-info/METADATA,sha256=KUZ8WDr88krTBUUwXbFRiRnrV-FhsG7uYk7on-_lRJo,2683
|
8
|
-
pyprod-0.9.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
-
pyprod-0.9.0.dist-info/entry_points.txt,sha256=zFycf8BYSMRDTiI0jftmcvtkf9XM4MZ4BL3JaIer_ZM,44
|
10
|
-
pyprod-0.9.0.dist-info/licenses/LICENSE,sha256=OtPgwnlLrsVEYPnTraun5AqftAT5vUv4rIan-qYj7nE,1071
|
11
|
-
pyprod-0.9.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|