PyProd 0.6.0__py3-none-any.whl → 0.7.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/prod.py +23 -2
- {pyprod-0.6.0.dist-info → pyprod-0.7.0.dist-info}/METADATA +1 -1
- pyprod-0.7.0.dist-info/RECORD +11 -0
- pyprod-0.6.0.dist-info/RECORD +0 -11
- {pyprod-0.6.0.dist-info → pyprod-0.7.0.dist-info}/WHEEL +0 -0
- {pyprod-0.6.0.dist-info → pyprod-0.7.0.dist-info}/entry_points.txt +0 -0
- {pyprod-0.6.0.dist-info → pyprod-0.7.0.dist-info}/licenses/LICENSE +0 -0
pyprod/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.
|
1
|
+
__version__ = "0.7.0"
|
pyprod/prod.py
CHANGED
@@ -17,7 +17,9 @@ from dataclasses import dataclass, field
|
|
17
17
|
from fnmatch import fnmatch, translate
|
18
18
|
from functools import wraps
|
19
19
|
from pathlib import Path
|
20
|
+
|
20
21
|
import dateutil.parser
|
22
|
+
|
21
23
|
import pyprod
|
22
24
|
|
23
25
|
from .utils import flatten, unique_list
|
@@ -164,7 +166,7 @@ def _check_pattern(pattern):
|
|
164
166
|
|
165
167
|
def _check_wildcard(path):
|
166
168
|
if "*" in path:
|
167
|
-
raise RuleError(f"{path}: '*'
|
169
|
+
raise RuleError(f"{path}: '*' is not allowed")
|
168
170
|
|
169
171
|
|
170
172
|
def _name_to_str(name):
|
@@ -183,6 +185,25 @@ def _name_to_str(name):
|
|
183
185
|
return name
|
184
186
|
|
185
187
|
|
188
|
+
def _expand_glob(name):
|
189
|
+
if not isinstance(name, (str, Path)):
|
190
|
+
return name
|
191
|
+
|
192
|
+
if "*" not in str(name):
|
193
|
+
return name
|
194
|
+
|
195
|
+
# split path to support absolute path
|
196
|
+
p = Path(name)
|
197
|
+
parts = p.parts
|
198
|
+
for i, part in enumerate(parts):
|
199
|
+
if "*" in part:
|
200
|
+
root = Path(*parts[:i])
|
201
|
+
rest = "/".join(parts[i:])
|
202
|
+
break
|
203
|
+
|
204
|
+
return list(root.glob(rest))
|
205
|
+
|
206
|
+
|
186
207
|
class Rule:
|
187
208
|
def __init__(self, targets, pattern=None, depends=(), uses=(), builder=None):
|
188
209
|
self.targets = []
|
@@ -221,7 +242,6 @@ class Rule:
|
|
221
242
|
|
222
243
|
depend = _name_to_str(depend)
|
223
244
|
_check_pattern_count(depend)
|
224
|
-
_check_wildcard(depend)
|
225
245
|
self.depends.append(depend)
|
226
246
|
|
227
247
|
self.uses = []
|
@@ -352,6 +372,7 @@ class Rules:
|
|
352
372
|
depends = dep.depends[:]
|
353
373
|
uses = dep.uses[:]
|
354
374
|
|
375
|
+
depends = list(flatten(_expand_glob(depend) for depend in depends))
|
355
376
|
yield depends, uses, dep
|
356
377
|
break
|
357
378
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
pyprod/__init__.py,sha256=RaANGbRu5e-vehwXI1-Qe2ggPPfs1TQaZj072JdbLk4,22
|
2
|
+
pyprod/__main__.py,sha256=Vdhw8YA1K3wPMlbJQYL5WqvRzAKVeZ16mZQFO9VRmCo,62
|
3
|
+
pyprod/main.py,sha256=SWMmGVnVALwgENHmFfrTnYJcNyjWjw_qSO3o4aGre4E,3169
|
4
|
+
pyprod/prod.py,sha256=RY1-DPE_W5BhAXDURDeJViddCDxyZ0JVSFd40vSJOFI,20555
|
5
|
+
pyprod/utils.py,sha256=6bA06MtxvzcEArAozeJVMgCvoTT185OPEGypM1jjoG0,481
|
6
|
+
pyprod/venv.py,sha256=ZNMtHDBdC-eNFJE0-GxDlh6tlGy5Y-2m1r86SqxJJR0,1229
|
7
|
+
pyprod-0.7.0.dist-info/METADATA,sha256=mOcpnvRLrSdqN-p6U0U3EgXjX6L4dNg-w5H1XNAlPPg,2683
|
8
|
+
pyprod-0.7.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
+
pyprod-0.7.0.dist-info/entry_points.txt,sha256=zFycf8BYSMRDTiI0jftmcvtkf9XM4MZ4BL3JaIer_ZM,44
|
10
|
+
pyprod-0.7.0.dist-info/licenses/LICENSE,sha256=OtPgwnlLrsVEYPnTraun5AqftAT5vUv4rIan-qYj7nE,1071
|
11
|
+
pyprod-0.7.0.dist-info/RECORD,,
|
pyprod-0.6.0.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
pyprod/__init__.py,sha256=cID1jLnC_vj48GgMN6Yb1FA3JsQ95zNmCHmRYE8TFhY,22
|
2
|
-
pyprod/__main__.py,sha256=Vdhw8YA1K3wPMlbJQYL5WqvRzAKVeZ16mZQFO9VRmCo,62
|
3
|
-
pyprod/main.py,sha256=SWMmGVnVALwgENHmFfrTnYJcNyjWjw_qSO3o4aGre4E,3169
|
4
|
-
pyprod/prod.py,sha256=Msuqe914lblxBAx_bP6_-P2ZCHrYyn-9qplMWvkg45s,20103
|
5
|
-
pyprod/utils.py,sha256=6bA06MtxvzcEArAozeJVMgCvoTT185OPEGypM1jjoG0,481
|
6
|
-
pyprod/venv.py,sha256=ZNMtHDBdC-eNFJE0-GxDlh6tlGy5Y-2m1r86SqxJJR0,1229
|
7
|
-
pyprod-0.6.0.dist-info/METADATA,sha256=MNlfNV0nd0ikLscGAQFp_r8B5fsG4Xe-d7pS4Pyj-cE,2683
|
8
|
-
pyprod-0.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
-
pyprod-0.6.0.dist-info/entry_points.txt,sha256=zFycf8BYSMRDTiI0jftmcvtkf9XM4MZ4BL3JaIer_ZM,44
|
10
|
-
pyprod-0.6.0.dist-info/licenses/LICENSE,sha256=OtPgwnlLrsVEYPnTraun5AqftAT5vUv4rIan-qYj7nE,1071
|
11
|
-
pyprod-0.6.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|