Skip to content

Commit

Permalink
service: dev: Keep package path relative to cwd
Browse files Browse the repository at this point in the history
Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
  • Loading branch information
pdxjohnny committed Apr 30, 2021
1 parent 3e79802 commit 60088c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dffml/service/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ class Release(CMD):

async def run(self):
# Ensure we have a pathlib.Path object
self.package = REPO_ROOT
self.package = Path(self.package).resolve()
# Ensure target plugin directory has no unstaged changes
cmd = ["git", "status", "--porcelain", str(self.package)]
self.logger.debug("Running: %s", " ".join(cmd))
Expand All @@ -545,6 +545,8 @@ async def run(self):
# cd to directory
with chdir(str(self.package)):
# Get name
# TODO(2ndparty) This needs to change to support second party
# plugins
name = {(): "dffml", **PACKAGE_DIRECTORY_TO_NAME,}[
self.package.relative_to(REPO_ROOT).parts
]
Expand Down
5 changes: 5 additions & 0 deletions tests/service/test_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from dffml.version import VERSION
from dffml.df.types import DataFlow
from dffml.service.dev import (
REPO_ROOT,
Develop,
RepoDirtyError,
Export,
Expand Down Expand Up @@ -214,6 +215,10 @@ def fake_urlopen(url):


class TestRelease(AsyncTestCase):
async def setUp(self):
await super().setUp()
self._stack.enter_context(chdir(REPO_ROOT))

async def test_uncommited_changes(self):
class FailedFakeProcess(FakeProcess):
async def communicate(self):
Expand Down

0 comments on commit 60088c4

Please sign in to comment.