Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit 1032e9b

Browse files
committed
service: dev: Fix version file listing
Signed-off-by: John Andersen <[email protected]>
1 parent ec48e2e commit 1032e9b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

dffml/service/dev.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import getpass
1010
import tempfile
1111
import importlib
12+
import subprocess
1213
import contextlib
1314
import configparser
1415
import pkg_resources
@@ -530,8 +531,17 @@ async def run(self):
530531
)
531532
main_package = pathlib.Path(main_package)
532533
skel = main_package / "dffml" / "skel"
534+
version_files = map(
535+
lambda path: pathlib.Path(*path.split("/")).resolve(),
536+
filter(
537+
bool,
538+
subprocess.check_output(["git", "ls-files", "*/version.py"])
539+
.decode()
540+
.split("\n"),
541+
),
542+
)
533543
# Update all the version files
534-
for version_file in main_package.rglob("**/version.py"):
544+
for version_file in version_files:
535545
# Ignore skel
536546
if skel in version_file.parents:
537547
self.logger.debug(
@@ -542,7 +552,10 @@ async def run(self):
542552
# check we're in the right package, skip if not.
543553
setup_filepath = version_file.parent.parent / "setup.py"
544554
with chdir(setup_filepath.parent):
545-
name = SetupPyKWArg.get_kwargs(setup_filepath)["name"]
555+
try:
556+
name = SetupPyKWArg.get_kwargs(setup_filepath)["name"]
557+
except Exception as error:
558+
raise Exception(setup_filepath) from error
546559
if self.only and name not in self.only:
547560
self.logger.debug(
548561
"Verison file not in only %s", version_file

0 commit comments

Comments
 (0)