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

Issue:
README broken on PyPI (must be reStructuredText)
The [package description](https://pypi.python.org/pypi/pip-tools/) on PyPI is unreadable since PyPI expects the README in [reStructuredText](http://www.sphinx-doc.org/en/stable/rest.html) file format and we use MarkDown.

Solution A: Convert to reST
---------------------

1. Rename the current `README.md` to `README.rst`
1. Replace the markdown of the badges and the code samples ([example](https://github.com/Organice/djangocms-maps/blob/master/README.rst))
1. Add a `long_description=read_file('README.rst')` line to `setup.py` ([example](https://github.com/Organice/djangocms-maps/blob/master/setup.py#L50))

Solution B: Process before Upload
-------------------

1. Integrate [pypandoc](https://pypi.python.org/pypi/pypandoc) in `setup.py` ([example](https://github.com/jrief/djangocms-cascade/blob/master/setup.py#L7-L14))
1. Add a `long_description=convert('README.md', 'rst')` line to `setup.py` ([example](https://github.com/jrief/djangocms-cascade/blob/master/setup.py#L49))

------------

Both solutions above will render a nicely formatted, HTML-styled package description on PyPI.

Quality Assurance
--------------

Optionally, you may check your README with [checkdocs](https://github.com/Organice/djangocms-maps/blob/master/tox.ini#L13-L19) before uploading the package to PyPI, because sometimes the reST-to-HTML conversion that PyPI uses fails -- and renders a still hard-to-read, broken, unformatted package description.


Discussion:
Let me know if you want this to be fixed, and which solution you prefer. I can happily prepare a PR.
Hi @bittner, thanks for the report and suggestions.

I would suggest to go with A). Mostly because:
> Pypandoc uses pandoc, so it needs an available installation of pandoc. 

and there are no prebuilt wheels for Linux with `pandoc`, so that could be an issue with the BMs for the releases. Let's just keep the release process as simple as possible, especially in the Jazzband context :p. (But thank you for the info, I might use that in my own projects) 

Thanks again, you can submit a PR, that would be really appreciated!
https://pypi.python.org/pypi/pip-tools/1.10.2rc1
Allright, so this is a lot more readable than it used to be, hurray!
But the rendering seems to fail. I'll reopen for anyone who wants too look into this.
https://pypi.python.org/pypi/pip-tools/1.10.2rc2
Eh, still not working. I guess that's what RCs are for.

I won't block 1.10.2 for this though, but it bugs me nonetheless. 
Todo: try this out: https://github.com/pypa/warehouse/issues/2600#issuecomment-346156317

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ def read_file(filename):
     license='BSD',
     author='Vincent Driessen',
     author_email='me@nvie.com',
-    description=__doc__,
+    description=__doc__.strip(),
     long_description=read_file('README.rst'),
     packages=find_packages(exclude=['tests']),
     setup_requires=['setuptools_scm'],


Test patch:
Repository: jazzband/pip-tools

Issue:
--cert option for pip-sync
pip-sync is missing the `--cert` and `--client-cert` options, that are (somehow, see #712) implemented for pip-compile.


Discussion:

Resolving patch:
diff --git a/piptools/scripts/sync.py b/piptools/scripts/sync.py
--- a/piptools/scripts/sync.py
+++ b/piptools/scripts/sync.py
@@ -55,6 +55,12 @@
 @click.option(
     "--user", "user_only", is_flag=True, help="Restrict attention to user directory"
 )
+@click.option("--cert", help="Path to alternate CA bundle.")
+@click.option(
+    "--client-cert",
+    help="Path to SSL client certificate, a single file containing "
+    "the private key and the certificate in PEM format.",
+)
 @click.argument("src_files", required=False, type=click.Path(exists=True), nargs=-1)
 def cli(
     dry_run,
@@ -66,6 +72,8 @@ def cli(
     no_index,
     quiet,
     user_only,
+    cert,
+    client_cert,
     src_files,
 ):
     """Synchronize virtual environment with requirements.txt."""
@@ -117,6 +125,10 @@ def cli(
             install_flags.extend(["--trusted-host", host])
     if user_only:
         install_flags.append("--user")
+    if cert:
+        install_flags.extend(["--cert", cert])
+    if client_cert:
+        install_flags.extend(["--client-cert", client_cert])
 
     sys.exit(
         sync.sync(


Test patch:
diff --git a/tests/test_cli_sync.py b/tests/test_cli_sync.py
--- a/tests/test_cli_sync.py
+++ b/tests/test_cli_sync.py
@@ -129,6 +129,8 @@ def test_merge_error(runner):
             ["--extra-index-url", "https://foo", "--trusted-host", "https://bar"],
         ),
         (["--user"], ["--user"]),
+        (["--cert", "foo.crt"], ["--cert", "foo.crt"]),
+        (["--client-cert", "foo.pem"], ["--client-cert", "foo.pem"]),
     ],
 )
 @mock.patch("piptools.sync.check_call")
Repository: jazzband/pip-tools

Issue:
pip-compile replaces password in URL with ****
I am using Python 3.6.8, pip-tools 19.1 and setuptools 41.0.1 in an virtual environment.

Since some days, when i compile my requirements.in file which includes a package format with an git repo url like:

```
...
-e git+http://user:password@myhost.com/scm/path/git-repo-name.git#egg=packagename
google-api-python-client
...
```

the password string in the url is replaces with "***":

```
...
-e git+http://user:****@myhost.com/scm/path/git-repo-name.git#egg=packagename
google-api-python-client==1.7.8
...
```

Is there a way to prevent this behaviour?

Regards,
Josef






Discussion:
Hello @jhoelzl,

Thank you for the good catch! It seems the issue has been appeared since `pip>=19.0`, see https://github.com/pypa/pip/pull/5773. With the `pip==18.1` works good.

Resolving patch:
diff --git a/piptools/utils.py b/piptools/utils.py
--- a/piptools/utils.py
+++ b/piptools/utils.py
@@ -54,7 +54,7 @@ def format_requirement(ireq, marker=None, hashes=None):
     in a less verbose way than using its `__str__` method.
     """
     if ireq.editable:
-        line = "-e {}".format(ireq.link)
+        line = "-e {}".format(ireq.link.url)
     else:
         line = str(ireq.req).lower()
 


Test patch:
diff --git a/tests/test_utils.py b/tests/test_utils.py
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -19,11 +19,23 @@ def test_format_requirement(from_line):
     assert format_requirement(ireq) == "test==1.2"
 
 
-def test_format_requirement_editable(from_editable):
+def test_format_requirement_editable_vcs(from_editable):
     ireq = from_editable("git+git://fake.org/x/y.git#egg=y")
     assert format_requirement(ireq) == "-e git+git://fake.org/x/y.git#egg=y"
 
 
+def test_format_requirement_editable_vcs_with_password(from_editable):
+    ireq = from_editable("git+git://user:password@fake.org/x/y.git#egg=y")
+    assert (
+        format_requirement(ireq) == "-e git+git://user:password@fake.org/x/y.git#egg=y"
+    )
+
+
+def test_format_requirement_editable_local_path(from_editable):
+    ireq = from_editable("file:///home/user/package")
+    assert format_requirement(ireq) == "-e file:///home/user/package"
+
+
 def test_format_requirement_ireq_with_hashes(from_line):
     ireq = from_line("pytz==2017.2")
     ireq_hashes = [
Repository: jazzband/pip-tools

Issue:
Add python 3.8 support
#### What's the problem this feature will solve?
<!-- What are you trying to do, that you are unable to achieve with pip-tools as it currently stands? -->

Python 3.8 is released, so it's time to support it. 

#### Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->

1. add "py37" env to `tox.ini`
1. remove 3.8-dev from `.travis.yml`
1. add "Programming Language :: Python :: 3.8" classifier to `setup.py`
1. add "3.8" dimension to `.travis.yml` (supported, see https://travis-ci.community/t/add-python-3-8-support/5463)
1. add "py37" dimension to `.appveyor.yml` (not supported yet, but will be on the nex image update, tracking issue: https://github.com/appveyor/ci/issues/3142)
1. add "3.8" to python-version list in `.github/workflows/cron.yml` (not supported yet, tracking issue: https://github.com/actions/setup-python/issues/30)

<!-- Provide examples of real-world use cases that this would enable and how it solves the problem described above. -->

#### Alternative Solutions
<!-- Have you tried to workaround the problem using pip-tools or other tools? Or a different approach to solving this issue? Please elaborate here. -->

N/A

#### Additional context
<!-- Add any other context, links, etc. about the feature here. -->

https://discuss.python.org/t/python-3-8-0-is-now-available/2478


Discussion:
@atugushev I can work on this.
Thanks, @hramezani! Appreciate it.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -48,6 +48,7 @@ def read_file(filename):
         "Programming Language :: Python :: 3.5",
         "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: Implementation :: CPython",
         "Programming Language :: Python :: Implementation :: PyPy",
         "Topic :: System :: Systems Administration",


Test patch:
Repository: jazzband/pip-tools

Issue:
setup.py install_requires should have `"click>=7"` not `"click>=6"`
Thank you for all the work on this tool, it's very useful.

Issue:
As of 4.4.0 pip-tools now depends on version 7.0 of click, not 6.0.

The argument `show_envvar` is now being passed to `click.option()`
https://github.com/jazzband/pip-tools/compare/4.3.0...4.4.0#diff-c8673e93c598354ab4a9aa8dd090e913R183

That argument was added in click 7.0
https://click.palletsprojects.com/en/7.x/api/#click.Option
compared to 
https://click.palletsprojects.com/en/6.x/api/#click.Option

Fix: setup.py install_requires should have `"click>=7"` not `"click>=6"`


Discussion:
Hello @DeTeReR,

Thanks for the heads up! Should be easy to fix.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -26,7 +26,7 @@ def read_file(filename):
     package_data={},
     python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
     setup_requires=["setuptools_scm"],
-    install_requires=["click>=6", "six"],
+    install_requires=["click>=7", "six"],
     zip_safe=False,
     entry_points={
         "console_scripts": [


Test patch:
Repository: jazzband/pip-tools

Issue:
Make the --build-isolation flag set on by default for pip-compile
#### What's the problem this feature will solve?
<!-- What are you trying to do, that you are unable to achieve with pip-tools as it currently stands? -->

Currently, pip-compile builds requirements with `--no-build-isolation` flag by default. However, this flag forces a user to install manually setup requirements (like `setuptools` or `wheel`), otherwise, the user would get an error (e.g., #721 or #1019). 

Since the modern source distribution ([PEP 518](https://www.python.org/dev/peps/pep-0518/)) becomes more popupar it makes sense to change the default value to `--build-isolation` as `pip` does.

#### Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->

<!-- Provide examples of real-world use cases that this would enable and how it solves the problem described above. -->

1. make `--build-isolation` as default
1. bump a major version

#### Alternative Solutions
<!-- Have you tried to workaround the problem using pip-tools or other tools? Or a different approach to solving this issue? Please elaborate here. -->

N/A

#### Additional context
<!-- Add any other context, links, etc. about the feature here. -->

#721 
#746
#1019 
https://twitter.com/hynek/status/1184740558641750016


Discussion:
It would be nice to release it in 5.0.0 version.

Resolving patch:
diff --git a/piptools/repositories/pypi.py b/piptools/repositories/pypi.py
--- a/piptools/repositories/pypi.py
+++ b/piptools/repositories/pypi.py
@@ -46,7 +46,7 @@ class PyPIRepository(BaseRepository):
     changed/configured on the Finder.
     """
 
-    def __init__(self, pip_args, cache_dir, build_isolation=False):
+    def __init__(self, pip_args, cache_dir, build_isolation=True):
         # Use pip's parser for pip.conf management and defaults.
         # General options (find_links, index_url, extra_index_url, trusted_host,
         # and pre) are deferred to pip.
diff --git a/piptools/scripts/compile.py b/piptools/scripts/compile.py
--- a/piptools/scripts/compile.py
+++ b/piptools/scripts/compile.py
@@ -157,7 +157,7 @@
 @click.option(
     "--build-isolation/--no-build-isolation",
     is_flag=True,
-    default=False,
+    default=True,
     help="Enable isolation when building a modern source distribution. "
     "Build dependencies specified by PEP 518 must be already installed "
     "if build isolation is disabled.",


Test patch:
diff --git a/tests/test_utils.py b/tests/test_utils.py
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -254,7 +254,7 @@ def test_force_text(value, expected_text):
         (["--annotate"], "pip-compile"),
         (["--index"], "pip-compile"),
         (["--max-rounds=10"], "pip-compile"),
-        (["--no-build-isolation"], "pip-compile"),
+        (["--build-isolation"], "pip-compile"),
         # Check options with multiple values
         (
             ["--find-links", "links1", "--find-links", "links2"],
Repository: jazzband/pip-tools

Issue:
Remove "(line X)" annotations from output
#### What's the problem this feature will solve?

I love the new source annotations in 4.5.0 from #1058. But the line number annotations cause unnecessary diff churn. For example on a project I'm working on, I added a couple requirements that are alphabetically early, and it means *every* requirement afterwards has a new line number:

<img width="395" alt="Screenshot 2020-02-25 at 15 22 19" src="https://user-images.githubusercontent.com/857609/75261303-b6d72580-57e2-11ea-99ef-dcef368bb755.png">

Adding a single requirement with no dependencies can become a 100 line diff 😢

Equally sorting one's `requirements.in` would make diff noise just from changing the line numbers.
 
#### Describe the solution you'd like

Remove the line numbers from the output.

#### Alternative Solutions

A flag? I prefer sensible defaults though.



Discussion:

Resolving patch:
diff --git a/piptools/writer.py b/piptools/writer.py
--- a/piptools/writer.py
+++ b/piptools/writer.py
@@ -1,6 +1,7 @@
 from __future__ import unicode_literals
 
 import os
+import re
 from itertools import chain
 
 import six
@@ -38,9 +39,12 @@
 )
 
 
+strip_comes_from_line_re = re.compile(r" \(line \d+\)$")
+
+
 def _comes_from_as_string(ireq):
     if isinstance(ireq.comes_from, six.string_types):
-        return ireq.comes_from
+        return strip_comes_from_line_re.sub("", ireq.comes_from)
     return key_from_ireq(ireq.comes_from)
 
 


Test patch:
diff --git a/tests/test_cli_compile.py b/tests/test_cli_compile.py
--- a/tests/test_cli_compile.py
+++ b/tests/test_cli_compile.py
@@ -662,7 +662,7 @@ def test_multiple_input_files_without_output_file(runner):
         (
             "--annotate",
             "small-fake-a==0.1         "
-            "# via -c constraints.txt (line 1), small-fake-with-deps\n",
+            "# via -c constraints.txt, small-fake-with-deps\n",
         ),
         ("--no-annotate", "small-fake-a==0.1\n"),
     ],
Repository: jazzband/pip-tools

Issue:
Feature: pip-sync --dry-run should return a non-zero exit code if changes were to occur
#### What's the problem this feature will solve?
I'm looking to add a pre-commit hook to check the environment is up to date

```
-   repo: local
    hooks:
    -   id: pip-sync
        name: pip-sync check
        entry: pip-sync --dry-run
        language: system
        always_run: true
        pass_filenames: false
```

#### Describe the solution you'd like
```
$ pip-sync --dry-run
Would install:
  numpy==1.18.5
$ $?
2
```


#### Alternative Solutions
various | awk stuff

#### Additional context
NA



Discussion:
Hello @atugushev, @graingert. Is this change being worked on already? If not, is it OK if I write a PR for this feature? 
Hello @francisbrito,

Feel free to pick this up 👍 
Hello @graingert,

That sounds reasonable! Thanks for the issue.

Resolving patch:
diff --git a/piptools/sync.py b/piptools/sync.py
--- a/piptools/sync.py
+++ b/piptools/sync.py
@@ -158,10 +158,12 @@ def sync(
     """
     Install and uninstalls the given sets of modules.
     """
+    exit_code = 0
+
     if not to_uninstall and not to_install:
         if verbose:
             click.echo("Everything up-to-date")
-        return 0
+        return exit_code
 
     pip_flags = []
     if not verbose:
@@ -181,8 +183,11 @@ def sync(
             for ireq in sorted(to_install, key=key_from_ireq):
                 click.echo("  {}".format(format_requirement(ireq)))
 
+        exit_code = 1
+
     if ask and click.confirm("Would you like to proceed with these changes?"):
         dry_run = False
+        exit_code = 0
 
     if not dry_run:
         if to_uninstall:
@@ -215,4 +220,4 @@ def sync(
             finally:
                 os.unlink(tmp_req_file.name)
 
-    return 0
+    return exit_code


Test patch:
diff --git a/tests/test_cli_sync.py b/tests/test_cli_sync.py
--- a/tests/test_cli_sync.py
+++ b/tests/test_cli_sync.py
@@ -120,7 +120,7 @@ def test_merge_error(req_lines, should_raise, runner):
         assert out.exit_code == 2
         assert "Incompatible requirements found" in out.stderr
     else:
-        assert out.exit_code == 0
+        assert out.exit_code == 1
 
 
 @pytest.mark.parametrize(
@@ -231,3 +231,15 @@ def test_sync_ask_accepted(check_call, runner):
     runner.invoke(cli, ["--ask", "--dry-run"], input="y\n")
 
     assert check_call.call_count == 2
+
+
+def test_sync_dry_run_returns_non_zero_exit_code(runner):
+    """
+    Make sure non-zero exit code is returned when --dry-run is given.
+    """
+    with open("requirements.txt", "w") as req_in:
+        req_in.write("small-fake-a==1.10.0")
+
+    out = runner.invoke(cli, ["--dry-run"])
+
+    assert out.exit_code == 1
Repository: jazzband/pip-tools

Issue:
pip-compile fails on unavailable irrelevant constraint
pip-compile tries to find a match for all constraints, event those that are not a requirement and come from a constraint file.

As a result if a constraints file defines a constraint on a package that is unavailable (be it a typo, a private lib on a currently unavailable repository, or a deprecated version no longer available) pip-compile won't work, even for requirements.in that will not need that package.

#### Steps to replicate
requirements.in:
```
-c constraints.txt
```

constraints.txt:
```
invalid-dependency~=0.0
```

#### Expected result

```
#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile requirements.in
#
```

#### Actual result
```
Could not find a version that matches invalid-dependency~=0.0 (from -c constraints.txt (line 1))
No versions found
```

This should be fixed by #1175 



Discussion:

Resolving patch:
diff --git a/piptools/resolver.py b/piptools/resolver.py
--- a/piptools/resolver.py
+++ b/piptools/resolver.py
@@ -323,6 +323,10 @@ def get_best_match(self, ireq):
             # NOTE: it's much quicker to immediately return instead of
             # hitting the index server
             best_match = ireq
+        elif ireq.constraint:
+            # NOTE: This is not a requirement (yet) and does not need
+            # to be resolved
+            best_match = ireq
         else:
             best_match = self.repository.find_best_match(
                 ireq, prereleases=self.prereleases


Test patch:
diff --git a/tests/test_resolver.py b/tests/test_resolver.py
--- a/tests/test_resolver.py
+++ b/tests/test_resolver.py
@@ -129,6 +129,18 @@
                     "werkzeug==0.10.4 (from flask==0.10.1)",
                 ],
             ),
+            # We shouldn't fail on invalid irrelevant pip constraints
+            # See: GH-1178
+            (
+                ["Flask", ("missing-dependency<1.0", True), ("itsdangerous", True)],
+                [
+                    "flask==0.10.1",
+                    "itsdangerous==0.24",
+                    "markupsafe==0.23 (from jinja2==2.7.3->flask==0.10.1)",
+                    "jinja2==2.7.3 (from flask==0.10.1)",
+                    "werkzeug==0.10.4 (from flask==0.10.1)",
+                ],
+            ),
             # Unsafe dependencies should be filtered
             (
                 ["setuptools==35.0.0", "anyjson==0.3.3"],
Repository: jazzband/pip-tools

Issue:
Compiling setup.py in a nested folder produces setup.txt
<!-- Describe the issue briefly here. -->

#### Environment Versions

1. OS Type: macOS
1. Python version: `Python 3.8.0`
1. pip version:  `pip 20.2.2`
1. pip-tools version: `pip-compile, version 5.5.0`

#### Steps to replicate

1. Create a folder:
```console
$ mkdir -p foo/bar
```
2. Create `setup.py`:
```console
$ cat << EOF > foo/bar/setup.py
from setuptools import setup
setup(name="bar", version="0.1", install_requires=["six"])
EOF
```
3. Run `pip-compile`:
```console
$ pip-compile foo/bar/setup.py
#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile foo/bar/setup.py
#
six==1.15.0
    # via bar (foo/bar/setup.py)
```

#### Expected result

```console
$ ls foo/bar
setup.py  requirements.txt
```

#### Actual result

```console
$ ls foo/bar
setup.py  setup.txt
```


Discussion:
Hi @atugushev 
Can I work on this issue?
@peymanslh sure! Feel free to. 

Resolving patch:
diff --git a/piptools/scripts/compile.py b/piptools/scripts/compile.py
--- a/piptools/scripts/compile.py
+++ b/piptools/scripts/compile.py
@@ -275,8 +275,10 @@ def cli(
         if src_files == ("-",):
             raise click.BadParameter("--output-file is required if input is from stdin")
         # Use default requirements output file if there is a setup.py the source file
-        elif src_files == ("setup.py",):
-            file_name = DEFAULT_REQUIREMENTS_OUTPUT_FILE
+        elif os.path.basename(src_files[0]) == "setup.py":
+            file_name = os.path.join(
+                os.path.dirname(src_files[0]), DEFAULT_REQUIREMENTS_OUTPUT_FILE
+            )
         # An output file must be provided if there are multiple source files
         elif len(src_files) > 1:
             raise click.BadParameter(


Test patch:
diff --git a/tests/test_cli_compile.py b/tests/test_cli_compile.py
--- a/tests/test_cli_compile.py
+++ b/tests/test_cli_compile.py
@@ -107,6 +107,27 @@ def test_command_line_setuptools_output_file(
     assert os.path.exists(expected_output_file)
 
 
+def test_command_line_setuptools_nested_output_file(pip_conf, tmpdir, runner):
+    """
+    Test the output file for setup.py in nested folder as a requirement file.
+    """
+    proj_dir = tmpdir.mkdir("proj")
+
+    with open(str(proj_dir / "setup.py"), "w") as package:
+        package.write(
+            dedent(
+                """\
+                from setuptools import setup
+                setup(install_requires=[])
+                """
+            )
+        )
+
+    out = runner.invoke(cli, [str(proj_dir / "setup.py")])
+    assert out.exit_code == 0
+    assert (proj_dir / "requirements.txt").exists()
+
+
 def test_find_links_option(runner):
     with open("requirements.in", "w") as req_in:
         req_in.write("-f ./libs3")