Example #1
0
 def my_version(self, version=None):
     if self._my_version is not None:
         return self._my_version
     if version is None:
         try:
             version = get_yt_version()
         except Exception:
             version = f"UNKNOWN{time.time()}"
     self._my_version = version
     return self._my_version
Example #2
0
from yt.config import ytcfg
ytcfg["yt","suppressStreamLogging"] = "True"
ytcfg["yt","__command_line"] = "True" 

from yt.funcs import get_yt_version
from yt.utilities.logger import ytLogger as mylog
from yt.utilities.logger import \
    disable_stream_logging, ufstring
disable_stream_logging()

from yt.utilities.answer_testing.framework import \
    AnswerTesting

try:
    yt_version = get_yt_version()
except:
    print("ERROR: cannot get yt version, install yt in develop mode if you want the test runner to record the yt version.")
    yt_version = None

# Test keyword types and default values.
varspec = dict(
    name = (str, ''),
    answer_testing_script = (str, None),
    nprocs = (int, 1),
    runtime = (str, 'short'),
    hydro = (bool, False),
    mhd = (bool, False),
    gravity = (bool, False),
    cosmology = (bool, False),
    cosmology_simulation = (bool, False),
Example #3
0
 def __call__(self, args):
     print(
         "===============================================================")
     print()
     print("Hi there!  Welcome to the yt bugreport taker.")
     print()
     print(
         "===============================================================")
     print(
         "At any time in advance of the upload of the bug, you should feel free"
     )
     print(
         "to ctrl-C out and submit the bug report manually by going here:")
     print("   http://bitbucket.org/yt_analysis/yt/issues/new")
     print()
     print("Also, in order to submit a bug through this interface, you")
     print("need a Bitbucket account. If you don't have one, exit this ")
     print(
         "bugreport now and run the 'yt bootstrap_dev' command to create one."
     )
     print()
     print("Have you checked the existing bug reports to make")
     print("sure your bug has not already been recorded by someone else?")
     print(
         "   http://bitbucket.org/yt_analysis/yt/issues?status=new&status=open"
     )
     print()
     print(
         "Finally, are you sure that your bug is, in fact, a bug? It might")
     print("simply be a misunderstanding that could be cleared up by")
     print(
         "visiting the yt irc channel or getting advice on the email list:")
     print("   http://yt-project.org/irc.html")
     print(
         "   http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
     )
     print()
     summary = input(
         "Press <enter> if you remain firm in your conviction to continue.")
     print()
     print()
     print("Okay, sorry about that. How about a nice, pithy ( < 12 words )")
     print(
         "summary of the bug?  (e.g. 'Particle overlay problem with parallel "
     )
     print("projections')")
     print()
     try:
         current_version = get_yt_version()
     except:
         current_version = "Unavailable"
     summary = input("Summary? ")
     bugtype = "bug"
     data = dict(title=summary, type=bugtype)
     print()
     print("Okay, now let's get a bit more information.")
     print()
     print("Remember that if you want to submit a traceback, you can run")
     print("any script with --paste or --detailed-paste to submit it to")
     print("the pastebin and then include the link in this bugreport.")
     if "EDITOR" in os.environ:
         print()
         print("Press enter to spawn your editor, %s" %
               os.environ["EDITOR"])
         input()
         tf = tempfile.NamedTemporaryFile(delete=False)
         fn = tf.name
         tf.close()
         subprocess.call("$EDITOR %s" % fn, shell=True)
         content = open(fn).read()
         try:
             os.unlink(fn)
         except:
             pass
     else:
         print()
         print("Couldn't find an $EDITOR variable.  So, let's just take")
         print("take input here.  Type up your summary until you're ready")
         print("to be done, and to signal you're done, type --- by itself")
         print("on a line to signal your completion.")
         print()
         print("(okay, type now)")
         print()
         lines = []
         while 1:
             line = input()
             if line.strip() == "---": break
             lines.append(line)
         content = "\n".join(lines)
     content = "Reporting Version: %s\n\n%s" % (current_version, content)
     endpoint = "repositories/yt_analysis/yt/issues"
     data['content'] = content
     print()
     print(
         "===============================================================")
     print()
     print("Okay, we're going to submit with this:")
     print()
     print("Summary: %s" % (data['title']))
     print()
     print("---")
     print(content)
     print("---")
     print()
     print(
         "===============================================================")
     print()
     print("Is that okay?  If not, hit ctrl-c.  Otherwise, enter means")
     print("'submit'.  Next we'll ask for your Bitbucket Username.")
     print("If you don't have one, run the 'yt bootstrap_dev' command.")
     print()
     input()
     retval = bb_apicall(endpoint, data, use_pass=True)
     import json
     retval = json.loads(retval)
     url = "http://bitbucket.org/yt_analysis/yt/issue/%s" % retval[
         'local_id']
     print()
     print(
         "===============================================================")
     print()
     print(
         "Thanks for your bug report!  Together we'll make yt totally bug free!"
     )
     print("You can view bug report here:")
     print("   %s" % url)
     print()
     print("Keep in touch!")
     print()