<html><body>
<p>2 new commits in yt:</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/17467a0fe24f/">https://bitbucket.org/yt_analysis/yt/commits/17467a0fe24f/</a> Changeset:   17467a0fe24f Branch:      yt User:        ngoldbaum Date:        2016-04-18 21:02:27+00:00 Summary:     Make “yt update” and “yt version” behave more nicely on conda Affected #:  2 files</p>
<p>diff -r d8eec89b2c86f300ce9cfb0205b97cefb5dd0c45 -r 17467a0fe24fc86b7c296e2c616d43bd54423c51 yt/funcs.py --- a/yt/funcs.py +++ b/yt/funcs.py @@ -551,9 +551,13 @@</p>
<pre>print("Updating and precise version information requires ")
print("python-hglib to be installed.")
print("Try: pip install python-hglib")</pre>
<ul><li><p>return -1</p></li>
<li><p>repo = hglib.open(path)</p></li>
<li><p>return repo.identify()</p></li></ul>
<p>+        return None +    try: +        repo = hglib.open(path) +        return repo.identify() +    except hglib.error.ServerError: +        # path is not an hg repository +        return None</p>
<pre>def get_yt_version():
    try:</pre>
<p>@@ -564,8 +568,11 @@</p>
<pre>import pkg_resources
yt_provider = pkg_resources.get_provider("yt")
path = os.path.dirname(yt_provider.module_path)</pre>
<ul><li><p>version = get_hg_version(path)[:12]</p></li>
<li><p>return version</p></li></ul>
<p>+    version = get_hg_version(path) +    if version is None: +        return version +    else: +        return version[:12].strip().decode('utf-8')</p>
<pre>def get_version_stack():
    version_info = {}</pre>
<p>diff -r d8eec89b2c86f300ce9cfb0205b97cefb5dd0c45 -r 17467a0fe24fc86b7c296e2c616d43bd54423c51 yt/utilities/command_line.py --- a/yt/utilities/command_line.py +++ b/yt/utilities/command_line.py @@ -32,6 +32,7 @@</p>
<pre>from yt.funcs import \
    ensure_list, \
    get_hg_version, \</pre>
<p>+    get_yt_version, \</p>
<pre>mylog, \
ensure_dir_exists, \
update_hg, \</pre>
<p>@@ -74,6 +75,48 @@</p>
<pre>    if "longname" in argc: argnames.append(argc.pop('longname'))
    sc.add_argument(*argnames, **argc)
</pre>
<p>+def _print_failed_source_update(reinstall=False): +    print() +    print("The yt package is not installed from a mercurial repository,") +    print("so you must update this installation manually.") +    if ‘Continuum Analytics’ in sys.version or ‘Anaconda’ in sys.version: +        # see <a href="http://stackoverflow.com/a/21318941/1382869">http://stackoverflow.com/a/21318941/1382869</a> for why we need +        # to check both Continuum <strong>and</strong> Anaconda +        print() +        print("Since it looks like you are using a python installation") +        print("that is managed by conda, you may want to do:") +        print() +        print("    $ conda update yt") +        print() +        print("to update your yt installation.") +        if reinstall is True: +            print() +            print("To update all of your packages, you can do:") +            print() +            print("    $ conda update --all") + +def <em>print_installation_information(path): +    import yt +    print() +    print("yt module located at:") +    print("    %s" % (path)) +    if “YT_DEST” in os.environ: +        spath = os.path.join( +            os.environ["YT_DEST"], “src”, “yt-supplemental”) +        if os.path.isdir(spath): +            print("The supplemental repositories are located at:") +            print("    %s" % (spath)) +    print() +    print("The current version of yt is:") +    print() +    print("---") +    print("Version = %s" % yt.__version_</em>) +    vstring = get_hg_version(path) +    if vstring is not None: +        print("Changeset = %s" % vstring.strip().decode("utf-8")) +    print("---") +    return vstring +</p>
<pre>class YTCommandSubtype(type):
    def __init__(cls, name, b, d):
        type.__init__(cls, name, b, d)</pre>
<p>@@ -334,6 +377,13 @@</p>
<pre>def _update_yt_stack(path):
    "Rerun the install script to updated all dependencies."
</pre>
<p>+    if “YT_DEST” not in os.environ: +        print() +        print("This yt installation does not appear to be managed by the") +        print("source-based install script, but ‘update --all’ was specified.") +        print("You will need to update your dependencies manually.") +        return +</p>
<pre>install_script = os.path.join(path, "doc/install_script.sh")
if not os.path.exists(install_script):
    print()</pre>
<p>@@ -361,19 +411,6 @@</p>
<pre>        print("The yt stack has been updated successfully.")
        print("Now get back to work!")
</pre>
<p>-def get_yt_version():</p>
<ul><li><p>try:</p></li>
<li><p>from yt.__hg_version__ import hg_version</p></li>
<li><p>return hg_version</p></li>
<li><p>except ImportError:</p></li>
<li><p>pass</p></li>
<li><p>import pkg_resources</p></li>
<li><p>yt_provider = pkg_resources.get_provider("yt")</p></li>
<li><p>path = os.path.dirname(yt_provider.module_path)</p></li>
<li><p>if not os.path.isdir(os.path.join(path, ".hg")): return None</p></li>
<li><p>version = get_hg_version(path)</p></li>
<li><p>return version</p></li></ul>
<p>–</p>
<pre># This code snippet is modified from Georg Brandl
def bb_apicall(endpoint, data, use_pass = True):
    uri = 'https://api.bitbucket.org/1.0/%s/' % endpoint</pre>
<p>@@ -605,43 +642,17 @@</p>
<pre>def __call__(self, opts):
    import pkg_resources</pre>
<ul><li><p>import yt yt_provider = pkg_resources.get_provider("yt") path = os.path.dirname(yt_provider.module_path)</p></li>
<li><p>print()</p></li>
<li><p>print("yt module located at:")</p></li>
<li><p>print("    %s" % (path))</p></li>
<li><p>if “YT_DEST” in os.environ:</p></li>
<li><p>spath = os.path.join(</p></li>
<li><p>os.environ["YT_DEST"], “src”, “yt-supplemental”)</p></li>
<li><p>if os.path.isdir(spath):</p></li>
<li><p>print("The supplemental repositories are located at:")</p></li>
<li><p>print("    %s" % (spath))</p></li>
<li><p>vstring = get_yt_version()</p></li>
<li><p>if vstring == -1:</p></li>
<li><p>vstring = “unknown”</p></li></ul>
<p>+        vstring = _print_installation_information(path)</p>
<pre>if vstring is not None:</pre>
<ul><li><p>print()</p></li>
<li><p>print("The current version and changeset for the code is:")</p></li>
<li><p>print()</p></li>
<li><p>print("---")</p></li>
<li><p>print("Version = %s" % yt.__version__)</p></li>
<li><p>print("Changeset = %s" % vstring.strip().decode("utf-8"))</p></li>
<li><p>print("---")</p></li>
<li><p>print()</p></li>
<li><p>if “site-packages” not in path:</p></li>
<li><p>print("This installation CAN be automatically updated.")</p></li>
<li><p>if opts.update_source:</p></li>
<li><p>update_hg(path)</p></li>
<li><p>print("Updated successfully.")</p></li></ul>
<p>+            print("This installation CAN be automatically updated.") +            if opts.update_source: +                update_hg(path) +                print("Updated successfully.")</p>
<pre>_get_yt_stack_date()
         elif opts.update_source:</pre>
<ul><li><p>print()</p></li>
<li><p>print("YT site-packages not in path, so you must")</p></li>
<li><p>print("update this installation manually by committing and")</p></li>
<li><p>print("merging your modifications to the code before")</p></li>
<li><p>print("updating to the newest changeset.")</p></li>
<li><p>print()</p></li></ul>
<p>+            _print_failed_source_update()</p>
<pre>        if vstring is not None and opts.outputfile is not None:
            open(opts.outputfile, "w").write(vstring)
</pre>
<p>@@ -1024,28 +1035,10 @@</p>
<pre>def __call__(self, opts):
    import pkg_resources</pre>
<ul><li><p>import yt yt_provider = pkg_resources.get_provider("yt") path = os.path.dirname(yt_provider.module_path)</p></li>
<li><p>print()</p></li>
<li><p>print("yt module located at:")</p></li>
<li><p>print("    %s" % (path))</p></li>
<li><p>if “YT_DEST” in os.environ:</p></li>
<li><p>spath = os.path.join(</p></li>
<li><p>os.environ["YT_DEST"], “src”, “yt-supplemental”)</p></li>
<li><p>if os.path.isdir(spath):</p></li>
<li><p>print("The supplemental repositories are located at:")</p></li>
<li><p>print("    %s" % (spath))</p></li>
<li><p>vstring = None</p></li>
<li><p>if “site-packages” not in path:</p></li>
<li><p>vstring = get_hg_version(path)</p></li>
<li><p>print()</p></li>
<li><p>print("The current version and changeset for the code is:")</p></li>
<li><p>print()</p></li>
<li><p>print("---")</p></li>
<li><p>print("Version = %s" % yt.__version__)</p></li>
<li><p>print("Changeset = %s" % vstring.strip().decode("utf-8"))</p></li>
<li><p>print("---")</p></li></ul>
<p>+        vstring = _print_installation_information(path) +        if vstring is not None:</p>
<pre>print()
print("This installation CAN be automatically updated.")
update_hg(path, skip_rebuild=opts.reinstall)</pre>
<p>@@ -1054,12 +1047,7 @@</p>
<pre>if opts.reinstall:
    _update_yt_stack(path)
         else:</pre>
<ul><li><p>print()</p></li>
<li><p>print("YT site-packages not in path, so you must")</p></li>
<li><p>print("update this installation manually by committing and")</p></li>
<li><p>print("merging your modifications to the code before")</p></li>
<li><p>print("updating to the newest changeset.")</p></li>
<li><p>print()</p></li></ul>
<p>+            _print_failed_source_update(opts.reinstall)</p>
<pre>class YTUploadImageCmd(YTCommand):
    args = (dict(short="file", type=str),)</pre>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/27481b513244/">https://bitbucket.org/yt_analysis/yt/commits/27481b513244/</a> Changeset:   27481b513244 Branch:      yt User:        xarthisius Date:        2016-04-20 18:09:43+00:00 Summary:     Merged in ngoldbaum/yt (pull request #2129)</p>
<p>Make “yt update” and “yt version” behave more nicely on conda Affected #:  2 files</p>
<p>diff -r 116dd39ae554e73c9b45718afee7c4f5cf593ff2 -r 27481b513244c9c7bb15578ed5381a812983e567 yt/funcs.py --- a/yt/funcs.py +++ b/yt/funcs.py @@ -551,9 +551,13 @@</p>
<pre>print("Updating and precise version information requires ")
print("python-hglib to be installed.")
print("Try: pip install python-hglib")</pre>
<ul><li><p>return -1</p></li>
<li><p>repo = hglib.open(path)</p></li>
<li><p>return repo.identify()</p></li></ul>
<p>+        return None +    try: +        repo = hglib.open(path) +        return repo.identify() +    except hglib.error.ServerError: +        # path is not an hg repository +        return None</p>
<pre>def get_yt_version():
    try:</pre>
<p>@@ -564,8 +568,11 @@</p>
<pre>import pkg_resources
yt_provider = pkg_resources.get_provider("yt")
path = os.path.dirname(yt_provider.module_path)</pre>
<ul><li><p>version = get_hg_version(path)[:12]</p></li>
<li><p>return version</p></li></ul>
<p>+    version = get_hg_version(path) +    if version is None: +        return version +    else: +        return version[:12].strip().decode('utf-8')</p>
<pre>def get_version_stack():
    version_info = {}</pre>
<p>diff -r 116dd39ae554e73c9b45718afee7c4f5cf593ff2 -r 27481b513244c9c7bb15578ed5381a812983e567 yt/utilities/command_line.py --- a/yt/utilities/command_line.py +++ b/yt/utilities/command_line.py @@ -32,6 +32,7 @@</p>
<pre>from yt.funcs import \
    ensure_list, \
    get_hg_version, \</pre>
<p>+    get_yt_version, \</p>
<pre>mylog, \
ensure_dir_exists, \
update_hg, \</pre>
<p>@@ -74,6 +75,48 @@</p>
<pre>    if "longname" in argc: argnames.append(argc.pop('longname'))
    sc.add_argument(*argnames, **argc)
</pre>
<p>+def _print_failed_source_update(reinstall=False): +    print() +    print("The yt package is not installed from a mercurial repository,") +    print("so you must update this installation manually.") +    if ‘Continuum Analytics’ in sys.version or ‘Anaconda’ in sys.version: +        # see <a href="http://stackoverflow.com/a/21318941/1382869">http://stackoverflow.com/a/21318941/1382869</a> for why we need +        # to check both Continuum <strong>and</strong> Anaconda +        print() +        print("Since it looks like you are using a python installation") +        print("that is managed by conda, you may want to do:") +        print() +        print("    $ conda update yt") +        print() +        print("to update your yt installation.") +        if reinstall is True: +            print() +            print("To update all of your packages, you can do:") +            print() +            print("    $ conda update --all") + +def <em>print_installation_information(path): +    import yt +    print() +    print("yt module located at:") +    print("    %s" % (path)) +    if “YT_DEST” in os.environ: +        spath = os.path.join( +            os.environ["YT_DEST"], “src”, “yt-supplemental”) +        if os.path.isdir(spath): +            print("The supplemental repositories are located at:") +            print("    %s" % (spath)) +    print() +    print("The current version of yt is:") +    print() +    print("---") +    print("Version = %s" % yt.__version_</em>) +    vstring = get_hg_version(path) +    if vstring is not None: +        print("Changeset = %s" % vstring.strip().decode("utf-8")) +    print("---") +    return vstring +</p>
<pre>class YTCommandSubtype(type):
    def __init__(cls, name, b, d):
        type.__init__(cls, name, b, d)</pre>
<p>@@ -334,6 +377,13 @@</p>
<pre>def _update_yt_stack(path):
    "Rerun the install script to updated all dependencies."
</pre>
<p>+    if “YT_DEST” not in os.environ: +        print() +        print("This yt installation does not appear to be managed by the") +        print("source-based install script, but ‘update --all’ was specified.") +        print("You will need to update your dependencies manually.") +        return +</p>
<pre>install_script = os.path.join(path, "doc/install_script.sh")
if not os.path.exists(install_script):
    print()</pre>
<p>@@ -361,19 +411,6 @@</p>
<pre>        print("The yt stack has been updated successfully.")
        print("Now get back to work!")
</pre>
<p>-def get_yt_version():</p>
<ul><li><p>try:</p></li>
<li><p>from yt.__hg_version__ import hg_version</p></li>
<li><p>return hg_version</p></li>
<li><p>except ImportError:</p></li>
<li><p>pass</p></li>
<li><p>import pkg_resources</p></li>
<li><p>yt_provider = pkg_resources.get_provider("yt")</p></li>
<li><p>path = os.path.dirname(yt_provider.module_path)</p></li>
<li><p>if not os.path.isdir(os.path.join(path, ".hg")): return None</p></li>
<li><p>version = get_hg_version(path)</p></li>
<li><p>return version</p></li></ul>
<p>–</p>
<pre># This code snippet is modified from Georg Brandl
def bb_apicall(endpoint, data, use_pass = True):
    uri = 'https://api.bitbucket.org/1.0/%s/' % endpoint</pre>
<p>@@ -605,43 +642,17 @@</p>
<pre>def __call__(self, opts):
    import pkg_resources</pre>
<ul><li><p>import yt yt_provider = pkg_resources.get_provider("yt") path = os.path.dirname(yt_provider.module_path)</p></li>
<li><p>print()</p></li>
<li><p>print("yt module located at:")</p></li>
<li><p>print("    %s" % (path))</p></li>
<li><p>if “YT_DEST” in os.environ:</p></li>
<li><p>spath = os.path.join(</p></li>
<li><p>os.environ["YT_DEST"], “src”, “yt-supplemental”)</p></li>
<li><p>if os.path.isdir(spath):</p></li>
<li><p>print("The supplemental repositories are located at:")</p></li>
<li><p>print("    %s" % (spath))</p></li>
<li><p>vstring = get_yt_version()</p></li>
<li><p>if vstring == -1:</p></li>
<li><p>vstring = “unknown”</p></li></ul>
<p>+        vstring = _print_installation_information(path)</p>
<pre>if vstring is not None:</pre>
<ul><li><p>print()</p></li>
<li><p>print("The current version and changeset for the code is:")</p></li>
<li><p>print()</p></li>
<li><p>print("---")</p></li>
<li><p>print("Version = %s" % yt.__version__)</p></li>
<li><p>print("Changeset = %s" % vstring.strip().decode("utf-8"))</p></li>
<li><p>print("---")</p></li>
<li><p>print()</p></li>
<li><p>if “site-packages” not in path:</p></li>
<li><p>print("This installation CAN be automatically updated.")</p></li>
<li><p>if opts.update_source:</p></li>
<li><p>update_hg(path)</p></li>
<li><p>print("Updated successfully.")</p></li></ul>
<p>+            print("This installation CAN be automatically updated.") +            if opts.update_source: +                update_hg(path) +                print("Updated successfully.")</p>
<pre>_get_yt_stack_date()
         elif opts.update_source:</pre>
<ul><li><p>print()</p></li>
<li><p>print("YT site-packages not in path, so you must")</p></li>
<li><p>print("update this installation manually by committing and")</p></li>
<li><p>print("merging your modifications to the code before")</p></li>
<li><p>print("updating to the newest changeset.")</p></li>
<li><p>print()</p></li></ul>
<p>+            _print_failed_source_update()</p>
<pre>        if vstring is not None and opts.outputfile is not None:
            open(opts.outputfile, "w").write(vstring)
</pre>
<p>@@ -1024,28 +1035,10 @@</p>
<pre>def __call__(self, opts):
    import pkg_resources</pre>
<ul><li><p>import yt yt_provider = pkg_resources.get_provider("yt") path = os.path.dirname(yt_provider.module_path)</p></li>
<li><p>print()</p></li>
<li><p>print("yt module located at:")</p></li>
<li><p>print("    %s" % (path))</p></li>
<li><p>if “YT_DEST” in os.environ:</p></li>
<li><p>spath = os.path.join(</p></li>
<li><p>os.environ["YT_DEST"], “src”, “yt-supplemental”)</p></li>
<li><p>if os.path.isdir(spath):</p></li>
<li><p>print("The supplemental repositories are located at:")</p></li>
<li><p>print("    %s" % (spath))</p></li>
<li><p>vstring = None</p></li>
<li><p>if “site-packages” not in path:</p></li>
<li><p>vstring = get_hg_version(path)</p></li>
<li><p>print()</p></li>
<li><p>print("The current version and changeset for the code is:")</p></li>
<li><p>print()</p></li>
<li><p>print("---")</p></li>
<li><p>print("Version = %s" % yt.__version__)</p></li>
<li><p>print("Changeset = %s" % vstring.strip().decode("utf-8"))</p></li>
<li><p>print("---")</p></li></ul>
<p>+        vstring = _print_installation_information(path) +        if vstring is not None:</p>
<pre>print()
print("This installation CAN be automatically updated.")
update_hg(path, skip_rebuild=opts.reinstall)</pre>
<p>@@ -1054,12 +1047,7 @@</p>
<pre>if opts.reinstall:
    _update_yt_stack(path)
         else:</pre>
<ul><li><p>print()</p></li>
<li><p>print("YT site-packages not in path, so you must")</p></li>
<li><p>print("update this installation manually by committing and")</p></li>
<li><p>print("merging your modifications to the code before")</p></li>
<li><p>print("updating to the newest changeset.")</p></li>
<li><p>print()</p></li></ul>
<p>+            _print_failed_source_update(opts.reinstall)</p>
<pre>class YTUploadImageCmd(YTCommand):
    args = (dict(short="file", type=str),)</pre>
<p>Repository URL: <a href="https://bitbucket.org/yt_analysis/yt/">https://bitbucket.org/yt_analysis/yt/</a></p>
<p>—</p>
<p>This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.</p>

<img src="http://link.bitbucket.org/wf/open?upn=ll4ctv0L-2ByeRZFC1LslHcg6aJmnQ70VruLbmeLQr27A1u37klYi0qm4vvKHkwuvFmCE7OMP95Eq9E9UyrTwRNbhFZoar-2Bl55EMVugX4ZrIh1bBbGOCjPP9iJ31vGcL-2FJHchv5eUE9qz5uRY3pdnt7JEn9X9IL4XEzrLkSn-2BJp9BHwQGNokfmTw4qhCPqhkeWtOWZHIjstCQIoaMj8GDoa4ZJj9r-2FbHEhDhB-2Bdk1M0no-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body></html>