internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: conda/conda

Issue:
Outdated conda notification does not respect `-q` arg
The notify_outdated_conda warning checks only `if context.notify_outdated_conda`, but I think it should check `if context.notify_outdated_conda and not context.quiet`. If I specify the `-q` flag, I don't want to see this warning.
Outdated conda notification does not respect `-q` arg
The notify_outdated_conda warning checks only `if context.notify_outdated_conda`, but I think it should check `if context.notify_outdated_conda and not context.quiet`. If I specify the `-q` flag, I don't want to see this warning.


Discussion:
Seems reasonable to me.
I am a beginner and would like to work on this issue. Can i take it up and be guided along?

Yup. Go for it.  Just change

    if context.notify_outdated_conda:

to

    if context.notify_outdated_conda and not context.quiet:

and submit a PR
Seems reasonable to me.
I am a beginner and would like to work on this issue. Can i take it up and be guided along?

Yup. Go for it.  Just change

    if context.notify_outdated_conda:

to

    if context.notify_outdated_conda and not context.quiet:

and submit a PR

Resolving patch:
diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -508,7 +508,7 @@ def solve_for_transaction(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NU
                 # TODO: Only explicitly requested remove and update specs are being included in
                 #   History right now. Do we need to include other categories from the solve?
 
-        if context.notify_outdated_conda:
+        if context.notify_outdated_conda and not context.quiet:
             conda_newer_spec = MatchSpec('conda >%s' % CONDA_VERSION)
             if not any(conda_newer_spec.match(prec) for prec in link_precs):
                 conda_newer_records = sorted(


Test patch:
Repository: conda/conda

Issue:
In conda 4.3, look at basename usage in core/package_cache.py
Probably need to memoize something a level or two up from the basename call.


Discussion:

Resolving patch:
diff --git a/conda/core/package_cache_data.py b/conda/core/package_cache_data.py
--- a/conda/core/package_cache_data.py
+++ b/conda/core/package_cache_data.py
@@ -8,6 +8,8 @@
 from os.path import basename, dirname, join
 from tarfile import ReadError
 
+from conda._vendor.auxlib.decorators import memoizemethod
+
 from .path_actions import CacheUrlAction, ExtractPackageAction
 from .. import CondaError, CondaMultiError, conda_signal_handler
 from .._vendor.auxlib.collection import first
@@ -349,7 +351,7 @@ def _make_single_record(self, package_filename):
             else:
                 md5 = None
 
-            url = first(self._urls_data, lambda x: basename(x) == package_filename)
+            url = self._urls_data.get_url(package_filename)
             package_cache_record = PackageCacheRecord.from_objects(
                 index_json_record,
                 url=url,
@@ -417,6 +419,7 @@ def add_url(self, url):
             fh.write(url + '\n')
         self._urls_data.insert(0, url)
 
+    @memoizemethod
     def get_url(self, package_path):
         # package path can be a full path or just a basename
         #   can be either an extracted directory or tarball


Test patch:
Repository: conda/conda

Issue:
Add anaconda.org search message to PackagesNotFoundError



Discussion:

Resolving patch:
diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -462,6 +462,13 @@ def __init__(self, packages, channel_urls=()):
             Current channels:
 
             %(channels_formatted)s
+
+            To search for alternate channels that may provide the conda package you're
+            looking for, navigate to
+
+                https://anaconda.org
+
+            and use the search bar at the top of the page.
             """)
             packages_formatted = format_list(packages)
             channels_formatted = format_list(channel_urls)


Test patch:
Repository: conda/conda

Issue:
Add deprecation warnings for conda 4.6
deprecated modules:

*  `conda.cli.activate`
* `conda.compat`
* `conda.install`



Discussion:

Resolving patch:
diff --git a/conda/cli/activate.py b/conda/cli/activate.py
--- a/conda/cli/activate.py
+++ b/conda/cli/activate.py
@@ -218,5 +218,9 @@ def main():
     print(path)
 
 
+print("WARNING: The conda.cli.activate module is deprecated and will be removed in a "
+      "future release.", file=sys.stderr)
+
+
 if __name__ == '__main__':
     main()
diff --git a/conda/compat.py b/conda/compat.py
--- a/conda/compat.py
+++ b/conda/compat.py
@@ -65,3 +65,7 @@ def __exit__(self, exc, value, tb):
     def __del__(self):
         # Issue a ResourceWarning if implicit cleanup needed
         self.cleanup(_warn=True)
+
+
+print("WARNING: The conda.compat module is deprecated and will be removed in a future release.",
+      file=sys.stderr)
diff --git a/conda/install.py b/conda/install.py
--- a/conda/install.py
+++ b/conda/install.py
@@ -24,6 +24,7 @@
 import os
 from os import chmod, makedirs, stat
 from os.path import dirname, isdir, isfile, join, normcase, normpath
+import sys
 
 from .base.constants import PREFIX_PLACEHOLDER
 from .common.compat import on_win, open
@@ -137,3 +138,7 @@ def symlink_conda_hlp(prefix, root_dir, where, symlink_fn):  # pragma: no cover
                           "another concurrent process." .format(root_file, prefix_file))
             else:
                 raise
+
+
+print("WARNING: The conda.install module is deprecated and will be removed in a future release.",
+      file=sys.stderr)


Test patch:
Repository: conda/conda

Issue:
Channel pins in "environment.yaml" files are not saved to package specs
Channel pins specified in environment files are not respected.  For example,run ```conda env create``` with this environment file:

```yaml
name: channel-not-written-to-user-specs

dependencies:
  - defaults::six
```

If we look at conda-meta/six*.json we can see that the channel pin has not been added to specs. Where we should read ```"requested_spec": "defaults::six"```, we only find ```"requested_spec": "six"```.

This is with conda 4.4.0rc2.


Discussion:
@kalefranz This keeps being problematic for us. At the moment, I workaround it by avoiding calling ```conda env create``` at all. Instead I parse the yaml file myself and call ```conda install``` - it is a very simple piece of code.

I think a similar approach could be used in the conda-env installer: remove most of that code and make it a very thin wrapper around conda create/install. Would that be the best approach to solve this and other future problem with conda-env not keeping up with changes? Perhaps I do not understand well and there is a reason why this code duplication needs to happen.

Resolving patch:
diff --git a/conda_env/installers/conda.py b/conda_env/installers/conda.py
--- a/conda_env/installers/conda.py
+++ b/conda_env/installers/conda.py
@@ -11,19 +11,8 @@
 def install(prefix, specs, args, env, *_, **kwargs):
     # TODO: support all various ways this happens
     # Including 'nodefaults' in the channels list disables the defaults
-    new_specs = []
-    channel_urls = set()
-    for elem in specs:
-        if "::" in elem:
-            channel_urls.add(elem.split("::")[0])
-            new_specs.append(elem.split("::")[-1])
-        else:
-            new_specs.append(elem)
-    specs = new_specs
-    channel_urls = list(channel_urls)
-    # TODO: support all various ways this happens
-    # Including 'nodefaults' in the channels list disables the defaults
-    channel_urls = channel_urls + [chan for chan in env.channels if chan != 'nodefaults']
+    channel_urls = [chan for chan in env.channels if chan != 'nodefaults']
+
     if 'nodefaults' not in env.channels:
         channel_urls.extend(context.channels)
     _channel_priority_map = prioritize_channels(channel_urls)


Test patch:
Repository: conda/conda

Issue:
Progress bar changes/issues
In `conda` 4.3+ the progress bar looks something like this...

```
pycrypto-2.6.1 100% |################################| Time: 0:00:00   6.79 MB/s
pytz-2018.4-py 100% |################################| Time: 0:00:00   9.22 MB/s
```

...it has a nice tabular view and separates out package name, percentage, time, and download speed. 

In `conda` 4.5+, the progress bar looks like this...

```
ndg-httpsclient 0.4.4################################################### | 100% 
libffi 3.2.1############################################################ | 100%
```

Here the progress bar starts right near where the version ends. Making it a little hard to read. Also this start point varies depending on package name and the like, which is a bit distracting.

Now I'm not sure if this is an intentional change or if I'm running into a bug. Would be great to know either way. If it is an intentional change, would encourage reconsidering.


Discussion:
I agree that the UI here could be improved.
Do you know what caused the shift?

Resolving patch:
diff --git a/conda/core/package_cache_data.py b/conda/core/package_cache_data.py
--- a/conda/core/package_cache_data.py
+++ b/conda/core/package_cache_data.py
@@ -31,6 +31,7 @@
 from ..models.dist import Dist
 from ..models.match_spec import MatchSpec
 from ..models.records import PackageCacheRecord, PackageRecord, PackageRef
+from ..utils import human_bytes
 
 try:
     from cytoolz.itertoolz import concat, concatv, groupby
@@ -625,7 +626,12 @@ def _execute_actions(prec_or_spec, actions):
         if cache_axn is None and extract_axn is None:
             return
 
-        desc = "%s %s" % (prec_or_spec.name, prec_or_spec.version)
+        desc = "%s-%s" % (prec_or_spec.name, prec_or_spec.version)
+        if len(desc) > 20:
+            desc = desc[:20]
+        size = getattr(prec_or_spec, 'size', None)
+        desc = "%-20s | %7s | " % (desc, size and human_bytes(size) or '')
+
         progress_bar = ProgressBar(desc, not context.verbosity and not context.quiet, context.json)
 
         download_total = 0.75  # fraction of progress for download; the rest goes to extract


Test patch:
Repository: conda/conda

Issue:
canary: mkdir option removed from conda create on a minor bump
On conda 4.5

```bash
$ conda create -n testmkdir --mkdir
```
It works

On 4.6 on canary
```bash
$ conda create -n testmkdir --mkdir
```
It fails.

Removing an option from the CLI in a minor version sounds like a no no. Could we instead deprecate (even if the option does not do anything?) 


Discussion:

Resolving patch:
diff --git a/conda/cli/conda_argparse.py b/conda/cli/conda_argparse.py
--- a/conda/cli/conda_argparse.py
+++ b/conda/cli/conda_argparse.py
@@ -529,6 +529,11 @@ def configure_parser_create(sub_parsers):
         action="store_true",
         help='Ignore create_default_packages in the .condarc file.',
     )
+    p.add_argument(
+        '-m', "--mkdir",
+        action="store_true",
+        help=SUPPRESS,
+    )
     p.set_defaults(func='.main_create.execute')
 
 


Test patch:
Repository: conda/conda

Issue:
conda's configuration context is not initialized in conda.exports
root cause of https://github.com/conda-forge/conda-smithy/issues/762


Discussion:

Resolving patch:
diff --git a/conda/exports.py b/conda/exports.py
--- a/conda/exports.py
+++ b/conda/exports.py
@@ -11,6 +11,9 @@
 from . import CondaError  # NOQA
 CondaError = CondaError
 
+from .base.context import reset_context  # NOQA
+reset_context()  # initialize context when conda.exports is imported
+
 from . import compat, plan  # NOQA
 compat, plan = compat, plan
 


Test patch:
Repository: conda/conda

Issue:
conda's configuration context is not initialized in conda.exports
root cause of https://github.com/conda-forge/conda-smithy/issues/762


Discussion:

Resolving patch:
diff --git a/conda/exports.py b/conda/exports.py
--- a/conda/exports.py
+++ b/conda/exports.py
@@ -11,6 +11,9 @@
 from . import CondaError  # NOQA
 CondaError = CondaError
 
+from .base.context import reset_context  # NOQA
+reset_context()  # initialize context when conda.exports is imported
+
 from . import compat, plan  # NOQA
 compat, plan = compat, plan
 


Test patch:
diff --git a/tests/cli/test_activate.py b/tests/cli/test_activate.py
--- a/tests/cli/test_activate.py
+++ b/tests/cli/test_activate.py
@@ -625,7 +625,7 @@ def test_activate_does_not_leak_echo_setting(shell):
         assert_equals(stdout, u'ECHO is on.', stderr)
 
 
-@pytest.mark.skipif(datetime.now() < datetime(2018, 5, 1), reason="save for later")
+@pytest.mark.skipif(True, reason="save for later")
 @pytest.mark.installed
 def test_activate_non_ascii_char_in_path(shell):
     shell_vars = _format_vars(shell)
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -566,6 +566,7 @@ def test_create_empty_env(self):
             assert stderr == ''
             self.assertIsInstance(stdout, str)
 
+    @pytest.mark.skipif(True, reason="pip 10 dropped --egg")
     def test_list_with_pip_egg(self):
         from conda.exports import rm_rf as _rm_rf
         with make_temp_env("python=3.5 pip") as prefix:
diff --git a/tests/test_export.py b/tests/test_export.py
--- a/tests/test_export.py
+++ b/tests/test_export.py
@@ -31,7 +31,7 @@ def test_basic(self):
             output2, error= run_command(Commands.LIST, prefix2, "-e")
             self.assertEqual(output, output2)
 
-    @pytest.mark.xfail(datetime.now() < datetime(2018, 5, 1), reason="Bring back `conda list --export` #3445", strict=True)
+    @pytest.mark.skipif(True, reason="Bring back `conda list --export` #3445", strict=True)
     def test_multi_channel_export(self):
         """
             When try to import from txt
Repository: conda/conda

Issue:
Progress bar changes/issues
In `conda` 4.3+ the progress bar looks something like this...

```
pycrypto-2.6.1 100% |################################| Time: 0:00:00   6.79 MB/s
pytz-2018.4-py 100% |################################| Time: 0:00:00   9.22 MB/s
```

...it has a nice tabular view and separates out package name, percentage, time, and download speed. 

In `conda` 4.5+, the progress bar looks like this...

```
ndg-httpsclient 0.4.4################################################### | 100% 
libffi 3.2.1############################################################ | 100%
```

Here the progress bar starts right near where the version ends. Making it a little hard to read. Also this start point varies depending on package name and the like, which is a bit distracting.

Now I'm not sure if this is an intentional change or if I'm running into a bug. Would be great to know either way. If it is an intentional change, would encourage reconsidering.


Discussion:
I agree that the UI here could be improved.
Do you know what caused the shift?

Resolving patch:
diff --git a/conda/core/package_cache_data.py b/conda/core/package_cache_data.py
--- a/conda/core/package_cache_data.py
+++ b/conda/core/package_cache_data.py
@@ -32,6 +32,7 @@
 from ..models.dist import Dist
 from ..models.match_spec import MatchSpec
 from ..models.records import PackageCacheRecord, PackageRecord, PackageRef
+from ..utils import human_bytes
 
 try:
     from cytoolz.itertoolz import concat, concatv, groupby
@@ -610,7 +611,12 @@ def _execute_actions(prec_or_spec, actions):
         if cache_axn is None and extract_axn is None:
             return
 
-        desc = "%s %s" % (prec_or_spec.name, prec_or_spec.version)
+        desc = "%s-%s" % (prec_or_spec.name, prec_or_spec.version)
+        if len(desc) > 20:
+            desc = desc[:20]
+        size = getattr(prec_or_spec, 'size', None)
+        desc = "%-20s | %7s | " % (desc, size and human_bytes(size) or '')
+
         progress_bar = ProgressBar(desc, not context.verbosity and not context.quiet, context.json)
 
         download_total = 0.75  # fraction of progress for download; the rest goes to extract


Test patch:
Repository: conda/conda

Issue:
should_bypass_proxies still an issue in 4.5.7
https://github.com/conda/conda/issues/7506#issuecomment-403811279


Discussion:

Resolving patch:
diff --git a/conda/gateways/connection/__init__.py b/conda/gateways/connection/__init__.py
--- a/conda/gateways/connection/__init__.py
+++ b/conda/gateways/connection/__init__.py
@@ -2,7 +2,7 @@
 from __future__ import absolute_import, division, print_function, unicode_literals
 from functools import partial
 
-def should_bypass_proxies_patched(should_bypass_proxies_func, url, no_proxy):
+def should_bypass_proxies_patched(should_bypass_proxies_func, url, no_proxy=None):
     # Monkey patch requests, per https://github.com/requests/requests/pull/4723
     if url.startswith("file://"):
         return True


Test patch:
Repository: conda/conda

Issue:
activate and powerline don't play nice together
I am using [powerline](https://github.com/powerline/powerline) to display the current anaconda environment in my shell. However, when I use  `source active MY_ENV ` it doesn't realize that I am already using `powerline` to display the anaconda environment and it appends the current anaconda environment before my `PS1` variable. Effectively it now displays my environment twice in my shell.

One trivial workaround for this is to check whether `PS1` is modified by `powerline` before appending the current environment to it. I am happy to file a pull request, but I wanted to check how people feel about this and also if anybody else has any better ideas of how to deal with this.


Discussion:
Just be aware that #3175 happened so the activate/deactivate scripts have been completely refactored.

I do not know enough about powerline (I just learned about it) to quickly offer a solution however I suggest adding the check for powerline to the `conda ..changeps1` function and that way make no changes to any of the activate/deactivate scripts.

Resolving patch:
diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -613,6 +613,9 @@ def __init__(self, arguments=None):
 
     def _update_prompt(self, set_vars, conda_prompt_modifier):
         ps1 = self.environ.get('PS1', '')
+        if 'POWERLINE_COMMAND' in ps1:
+            # Defer to powerline (https://github.com/powerline/powerline) if it's in use.
+            return
         current_prompt_modifier = self.environ.get('CONDA_PROMPT_MODIFIER')
         if current_prompt_modifier:
             ps1 = re.sub(re.escape(current_prompt_modifier), r'', ps1)


Test patch:
Repository: conda/conda

Issue:
Move windows package cache and envs dirs back to '~/.conda' directory
In conda 4.3, we moved the default writable user location for envs_dirs and pkgs_dirs from `%USERPROFILE%\.conda` to `%USERPROFILE%\AppData\Local\conda\conda`.  The reason for the change was to move conda towards more standards compliance.

That change sometime collides with conda's concept of relocatable environments (i.e. environment root locations at any arbitrary file system path) and the standard [maximum path length restriction](https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#maximum-path-length-limitation) of 260 characters.

Consider transitioning user's package caches and new named envs directories back to `%USERPROFILE%\.conda`.  We will still need to keep knowledge of `%USERPROFILE%\AppData\Local\conda\conda`, but newly downloaded packages and newly created named envs can by default be located in `%USERPROFILE%\.conda`.


Discussion:

Resolving patch:
diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -402,15 +402,15 @@ def envs_dirs(self):
         if self.root_writable:
             fixed_dirs = (
                 join(self.root_prefix, 'envs'),
-                join(self._user_data_dir, 'envs'),
                 join('~', '.conda', 'envs'),
             )
         else:
             fixed_dirs = (
-                join(self._user_data_dir, 'envs'),
-                join(self.root_prefix, 'envs'),
                 join('~', '.conda', 'envs'),
+                join(self.root_prefix, 'envs'),
             )
+        if on_win:
+            fixed_dirs += join(user_data_dir(APP_NAME, APP_NAME), 'envs'),
         return tuple(IndexedSet(expand(p) for p in concatv(self._envs_dirs, fixed_dirs)))
 
     @property
@@ -419,10 +419,13 @@ def pkgs_dirs(self):
             return tuple(IndexedSet(expand(p) for p in self._pkgs_dirs))
         else:
             cache_dir_name = 'pkgs32' if context.force_32bit else 'pkgs'
-            return tuple(IndexedSet(expand(join(p, cache_dir_name)) for p in (
+            fixed_dirs = (
                 self.root_prefix,
-                self._user_data_dir,
-            )))
+                join('~', '.conda'),
+            )
+            if on_win:
+                fixed_dirs += user_data_dir(APP_NAME, APP_NAME),
+            return tuple(IndexedSet(expand(join(p, cache_dir_name)) for p in (fixed_dirs)))
 
     @memoizedproperty
     def trash_dir(self):
@@ -434,13 +437,6 @@ def trash_dir(self):
         mkdir_p(trash_dir)
         return trash_dir
 
-    @property
-    def _user_data_dir(self):
-        if on_win:
-            return user_data_dir(APP_NAME, APP_NAME)
-        else:
-            return expand(join('~', '.conda'))
-
     @property
     def default_prefix(self):
         if self.active_prefix:


Test patch:
Repository: conda/conda

Issue:
config appears to not pick up conda_build/matrix_base_dir in 4.6.0b1
In my .condarc:

```
conda_build:
  matrix_base_dir: ~/code/automated-build/c3i_configurations/anaconda_public
```

This is for c3i.  Somehow this isn't getting loaded properly:

```
c3i one-off py36_win python-3.6-feedstock -p "win*"
Traceback (most recent call last):
  File "/Users/msarahan/miniconda3/bin/c3i", line 11, in <module>
    load_entry_point('conda-concourse-ci', 'console_scripts', 'c3i')()
  File "/Users/msarahan/code/conda-concourse-ci/conda_concourse_ci/cli.py", line 240, in main
    execute.submit_one_off(pass_throughs=pass_throughs, **args.__dict__)
  File "/Users/msarahan/code/conda-concourse-ci/conda_concourse_ci/execute.py", line 802, in submit_one_off
    config_root_dir = os.path.expanduser(config_root_dir)
  File "/Users/msarahan/miniconda3/lib/python3.6/posixpath.py", line 235, in expanduser
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType
```

The code that loads this setting is at https://github.com/conda/conda-concourse-ci/blob/master/conda_concourse_ci/cli.py#L43


Discussion:
I isolated this to https://github.com/conda/conda/commit/1418be0fc7368ddbbfdae5994168b98f01b0c190#diff-b48dce471b4b8aed241c3b09306aa176

That commit causes the conda_build key to not be loaded at all.  I am investigating.

Resolving patch:
diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -229,7 +229,7 @@ class Context(Configuration):
     anaconda_upload = PrimitiveParameter(None, aliases=('binstar_upload',),
                                          element_type=(bool, NoneType))
     _croot = PrimitiveParameter('', aliases=('croot',))
-    _conda_build = MapParameter(string_types, aliases=('conda-build',))
+    _conda_build = MapParameter(string_types, aliases=('conda-build', 'conda_build'))
 
     def __init__(self, search_path=None, argparse_args=None):
         if search_path is None:


Test patch: