diff --git a/setup.py b/setup.py index 7e5ae34179b3f610f718229d3fea34e32bd66236..df84b3a074aeaf2187c5b299bb1ba57998335aa8 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ # Use this guide: # https://packaging.python.org/tutorials/packaging-projects/ # py -m build && twine upload dist/* -# LINUX: python -m build && twine upload dist/* +# LINUX: python -m build && python -m twine upload dist/* # Local install: sudo pip install -e ./ diff --git a/src/unitgrade_devel.egg-info/PKG-INFO b/src/unitgrade_devel.egg-info/PKG-INFO index fcaff417af73a19059fb9ffd3de3b746377ef88d..60a3ee1b7812812aa107068593cea870db9e86f3 100644 --- a/src/unitgrade_devel.egg-info/PKG-INFO +++ b/src/unitgrade_devel.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: unitgrade-devel -Version: 0.1.52 +Version: 0.1.53 Summary: A set of tools to develop unitgrade tests and reports and later evaluate them Home-page: https://lab.compute.dtu.dk/tuhe/unitgrade_private Author: Tue Herlau diff --git a/src/unitgrade_private/run.py b/src/unitgrade_private/run.py index 01a54632e320a7c5f9e81e1368862078359b0069..6a143fe2010b52e53013fde5f5bc266fa463b653 100644 --- a/src/unitgrade_private/run.py +++ b/src/unitgrade_private/run.py @@ -3,10 +3,9 @@ import select import subprocess import sys - # logger = logging.getLogger() -def run(cmd: str | list, print_output=True, log_output=False, check=True, *args, **kwargs) -> subprocess.Popen: +def run(cmd : str | list, print_output=True, log_output=False, check=True, *args, **kwargs) -> subprocess.Popen: """Run a command, with superpowers * cmd: The command to run. If a string, it will be passed to a shell. @@ -30,6 +29,24 @@ def run(cmd: str | list, print_output=True, log_output=False, check=True, *args, The Popen object is always returned. """ shell = isinstance(cmd, str) + import os + if os.name == "nt": # th juli 2023: annoying winows problem. + print("Warning, due to problem on windows the console output will not be shown while the command is runnign (error due to select.select).") + import subprocess + p = subprocess.run(cmd, shell=True, encoding="utf-8", capture_output=True) + # out_ = p.stdout + # err_ = p.stderr + class std_: + def __init__(self, s): + self.s = s + def getvalue(self): + return self.s + p.stdout = std_(p.stdout) + p.stderr = std_(p.stderr) + return p + + + # logger.debug(f"Running command: {cmd}") process = subprocess.Popen( diff --git a/src/unitgrade_private/version.py b/src/unitgrade_private/version.py index c384a4f02b32272aa3cd2ec7b4e639fac8ee2a5c..d7ae2c855a2f9c3dd17be101004ab961678767a4 100644 --- a/src/unitgrade_private/version.py +++ b/src/unitgrade_private/version.py @@ -1,2 +1,2 @@ -__version__ = "0.1.52" +__version__ = "0.1.53"