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

Issue:
manpage documentation is missing all subcommands
Initially reported in Arch Linux as: https://bugs.archlinux.org/task/63223

To reproduce:
```
git clone https://github.com/pypa/pip/
cd pip/docs
PYTHONPATH=$PWD/../src/ sphinx-build -W -b man -d build/doctrees/man man build/man -c html
```

Look in build/man and you will see only one manpage: pip.1

Really quick reproducer: look at a recent Travis CI build for the TOXENV=docs results, for example https://travis-ci.org/pypa/pip/jobs/559973823#L388, and see only one file being written out.

Expectation: There should be lots of manpages, one for each pip subcommand, and linux distro packages which install the docs/build/man/ directory to /usr/share/man/man1/ should be able to read all about pip's many excellent features in their offline documentation reader.

The cause of this breakage is https://github.com/pypa/pip/pull/5724, which reorganized the conf.py layout due to https://github.com/readthedocs/readthedocs.org/issues/1543 but did not adapt the somewhat hacky code to automatically add new entries.


Discussion:

Resolving patch:
diff --git a/docs/html/conf.py b/docs/html/conf.py
--- a/docs/html/conf.py
+++ b/docs/html/conf.py
@@ -275,9 +275,13 @@
 
 # Here, we crawl the entire man/commands/ directory and list every file with
 # appropriate name and details
-for fname in glob.glob('man/commands/*.rst'):
-    fname_base = fname[4:-4]
-    outname = 'pip-' + fname_base[13:]
+man_dir = os.path.join(docs_dir, 'man/')
+raw_subcommands = glob.glob(os.path.join(man_dir, 'commands/*.rst'))
+if not raw_subcommands:
+    raise FileNotFoundError('The individual subcommand manpages could not be found!')
+for fname in raw_subcommands:
+    fname_base = fname[len(man_dir):-4]
+    outname = 'pip-' + fname_base[9:]
     description = u'description of {} command'.format(
         outname.replace('-', ' ')
     )


Test patch:
Repository: pypa/pip

Issue:
Improve Python 2 deprecation message
The error message that pip prints when run on Python 2.7 is not very informative about what timeline pip would use before dropping support or how it might approach it. 

Context: https://discuss.python.org/t/packaging-and-python-2/662/5?u=pradyunsg and #6231



Discussion:
Adding to 19.2 since it is probably the best timed release for a better deprecation message, we've decided how we're going to handle post-core-developer-support and well, because I really want us to have clear messaging for deprecation as early as possible.

 

Resolving patch:
diff --git a/src/pip/_internal/cli/base_command.py b/src/pip/_internal/cli/base_command.py
--- a/src/pip/_internal/cli/base_command.py
+++ b/src/pip/_internal/cli/base_command.py
@@ -154,7 +154,9 @@ def main(self, args):
 
         if sys.version_info[:2] == (2, 7):
             message = (
-                "A future version of pip will drop support for Python 2.7."
+                "A future version of pip will drop support for Python 2.7. "
+                "More details about Python 2 support in pip, can be found at "
+                "https://pip.pypa.io/en/latest/development/release-process/#python-2-support"  # noqa
             )
             if platform.python_implementation() == "CPython":
                 message = (


Test patch:
Repository: pypa/pip

Issue:
Add docs for new pip debug command
This is a follow-up issue to PR #6638 to add docs for the new `pip debug` command. As @xavfernandez said in [this comment](https://github.com/pypa/pip/pull/6638#pullrequestreview-256090004):

> It would also need basic documentation (at least a `docs/html/reference/pip_debug.rst`) and most importantly (IMHO), strongly emphasize that the output and the options of this command are provisional and might change without notice.





Discussion:
I think we should print a warning on every run of pip debug -- something along the lines of:

```
NOTE: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
```


Resolving patch:
diff --git a/src/pip/_internal/commands/debug.py b/src/pip/_internal/commands/debug.py
--- a/src/pip/_internal/commands/debug.py
+++ b/src/pip/_internal/commands/debug.py
@@ -91,6 +91,12 @@ def __init__(self, *args, **kw):
 
     def run(self, options, args):
         # type: (Values, List[Any]) -> int
+        logger.warning(
+            "This command is only meant for debugging. "
+            "Do not use this with automation for parsing and getting these "
+            "details, since the output and options of this command may "
+            "change without notice."
+        )
         show_value('pip version', get_pip_version())
         show_value('sys.version', sys.version)
         show_value('sys.executable', sys.executable)


Test patch:
diff --git a/tests/functional/test_debug.py b/tests/functional/test_debug.py
--- a/tests/functional/test_debug.py
+++ b/tests/functional/test_debug.py
@@ -15,7 +15,7 @@ def test_debug(script, args):
     Check simple option cases.
     """
     args = ['debug'] + args
-    result = script.pip(*args)
+    result = script.pip(*args, allow_stderr_warning=True)
     stdout = result.stdout
 
     assert 'sys.executable: ' in stdout
@@ -43,7 +43,7 @@ def test_debug__target_options(script, args, expected):
     Check passing target-related options.
     """
     args = ['debug'] + args
-    result = script.pip(*args)
+    result = script.pip(*args, allow_stderr_warning=True)
     stdout = result.stdout
 
     assert 'Compatible tags: ' in stdout
Repository: pypa/pip

Issue:
debug log is contradictory
* Pip version:
pip==9.0.1
wheel==0.29.0
setuptools==36.0.1

* Python version: 2.7.12
* Operating system: Ubuntu 16.04.2 LTS x64

### Description:

`ve/bin/pip install --upgrade -vvv zope.container==4.1.0`

tells:

```
...
    Found link https://pypi.python.org/packages/fb/5a/65bad0635e73981047c156ea3987298521da3b722ea708426e8a6fc8fddc/zope.container-4.1.0-cp27-cp27mu-manylinux1_x86_64.whl#md5=73593c9ed3f425757888d20cb406e2f3 (from https://pypi.python.org/simple/zope-container/), version: 4.1.0
  Using version 4.1.0 (newest of versions: 4.1.0)
  Looking up "https://pypi.python.org/packages/fb/5a/65bad0635e73981047c156ea3987298521da3b722ea708426e8a6fc8fddc/zope.container-4.1.0-cp27-cp27mu-manylinux1_x86_64.whl" in the cache
  Current age based on date: 13050
  Freshness lifetime from max-age: 31557600
  The response is "fresh", returning cached response
  31557600 > 13050
  Using cached zope.container-4.1.0-cp27-cp27mu-manylinux1_x86_64.whl
  Downloading from URL https://pypi.python.org/packages/fb/5a/65bad0635e73981047c156ea3987298521da3b722ea708426e8a6fc8fddc/zope.container-4.1.0-cp27-cp27mu-manylinux1_x86_64.whl#md5=73593c9ed3f425757888d20cb406e2f3 (from https://pypi.python.org/simple/zope-container/)

```

So what did it install? not the cached version


Discussion:
Thanks a lot for filing this issue! This is something I too spotted yesterday. :)

I'll take a look at this as soon as possible!
This still happens with the latest pip.

This should require changes around [here](https://github.com/pypa/pip/blob/d764181da3a048ff2dbf8087c36d61fb4ac1c6bb/src/pip/_internal/download.py#L1006) (just removing that statement should be OK, IMO) and updating any tests that depend on the behavior.
Yep! Just remove that line.

Resolving patch:
diff --git a/src/pip/_internal/download.py b/src/pip/_internal/download.py
--- a/src/pip/_internal/download.py
+++ b/src/pip/_internal/download.py
@@ -1003,8 +1003,6 @@ def written_chunks(chunks):
     else:
         logger.info("Downloading %s", url)
 
-    logger.debug('Downloading from URL %s', link)
-
     downloaded_chunks = written_chunks(
         progress_indicator(
             resp_read(CONTENT_CHUNK_SIZE),


Test patch:
Repository: pypa/pip

Issue:
Check news fragments to confirm they are valid ReST
It's very easy for people writing a PR to use Markdown for the news fragments, without thinking (in particular using single \` characters rather than double for code). Because the news file is generated on release, this isn't picked up by the doc build checks.

We should add a test that checks news fragments are valid ReST.


Discussion:
This'll need to happen over at pypa/browntruck. I feel you should probably file an issue there for this.
I was thinking more of adding a test that just ran `news/*` through some sort of ReST checker. Or even add such a test to the `docs` tox step.

But I guess browntruck might be another approach - I've never looked at how that works.
Sorry for the tone of the last comment. I was just very sure this should be a browntruck thing. This could just be a part of the news check to be honest.

Ideally, we should get that browntruck repo renamed to pypa-bot or something and document that a little more nicely. :P

The approaches you suggest also make sense but I do feel the CI check also checking this would be cleaner.

Here's the relavent class: https://github.com/pypa/browntruck/blob/twisted/browntruck/hooks/news.py#L46
One benefit of having it be part of the test suite rather than part of browntruck, is that contributors can run the verification locally instead of having to push to the branch and trigger a full test suite run to see if they've fixed the errors.
Consider me convinced to add this to the test suite. :)

(on mobile, sorry for terseness)

Resolving patch:
diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -1,6 +1,7 @@
 """Release time helpers, executed using nox.
 """
 
+import glob
 import io
 import subprocess
 
@@ -30,6 +31,18 @@ def get_author_list():
     return sorted(authors, key=lambda x: x.lower())
 
 
+# -----------------------------------------------------------------------------
+# Ad-hoc commands
+# -----------------------------------------------------------------------------
+@nox.session
+def validate_news(session):
+    session.install("rstcheck")
+
+    news_files = sorted(glob.glob("news/*"))
+
+    session.run("rstcheck", *news_files)
+
+
 # -----------------------------------------------------------------------------
 # Commands used during the release process
 # -----------------------------------------------------------------------------


Test patch:
Repository: pypa/pip

Issue:
Add a documentation string to pip._internal.network.auth
Follow up to #7045


Discussion:

Resolving patch:
diff --git a/src/pip/_internal/network/__init__.py b/src/pip/_internal/network/__init__.py
--- a/src/pip/_internal/network/__init__.py
+++ b/src/pip/_internal/network/__init__.py
@@ -0,0 +1,2 @@
+"""Contains purely network-related utilities.
+"""
diff --git a/src/pip/_internal/network/auth.py b/src/pip/_internal/network/auth.py
--- a/src/pip/_internal/network/auth.py
+++ b/src/pip/_internal/network/auth.py
@@ -1,3 +1,9 @@
+"""Network Authentication Helpers
+
+Contains interface (MultiDomainBasicAuth) and associated glue code for
+providing credentials in the context of network requests.
+"""
+
 import logging
 
 from pip._vendor.requests.auth import AuthBase, HTTPBasicAuth


Test patch:
Repository: pypa/pip

Issue:
List of supported URL schemes for Mercurial incomplete
* Pip version: 9.0.1
* Python version: 3.6
* Operating system: Linux

### Description:

I went to the documentation here:

https://pip.pypa.io/en/latest/reference/pip_install/#vcs-support

And hg+file was not listed as a supported URL scheme. I ran pip install with that URL scheme anyway, and it worked fine. The documentation was missing it.

### What I've run:

pip install --prefix="$PWD/venv" -e hg+file:///someplace/on/my/system/curio#egg=curio
Obtaining curio from hg+file:///someplace/on/my/system/curio#egg=curio
  Updating ./venv/src/curio clone
Installing collected packages: curio
  Running setup.py develop for curio
Successfully installed curio


Discussion:
From [pip mercurial source code](https://github.com/pypa/pip/blob/master/pip/vcs/mercurial.py), I think that hg+file scheme is not supported, so the parser applied the "hg" schema solely.

```
class Mercurial(VersionControl):
    name = 'hg'
    dirname = '.hg'
    repo_name = 'clone'
    schemes = ('hg', 'hg+http', 'hg+https', 'hg+ssh', 'hg+static-http')
```

Hope that helps

Resolving patch:
diff --git a/src/pip/_internal/vcs/mercurial.py b/src/pip/_internal/vcs/mercurial.py
--- a/src/pip/_internal/vcs/mercurial.py
+++ b/src/pip/_internal/vcs/mercurial.py
@@ -22,7 +22,9 @@ class Mercurial(VersionControl):
     name = 'hg'
     dirname = '.hg'
     repo_name = 'clone'
-    schemes = ('hg', 'hg+http', 'hg+https', 'hg+ssh', 'hg+static-http')
+    schemes = (
+        'hg', 'hg+file', 'hg+http', 'hg+https', 'hg+ssh', 'hg+static-http',
+    )
 
     @staticmethod
     def get_base_rev_args(rev):


Test patch:
diff --git a/tests/functional/test_install.py b/tests/functional/test_install.py
--- a/tests/functional/test_install.py
+++ b/tests/functional/test_install.py
@@ -334,9 +334,11 @@ def test_install_editable_uninstalls_existing_from_path(script, data):
 
 @need_mercurial
 def test_basic_install_editable_from_hg(script, tmpdir):
-    """Test cloning from Mercurial."""
+    """Test cloning and hg+file install from Mercurial."""
     pkg_path = _create_test_package(script, name='testpackage', vcs='hg')
-    args = ['install', '-e', 'hg+%s#egg=testpackage' % path_to_url(pkg_path)]
+    url = 'hg+{}#egg=testpackage'.format(path_to_url(pkg_path))
+    assert url.startswith('hg+file')
+    args = ['install', '-e', url]
     result = script.pip(*args)
     result.assert_installed('testpackage', with_files=['.hg'])
 
diff --git a/tests/unit/test_link.py b/tests/unit/test_link.py
--- a/tests/unit/test_link.py
+++ b/tests/unit/test_link.py
@@ -131,6 +131,7 @@ def test_is_hash_allowed__none_hashes(self, hashes, expected):
     @pytest.mark.parametrize('url, expected', [
         ('git+https://github.com/org/repo', True),
         ('bzr+http://bzr.myproject.org/MyProject/trunk/#egg=MyProject', True),
+        ('hg+file://hg.company.com/repo', True),
         ('https://example.com/some.whl', False),
         ('file://home/foo/some.whl', False),
     ])
Repository: pypa/pip

Issue:
Remove DependencyWarning warning filter from pip._internal
**What's the problem this feature will solve?**

Currently we have imports in `pip._internal.__init__`, but if we ever want to be really fast we need to get rid of those!

**Describe the solution you'd like**

Remove the `warnings.filterwarnings` call in `pip._internal` [here](https://github.com/pypa/pip/blob/3b7d2eee5ed640f53aa7192d70313df953410fa6/src/pip/_internal/__init__.py#L20).

This duplicates work already done in `pip._vendor.requests` [here](https://github.com/pypa/pip/blob/3b7d2eee5ed640f53aa7192d70313df953410fa6/src/pip/_vendor/requests/__init__.py#L107-L108).

`pip._vendor.urlllib3.compat.socks` (which raises the exception) is only ever imported in `pip._vendor.requests.adapters`, so the warning filter in `pip._vendor.requests` will always apply.

----

This issue is a good starting point for anyone who wants to help out with pip's development -- it's simple and the process of fixing this should be a good introduction to pip's development workflow.


Discussion:

Resolving patch:
diff --git a/src/pip/_internal/__init__.py b/src/pip/_internal/__init__.py
--- a/src/pip/_internal/__init__.py
+++ b/src/pip/_internal/__init__.py
@@ -5,16 +5,9 @@
 
 # We ignore certain warnings from urllib3, since they are not relevant to pip's
 # usecases.
-from pip._vendor.urllib3.exceptions import (
-    DependencyWarning,
-    InsecureRequestWarning,
-)
+from pip._vendor.urllib3.exceptions import InsecureRequestWarning
 
 import pip._internal.utils.inject_securetransport  # noqa
 
 # Raised when using --trusted-host.
 warnings.filterwarnings("ignore", category=InsecureRequestWarning)
-# Raised since socks support depends on PySocks, which may not be installed.
-#   Barry Warsaw noted (on 2016-06-17) that this should be done before
-#   importing pip.vcs, which has since moved to pip._internal.vcs.
-warnings.filterwarnings("ignore", category=DependencyWarning)


Test patch:
Repository: pypa/pip

Issue:
In the documentation the links for the pip commands index options are mixed up
In the documentation the links for the pip commands index options are mixed up.

For example in the ["Requirements File Format" of the _pip install_ chapter](https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format) some of the links for the supported options point to the _pip wheel_ chapter.


Discussion:

Resolving patch:
diff --git a/docs/pip_sphinxext.py b/docs/pip_sphinxext.py
--- a/docs/pip_sphinxext.py
+++ b/docs/pip_sphinxext.py
@@ -86,9 +86,13 @@ def process_options(self):
 
 
 class PipIndexOptions(PipOptions):
+    required_arguments = 1
+
     def process_options(self):
+        cmd_name = self.arguments[0]
         self._format_options(
-            [o() for o in cmdoptions.index_group['options']]
+            [o() for o in cmdoptions.index_group['options']],
+            cmd_name=cmd_name,
         )
 
 


Test patch:
Repository: pypa/pip

Issue:
Broken "copyright" link in docs footer
Every doc page has a "copyright" link which is 404. This is because this link is [hard-coded into the python-docs-theme](https://github.com/python/python-docs-theme/blob/788b53d188d4e7d4ed9d63bcdb3ccec23027884d/python_docs_theme/layout.html#L48), but the page doesn't exist here.

Not sure if this should be fixed here or there.


Discussion:
We'd want to add a `docs/html/copyright.rst` file with the following contents:

```rst
=========
Copyright
=========

pip and this documentation is:

Copyright © 2008-2020 The pip developers (see `AUTHORS.txt <https://github.com/pypa/pip/blob/master/AUTHORS.txt>`_ file). All rights reserved.
```


Resolving patch:
diff --git a/docs/html/conf.py b/docs/html/conf.py
--- a/docs/html/conf.py
+++ b/docs/html/conf.py
@@ -54,7 +54,7 @@
 
 # General information about the project.
 project = 'pip'
-copyright = '2008-2017, PyPA'
+copyright = '2008-2020, PyPA'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the


Test patch:
Repository: pypa/pip

Issue:
Remove emails from AUTHORS.txt
This came up in #4891.

Currently, that file can be used to farm emails for spamming. It can still be done with the git repository but it's an step more to get them compared to a text file.

Filing this for discussion.


Discussion:
I think it's fine to do so. The original AUTHORS file didn't have emails in them, I switched it to have emails at some point (https://github.com/pypa/pip/pull/1594), though I don't really remember why I did.
pull request submitted

Link to PR: https://github.com/pypa/pip/pull/6046 (currently needs rebase) 
Hi @pradyunsg 

Can I file a new PR for this? Seems like an old PR was filed https://github.com/pypa/pip/pull/6046 but was never merged. I can take the changes for it and create a new one, if there is still scope to fix it?
@deveshks Go head 👍 
Hi @uranusjr ,

Thank you. I will submit a PR for this. Another question, is there a place in one of the `.rst` files where I can put a guideline on how to update AUTHORS.txt, and document that only names should be added in AUTHORS.txt in future

Resolving patch:
diff --git a/tools/automation/release/__init__.py b/tools/automation/release/__init__.py
--- a/tools/automation/release/__init__.py
+++ b/tools/automation/release/__init__.py
@@ -49,8 +49,9 @@ def get_author_list() -> List[str]:
     """Get the list of authors from Git commits.
     """
     # subprocess because session.run doesn't give us stdout
+    # only use names in list of Authors
     result = subprocess.run(
-        ["git", "log", "--use-mailmap", "--format=%aN <%aE>"],
+        ["git", "log", "--use-mailmap", "--format=%aN"],
         capture_output=True,
         encoding="utf-8",
     )


Test patch:
Repository: pypa/pip

Issue:
Description section of pip config is ill-formatted 
The section of docs for [pip config Description](https://pip.pypa.io/en/latest/reference/pip_config/#description) is not well formatted. There is supposed to be a sublist under the subcommands section and rendered as per

https://github.com/pypa/pip/blob/9a91f451cf89d8e16493e603c37a5c8f450200c0/src/pip/_internal/commands/configuration.py#L21-L36

But in the docs, all the options end up in a single paragraph

<img width="819" alt="Screenshot 2020-04-18 at 12 59 40 AM" src="https://user-images.githubusercontent.com/13155849/79606795-c7838800-810f-11ea-92ce-5872eaa982aa.png">



Discussion:

Resolving patch:
diff --git a/src/pip/_internal/commands/configuration.py b/src/pip/_internal/commands/configuration.py
--- a/src/pip/_internal/commands/configuration.py
+++ b/src/pip/_internal/commands/configuration.py
@@ -19,15 +19,16 @@
 
 
 class ConfigurationCommand(Command):
-    """Manage local and global configuration.
+    """
+    Manage local and global configuration.
 
     Subcommands:
 
-        list: List the active configuration (or from the file specified)
-        edit: Edit the configuration file in an editor
-        get: Get the value associated with name
-        set: Set the name=value
-        unset: Unset the value associated with name
+    - list: List the active configuration (or from the file specified)
+    - edit: Edit the configuration file in an editor
+    - get: Get the value associated with name
+    - set: Set the name=value
+    - unset: Unset the value associated with name
 
     If none of --user, --global and --site are passed, a virtual
     environment configuration file is used if one is active and the file


Test patch: