Skip to content

Commit

Permalink
releasing 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rtmigo committed Mar 5, 2021
1 parent e09ca6e commit bf39d40
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion svet/constants.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.0"
__version__ = "0.2.0"
25 changes: 13 additions & 12 deletions svet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def usageDoc():
return f"{aboveFirstLine}\n{doc}\n"


def getVepsDir() -> Path:
def getSvetDir() -> Path:
s = os.environ.get("SVETDIR")
if s:
return Path(os.path.expanduser(os.path.expandvars(s)))
Expand All @@ -106,24 +106,24 @@ class TestVenvsDir(unittest.TestCase):

def test_if_set_plain(self):
os.environ["SVETDIR"] = "/path/to/veps"
self.assertEqual(getVepsDir(), Path('/path/to/veps'))
self.assertEqual(getSvetDir(), Path('/path/to/veps'))

def test_if_set_with_vars(self):
os.environ["SVETDIR"] = "$HOME/subfolder"
s = str(getVepsDir())
s = str(getSvetDir())
self.assertTrue("$" not in s)
self.assertGreater(len(s), len("/home/"))

def test_if_set_with_user(self):
os.environ["SVETDIR"] = "~/subfolder"
s = str(getVepsDir())
s = str(getSvetDir())
self.assertTrue("~" not in s)
self.assertGreater(len(s), len("/home/"))

def test_if_not_n(self):
if "SVETDIR" in os.environ:
del os.environ["SVETDIR"]
p = str(getVepsDir())
p = str(getSvetDir())
self.assertTrue(p.endswith("svet"))
self.assertGreater(len(p), len("/.svet"))

Expand All @@ -134,12 +134,12 @@ def run(args: List[str]):
subprocess.run(args, shell=True)


def runseqOld(commands: List[str]):
joined = ' && '.join(commands)
if verbose:
print(f"Running '{joined}'")
# return os.system(joined)
subprocess.run(joined)
# def runseqOld(commands: List[str]):
# joined = ' && '.join(commands)
# if verbose:
# print(f"Running '{joined}'")
# # return os.system(joined)
# subprocess.run(joined)


def runseq(commands: List[str]):
Expand All @@ -152,6 +152,7 @@ def runseq(commands: List[str]):

subprocess.call("\n".join(bashLines), shell=True)


def quote(arg: str) -> str:
return json.dumps(arg)

Expand Down Expand Up @@ -262,7 +263,7 @@ def runmain(args: Optional[List[str]] = None):
###########

projectDir = Path(".").absolute()
venvDir = getVepsDir() / (
venvDir = getSvetDir() / (
projectDir.name + "_venv") # venvsParentDir / (projectDir.name + "_venv")

if verbose:
Expand Down

0 comments on commit bf39d40

Please sign in to comment.