We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Allow http(s) as constraint file
<!--- Describe the changes here. --->

Alternative to #2038.

In my opinion, this is probably overshooting.

##### Contributor checklist

- [ ] Included tests for the changes.
- [ ] PR title is short, clear, and ready to be included in the user-facing changelog.

##### Maintainer checklist

- [ ] Verified one of these labels is present: `backwards incompatible`, `feature`, `enhancement`, `deprecation`, `bug`, `dependency`, `docs` or `skip-changelog` as they determine changelog listing.
- [ ] Assign the PR to an existing or new milestone for the target version (following [Semantic Versioning](https://blog.versioneye.com/2014/01/16/semantic-versioning/)).


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `piptools/scripts/options.py`
Content:
```
1 from __future__ import annotations
2 
3 from typing import Any, Literal
4 
5 import click
6 from pip._internal.commands import create_command
7 from pip._internal.utils.misc import redact_auth_from_url
8 
9 from piptools.locations import CACHE_DIR, DEFAULT_CONFIG_FILE_NAMES
10 from piptools.utils import UNSAFE_PACKAGES, override_defaults_from_config_file
11 
12 BuildTargetT = Literal["sdist", "wheel", "editable"]
13 ALL_BUILD_TARGETS: tuple[BuildTargetT, ...] = (
14     "editable",
15     "sdist",
16     "wheel",
17 )
18 
19 
20 def _get_default_option(option_name: str) -> Any:
21     """
22     Get default value of the pip's option (including option from pip.conf)
23     by a given option name.
24     """
25     install_command = create_command("install")
26     default_values = install_command.parser.get_default_values()
27     return getattr(default_values, option_name)
28 
29 
30 help_option_names = ("-h", "--help")
31 
32 # The options used by pip-compile and pip-sync are presented in no specific order.
33 
34 version = click.version_option(package_name="pip-tools")
35 
36 color = click.option(
37     "--color/--no-color",
38     default=None,
39     help="Force output to be colorized or not, instead of auto-detecting color support",
40 )
41 
42 verbose = click.option(
43     "-v",
44     "--verbose",
45     count=True,
46     help="Show more output",
47 )
48 quiet = click.option(
49     "-q",
50     "--quiet",
51     count=True,
52     help="Give less output",
53 )
54 
55 dry_run = click.option(
56     "-n",
57     "--dry-run",
58     is_flag=True,
59     help="Only show what would happen, don't change anything",
60 )
61 
62 pre = click.option(
63     "-p",
64     "--pre",
65     is_flag=True,
66     default=None,
67     help="Allow resolving to prereleases (default is not)",
68 )
69 
70 rebuild = click.option(
71     "-r",
72     "--rebuild",
73     is_flag=True,
74     help="Clear any caches upfront, rebuild from scratch",
75 )
76 
77 extra = click.option(
78     "--extra",
79     "extras",
80     multiple=True,
81     help="Name of an extras_require group to install; may be used more than once",
82 )
83 
84 all_extras = click.option(
85     "--all-extras",
86     is_flag=True,
87     default=False,
88     help="Install all extras_require groups",
89 )
90 
91 find_links = click.option(
92     "-f",
93     "--find-links",
94     multiple=True,
95     help="Look for archives in this directory or on this HTML page; may be used more than once",
96 )
97 
98 index_url = click.option(
99     "-i",
100     "--index-url",
101     help="Change index URL (defaults to {index_url})".format(
102         index_url=redact_auth_from_url(_get_default_option("index_url"))
103     ),
104 )
105 
106 no_index = click.option(
107     "--no-index",
108     is_flag=True,
109     help="Ignore package index (only looking at --find-links URLs instead).",
110 )
111 
112 extra_index_url = click.option(
113     "--extra-index-url",
114     multiple=True,
115     help="Add another index URL to search; may be used more than once",
116 )
117 
118 cert = click.option("--cert", help="Path to alternate CA bundle.")
119 
120 client_cert = click.option(
121     "--client-cert",
122     help=(
123         "Path to SSL client certificate, a single file containing "
124         "the private key and the certificate in PEM format."
125     ),
126 )
127 
128 trusted_host = click.option(
129     "--trusted-host",
130     multiple=True,
131     help=(
132         "Mark this host as trusted, even though it does not have "
133         "valid or any HTTPS; may be used more than once"
134     ),
135 )
136 
137 header = click.option(
138     "--header/--no-header",
139     is_flag=True,
140     default=True,
141     help="Add header to generated file",
142 )
143 
144 emit_trusted_host = click.option(
145     "--emit-trusted-host/--no-emit-trusted-host",
146     is_flag=True,
147     default=True,
148     help="Add trusted host option to generated file",
149 )
150 
151 annotate = click.option(
152     "--annotate/--no-annotate",
153     is_flag=True,
154     default=True,
155     help="Annotate results, indicating where dependencies come from",
156 )
157 
158 annotation_style = click.option(
159     "--annotation-style",
160     type=click.Choice(("line", "split")),
161     default="split",
162     help="Choose the format of annotation comments",
163 )
164 
165 upgrade = click.option(
166     "-U",
167     "--upgrade/--no-upgrade",
168     is_flag=True,
169     default=False,
170     help="Try to upgrade all dependencies to their latest versions",
171 )
172 
173 upgrade_package = click.option(
174     "-P",
175     "--upgrade-package",
176     "upgrade_packages",
177     nargs=1,
178     multiple=True,
179     help="Specify a particular package to upgrade; may be used more than once",
180 )
181 
182 output_file = click.option(
183     "-o",
184     "--output-file",
185     nargs=1,
186     default=None,
187     type=click.File("w+b", atomic=True, lazy=True),
188     help=(
189         "Output file name. Required if more than one input file is given. "
190         "Will be derived from input file otherwise."
191     ),
192 )
193 
194 newline = click.option(
195     "--newline",
196     type=click.Choice(("LF", "CRLF", "native", "preserve"), case_sensitive=False),
197     default="preserve",
198     help="Override the newline control characters used",
199 )
200 
201 allow_unsafe = click.option(
202     "--allow-unsafe/--no-allow-unsafe",
203     is_flag=True,
204     default=False,
205     help=(
206         "Pin packages considered unsafe: {}.\n\n"
207         "WARNING: Future versions of pip-tools will enable this behavior by default. "
208         "Use --no-allow-unsafe to keep the old behavior. It is recommended to pass the "
209         "--allow-unsafe now to adapt to the upcoming change.".format(
210             ", ".join(sorted(UNSAFE_PACKAGES))
211         )
212     ),
213 )
214 
215 strip_extras = click.option(
216     "--strip-extras/--no-strip-extras",
217     is_flag=True,
218     default=None,
219     help="Assure output file is constraints compatible, avoiding use of extras.",
220 )
221 
222 generate_hashes = click.option(
223     "--generate-hashes",
224     is_flag=True,
225     default=False,
226     help="Generate pip 8 style hashes in the resulting requirements file.",
227 )
228 
229 reuse_hashes = click.option(
230     "--reuse-hashes/--no-reuse-hashes",
231     is_flag=True,
232     default=True,
233     help=(
234         "Improve the speed of --generate-hashes by reusing the hashes from an "
235         "existing output file."
236     ),
237 )
238 
239 max_rounds = click.option(
240     "--max-rounds",
241     default=10,
242     help="Maximum number of rounds before resolving the requirements aborts.",
243 )
244 
245 src_files = click.argument(
246     "src_files",
247     nargs=-1,
248     type=click.Path(exists=True, allow_dash=True),
249 )
250 
251 build_isolation = click.option(
252     "--build-isolation/--no-build-isolation",
253     is_flag=True,
254     default=True,
255     help=(
256         "Enable isolation when building a modern source distribution. "
257         "Build dependencies specified by PEP 518 must be already installed "
258         "if build isolation is disabled."
259     ),
260 )
261 
262 emit_find_links = click.option(
263     "--emit-find-links/--no-emit-find-links",
264     is_flag=True,
265     default=True,
266     help="Add the find-links option to generated file",
267 )
268 
269 cache_dir = click.option(
270     "--cache-dir",
271     help="Store the cache data in DIRECTORY.",
272     default=CACHE_DIR,
273     envvar="PIP_TOOLS_CACHE_DIR",
274     show_default=True,
275     show_envvar=True,
276     type=click.Path(file_okay=False, writable=True),
277 )
278 
279 pip_args = click.option(
280     "--pip-args",
281     "pip_args_str",
282     help="Arguments to pass directly to the pip command.",
283 )
284 
285 resolver = click.option(
286     "--resolver",
287     "resolver_name",
288     type=click.Choice(("legacy", "backtracking")),
289     default="backtracking",
290     envvar="PIP_TOOLS_RESOLVER",
291     help="Choose the dependency resolver.",
292 )
293 
294 emit_index_url = click.option(
295     "--emit-index-url/--no-emit-index-url",
296     is_flag=True,
297     default=True,
298     help="Add index URL to generated file",
299 )
300 
301 emit_options = click.option(
302     "--emit-options/--no-emit-options",
303     is_flag=True,
304     default=True,
305     help="Add options to generated file",
306 )
307 
308 unsafe_package = click.option(
309     "--unsafe-package",
310     multiple=True,
311     help=(
312         "Specify a package to consider unsafe; may be used more than once. "
313         f"Replaces default unsafe packages: {', '.join(sorted(UNSAFE_PACKAGES))}"
314     ),
315 )
316 
317 config = click.option(
318     "--config",
319     type=click.Path(
320         exists=True,
321         file_okay=True,
322         dir_okay=False,
323         readable=True,
324         allow_dash=False,
325         path_type=str,
326     ),
327     help=(
328         f"Read configuration from TOML file. By default, looks for the following "
329         f"files in the given order: {', '.join(DEFAULT_CONFIG_FILE_NAMES)}."
330     ),
331     is_eager=True,
332     callback=override_defaults_from_config_file,
333 )
334 
335 no_config = click.option(
336     "--no-config",
337     is_flag=True,
338     default=False,
339     help="Do not read any config file.",
340     is_eager=True,
341 )
342 
343 constraint = click.option(
344     "-c",
345     "--constraint",
346     type=click.Path(
347         exists=True,
348         file_okay=True,
349         dir_okay=False,
350         readable=True,
351         allow_dash=False,
352         path_type=str,
353     ),
354     multiple=True,
355     help="Constrain versions using the given constraints file; may be used more than once.",
356 )
357 
358 ask = click.option(
359     "-a",
360     "--ask",
361     is_flag=True,
362     help="Show what would happen, then ask whether to continue",
363 )
364 
365 force = click.option(
366     "--force", is_flag=True, help="Proceed even if conflicts are found"
367 )
368 
369 python_executable = click.option(
370     "--python-executable",
371     help="Custom python executable path if targeting an environment other than current.",
372 )
373 
374 user = click.option(
375     "--user",
376     "user_only",
377     is_flag=True,
378     help="Restrict attention to user directory",
379 )
380 
381 build_deps_for = click.option(
382     "--build-deps-for",
383     "build_deps_targets",
384     multiple=True,
385     type=click.Choice(ALL_BUILD_TARGETS),
386     help="Name of a build target to extract dependencies for. "
387     "Static dependencies declared in 'pyproject.toml::build-system.requires' will be included as "
388     "well; may be used more than once.",
389 )
390 
391 all_build_deps = click.option(
392     "--all-build-deps",
393     is_flag=True,
394     default=False,
395     help="Extract dependencies for all build targets. "
396     "Static dependencies declared in 'pyproject.toml::build-system.requires' will be included as "
397     "well.",
398 )
399 
400 only_build_deps = click.option(
401     "--only-build-deps",
402     is_flag=True,
403     default=False,
404     help="Extract a package only if it is a build dependency.",
405 )
406
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/piptools/scripts/options.py b/piptools/scripts/options.py
--- a/piptools/scripts/options.py
+++ b/piptools/scripts/options.py
@@ -343,14 +343,6 @@
 constraint = click.option(
     "-c",
     "--constraint",
-    type=click.Path(
-        exists=True,
-        file_okay=True,
-        dir_okay=False,
-        readable=True,
-        allow_dash=False,
-        path_type=str,
-    ),
     multiple=True,
     help="Constrain versions using the given constraints file; may be used more than once.",
 )

{"golden_diff": "diff --git a/piptools/scripts/options.py b/piptools/scripts/options.py\n--- a/piptools/scripts/options.py\n+++ b/piptools/scripts/options.py\n@@ -343,14 +343,6 @@\n constraint = click.option(\n     \"-c\",\n     \"--constraint\",\n-    type=click.Path(\n-        exists=True,\n-        file_okay=True,\n-        dir_okay=False,\n-        readable=True,\n-        allow_dash=False,\n-        path_type=str,\n-    ),\n     multiple=True,\n     help=\"Constrain versions using the given constraints file; may be used more than once.\",\n )\n", "issue": "Allow http(s) as constraint file\n<!--- Describe the changes here. --->\r\n\r\nAlternative to #2038.\r\n\r\nIn my opinion, this is probably overshooting.\r\n\r\n##### Contributor checklist\r\n\r\n- [ ] Included tests for the changes.\r\n- [ ] PR title is short, clear, and ready to be included in the user-facing changelog.\r\n\r\n##### Maintainer checklist\r\n\r\n- [ ] Verified one of these labels is present: `backwards incompatible`, `feature`, `enhancement`, `deprecation`, `bug`, `dependency`, `docs` or `skip-changelog` as they determine changelog listing.\r\n- [ ] Assign the PR to an existing or new milestone for the target version (following [Semantic Versioning](https://blog.versioneye.com/2014/01/16/semantic-versioning/)).\r\n\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom typing import Any, Literal\n\nimport click\nfrom pip._internal.commands import create_command\nfrom pip._internal.utils.misc import redact_auth_from_url\n\nfrom piptools.locations import CACHE_DIR, DEFAULT_CONFIG_FILE_NAMES\nfrom piptools.utils import UNSAFE_PACKAGES, override_defaults_from_config_file\n\nBuildTargetT = Literal[\"sdist\", \"wheel\", \"editable\"]\nALL_BUILD_TARGETS: tuple[BuildTargetT, ...] = (\n    \"editable\",\n    \"sdist\",\n    \"wheel\",\n)\n\n\ndef _get_default_option(option_name: str) -> Any:\n    \"\"\"\n    Get default value of the pip's option (including option from pip.conf)\n    by a given option name.\n    \"\"\"\n    install_command = create_command(\"install\")\n    default_values = install_command.parser.get_default_values()\n    return getattr(default_values, option_name)\n\n\nhelp_option_names = (\"-h\", \"--help\")\n\n# The options used by pip-compile and pip-sync are presented in no specific order.\n\nversion = click.version_option(package_name=\"pip-tools\")\n\ncolor = click.option(\n    \"--color/--no-color\",\n    default=None,\n    help=\"Force output to be colorized or not, instead of auto-detecting color support\",\n)\n\nverbose = click.option(\n    \"-v\",\n    \"--verbose\",\n    count=True,\n    help=\"Show more output\",\n)\nquiet = click.option(\n    \"-q\",\n    \"--quiet\",\n    count=True,\n    help=\"Give less output\",\n)\n\ndry_run = click.option(\n    \"-n\",\n    \"--dry-run\",\n    is_flag=True,\n    help=\"Only show what would happen, don't change anything\",\n)\n\npre = click.option(\n    \"-p\",\n    \"--pre\",\n    is_flag=True,\n    default=None,\n    help=\"Allow resolving to prereleases (default is not)\",\n)\n\nrebuild = click.option(\n    \"-r\",\n    \"--rebuild\",\n    is_flag=True,\n    help=\"Clear any caches upfront, rebuild from scratch\",\n)\n\nextra = click.option(\n    \"--extra\",\n    \"extras\",\n    multiple=True,\n    help=\"Name of an extras_require group to install; may be used more than once\",\n)\n\nall_extras = click.option(\n    \"--all-extras\",\n    is_flag=True,\n    default=False,\n    help=\"Install all extras_require groups\",\n)\n\nfind_links = click.option(\n    \"-f\",\n    \"--find-links\",\n    multiple=True,\n    help=\"Look for archives in this directory or on this HTML page; may be used more than once\",\n)\n\nindex_url = click.option(\n    \"-i\",\n    \"--index-url\",\n    help=\"Change index URL (defaults to {index_url})\".format(\n        index_url=redact_auth_from_url(_get_default_option(\"index_url\"))\n    ),\n)\n\nno_index = click.option(\n    \"--no-index\",\n    is_flag=True,\n    help=\"Ignore package index (only looking at --find-links URLs instead).\",\n)\n\nextra_index_url = click.option(\n    \"--extra-index-url\",\n    multiple=True,\n    help=\"Add another index URL to search; may be used more than once\",\n)\n\ncert = click.option(\"--cert\", help=\"Path to alternate CA bundle.\")\n\nclient_cert = click.option(\n    \"--client-cert\",\n    help=(\n        \"Path to SSL client certificate, a single file containing \"\n        \"the private key and the certificate in PEM format.\"\n    ),\n)\n\ntrusted_host = click.option(\n    \"--trusted-host\",\n    multiple=True,\n    help=(\n        \"Mark this host as trusted, even though it does not have \"\n        \"valid or any HTTPS; may be used more than once\"\n    ),\n)\n\nheader = click.option(\n    \"--header/--no-header\",\n    is_flag=True,\n    default=True,\n    help=\"Add header to generated file\",\n)\n\nemit_trusted_host = click.option(\n    \"--emit-trusted-host/--no-emit-trusted-host\",\n    is_flag=True,\n    default=True,\n    help=\"Add trusted host option to generated file\",\n)\n\nannotate = click.option(\n    \"--annotate/--no-annotate\",\n    is_flag=True,\n    default=True,\n    help=\"Annotate results, indicating where dependencies come from\",\n)\n\nannotation_style = click.option(\n    \"--annotation-style\",\n    type=click.Choice((\"line\", \"split\")),\n    default=\"split\",\n    help=\"Choose the format of annotation comments\",\n)\n\nupgrade = click.option(\n    \"-U\",\n    \"--upgrade/--no-upgrade\",\n    is_flag=True,\n    default=False,\n    help=\"Try to upgrade all dependencies to their latest versions\",\n)\n\nupgrade_package = click.option(\n    \"-P\",\n    \"--upgrade-package\",\n    \"upgrade_packages\",\n    nargs=1,\n    multiple=True,\n    help=\"Specify a particular package to upgrade; may be used more than once\",\n)\n\noutput_file = click.option(\n    \"-o\",\n    \"--output-file\",\n    nargs=1,\n    default=None,\n    type=click.File(\"w+b\", atomic=True, lazy=True),\n    help=(\n        \"Output file name. Required if more than one input file is given. \"\n        \"Will be derived from input file otherwise.\"\n    ),\n)\n\nnewline = click.option(\n    \"--newline\",\n    type=click.Choice((\"LF\", \"CRLF\", \"native\", \"preserve\"), case_sensitive=False),\n    default=\"preserve\",\n    help=\"Override the newline control characters used\",\n)\n\nallow_unsafe = click.option(\n    \"--allow-unsafe/--no-allow-unsafe\",\n    is_flag=True,\n    default=False,\n    help=(\n        \"Pin packages considered unsafe: {}.\\n\\n\"\n        \"WARNING: Future versions of pip-tools will enable this behavior by default. \"\n        \"Use --no-allow-unsafe to keep the old behavior. It is recommended to pass the \"\n        \"--allow-unsafe now to adapt to the upcoming change.\".format(\n            \", \".join(sorted(UNSAFE_PACKAGES))\n        )\n    ),\n)\n\nstrip_extras = click.option(\n    \"--strip-extras/--no-strip-extras\",\n    is_flag=True,\n    default=None,\n    help=\"Assure output file is constraints compatible, avoiding use of extras.\",\n)\n\ngenerate_hashes = click.option(\n    \"--generate-hashes\",\n    is_flag=True,\n    default=False,\n    help=\"Generate pip 8 style hashes in the resulting requirements file.\",\n)\n\nreuse_hashes = click.option(\n    \"--reuse-hashes/--no-reuse-hashes\",\n    is_flag=True,\n    default=True,\n    help=(\n        \"Improve the speed of --generate-hashes by reusing the hashes from an \"\n        \"existing output file.\"\n    ),\n)\n\nmax_rounds = click.option(\n    \"--max-rounds\",\n    default=10,\n    help=\"Maximum number of rounds before resolving the requirements aborts.\",\n)\n\nsrc_files = click.argument(\n    \"src_files\",\n    nargs=-1,\n    type=click.Path(exists=True, allow_dash=True),\n)\n\nbuild_isolation = click.option(\n    \"--build-isolation/--no-build-isolation\",\n    is_flag=True,\n    default=True,\n    help=(\n        \"Enable isolation when building a modern source distribution. \"\n        \"Build dependencies specified by PEP 518 must be already installed \"\n        \"if build isolation is disabled.\"\n    ),\n)\n\nemit_find_links = click.option(\n    \"--emit-find-links/--no-emit-find-links\",\n    is_flag=True,\n    default=True,\n    help=\"Add the find-links option to generated file\",\n)\n\ncache_dir = click.option(\n    \"--cache-dir\",\n    help=\"Store the cache data in DIRECTORY.\",\n    default=CACHE_DIR,\n    envvar=\"PIP_TOOLS_CACHE_DIR\",\n    show_default=True,\n    show_envvar=True,\n    type=click.Path(file_okay=False, writable=True),\n)\n\npip_args = click.option(\n    \"--pip-args\",\n    \"pip_args_str\",\n    help=\"Arguments to pass directly to the pip command.\",\n)\n\nresolver = click.option(\n    \"--resolver\",\n    \"resolver_name\",\n    type=click.Choice((\"legacy\", \"backtracking\")),\n    default=\"backtracking\",\n    envvar=\"PIP_TOOLS_RESOLVER\",\n    help=\"Choose the dependency resolver.\",\n)\n\nemit_index_url = click.option(\n    \"--emit-index-url/--no-emit-index-url\",\n    is_flag=True,\n    default=True,\n    help=\"Add index URL to generated file\",\n)\n\nemit_options = click.option(\n    \"--emit-options/--no-emit-options\",\n    is_flag=True,\n    default=True,\n    help=\"Add options to generated file\",\n)\n\nunsafe_package = click.option(\n    \"--unsafe-package\",\n    multiple=True,\n    help=(\n        \"Specify a package to consider unsafe; may be used more than once. \"\n        f\"Replaces default unsafe packages: {', '.join(sorted(UNSAFE_PACKAGES))}\"\n    ),\n)\n\nconfig = click.option(\n    \"--config\",\n    type=click.Path(\n        exists=True,\n        file_okay=True,\n        dir_okay=False,\n        readable=True,\n        allow_dash=False,\n        path_type=str,\n    ),\n    help=(\n        f\"Read configuration from TOML file. By default, looks for the following \"\n        f\"files in the given order: {', '.join(DEFAULT_CONFIG_FILE_NAMES)}.\"\n    ),\n    is_eager=True,\n    callback=override_defaults_from_config_file,\n)\n\nno_config = click.option(\n    \"--no-config\",\n    is_flag=True,\n    default=False,\n    help=\"Do not read any config file.\",\n    is_eager=True,\n)\n\nconstraint = click.option(\n    \"-c\",\n    \"--constraint\",\n    type=click.Path(\n        exists=True,\n        file_okay=True,\n        dir_okay=False,\n        readable=True,\n        allow_dash=False,\n        path_type=str,\n    ),\n    multiple=True,\n    help=\"Constrain versions using the given constraints file; may be used more than once.\",\n)\n\nask = click.option(\n    \"-a\",\n    \"--ask\",\n    is_flag=True,\n    help=\"Show what would happen, then ask whether to continue\",\n)\n\nforce = click.option(\n    \"--force\", is_flag=True, help=\"Proceed even if conflicts are found\"\n)\n\npython_executable = click.option(\n    \"--python-executable\",\n    help=\"Custom python executable path if targeting an environment other than current.\",\n)\n\nuser = click.option(\n    \"--user\",\n    \"user_only\",\n    is_flag=True,\n    help=\"Restrict attention to user directory\",\n)\n\nbuild_deps_for = click.option(\n    \"--build-deps-for\",\n    \"build_deps_targets\",\n    multiple=True,\n    type=click.Choice(ALL_BUILD_TARGETS),\n    help=\"Name of a build target to extract dependencies for. \"\n    \"Static dependencies declared in 'pyproject.toml::build-system.requires' will be included as \"\n    \"well; may be used more than once.\",\n)\n\nall_build_deps = click.option(\n    \"--all-build-deps\",\n    is_flag=True,\n    default=False,\n    help=\"Extract dependencies for all build targets. \"\n    \"Static dependencies declared in 'pyproject.toml::build-system.requires' will be included as \"\n    \"well.\",\n)\n\nonly_build_deps = click.option(\n    \"--only-build-deps\",\n    is_flag=True,\n    default=False,\n    help=\"Extract a package only if it is a build dependency.\",\n)\n", "path": "piptools/scripts/options.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom typing import Any, Literal\n\nimport click\nfrom pip._internal.commands import create_command\nfrom pip._internal.utils.misc import redact_auth_from_url\n\nfrom piptools.locations import CACHE_DIR, DEFAULT_CONFIG_FILE_NAMES\nfrom piptools.utils import UNSAFE_PACKAGES, override_defaults_from_config_file\n\nBuildTargetT = Literal[\"sdist\", \"wheel\", \"editable\"]\nALL_BUILD_TARGETS: tuple[BuildTargetT, ...] = (\n    \"editable\",\n    \"sdist\",\n    \"wheel\",\n)\n\n\ndef _get_default_option(option_name: str) -> Any:\n    \"\"\"\n    Get default value of the pip's option (including option from pip.conf)\n    by a given option name.\n    \"\"\"\n    install_command = create_command(\"install\")\n    default_values = install_command.parser.get_default_values()\n    return getattr(default_values, option_name)\n\n\nhelp_option_names = (\"-h\", \"--help\")\n\n# The options used by pip-compile and pip-sync are presented in no specific order.\n\nversion = click.version_option(package_name=\"pip-tools\")\n\ncolor = click.option(\n    \"--color/--no-color\",\n    default=None,\n    help=\"Force output to be colorized or not, instead of auto-detecting color support\",\n)\n\nverbose = click.option(\n    \"-v\",\n    \"--verbose\",\n    count=True,\n    help=\"Show more output\",\n)\nquiet = click.option(\n    \"-q\",\n    \"--quiet\",\n    count=True,\n    help=\"Give less output\",\n)\n\ndry_run = click.option(\n    \"-n\",\n    \"--dry-run\",\n    is_flag=True,\n    help=\"Only show what would happen, don't change anything\",\n)\n\npre = click.option(\n    \"-p\",\n    \"--pre\",\n    is_flag=True,\n    default=None,\n    help=\"Allow resolving to prereleases (default is not)\",\n)\n\nrebuild = click.option(\n    \"-r\",\n    \"--rebuild\",\n    is_flag=True,\n    help=\"Clear any caches upfront, rebuild from scratch\",\n)\n\nextra = click.option(\n    \"--extra\",\n    \"extras\",\n    multiple=True,\n    help=\"Name of an extras_require group to install; may be used more than once\",\n)\n\nall_extras = click.option(\n    \"--all-extras\",\n    is_flag=True,\n    default=False,\n    help=\"Install all extras_require groups\",\n)\n\nfind_links = click.option(\n    \"-f\",\n    \"--find-links\",\n    multiple=True,\n    help=\"Look for archives in this directory or on this HTML page; may be used more than once\",\n)\n\nindex_url = click.option(\n    \"-i\",\n    \"--index-url\",\n    help=\"Change index URL (defaults to {index_url})\".format(\n        index_url=redact_auth_from_url(_get_default_option(\"index_url\"))\n    ),\n)\n\nno_index = click.option(\n    \"--no-index\",\n    is_flag=True,\n    help=\"Ignore package index (only looking at --find-links URLs instead).\",\n)\n\nextra_index_url = click.option(\n    \"--extra-index-url\",\n    multiple=True,\n    help=\"Add another index URL to search; may be used more than once\",\n)\n\ncert = click.option(\"--cert\", help=\"Path to alternate CA bundle.\")\n\nclient_cert = click.option(\n    \"--client-cert\",\n    help=(\n        \"Path to SSL client certificate, a single file containing \"\n        \"the private key and the certificate in PEM format.\"\n    ),\n)\n\ntrusted_host = click.option(\n    \"--trusted-host\",\n    multiple=True,\n    help=(\n        \"Mark this host as trusted, even though it does not have \"\n        \"valid or any HTTPS; may be used more than once\"\n    ),\n)\n\nheader = click.option(\n    \"--header/--no-header\",\n    is_flag=True,\n    default=True,\n    help=\"Add header to generated file\",\n)\n\nemit_trusted_host = click.option(\n    \"--emit-trusted-host/--no-emit-trusted-host\",\n    is_flag=True,\n    default=True,\n    help=\"Add trusted host option to generated file\",\n)\n\nannotate = click.option(\n    \"--annotate/--no-annotate\",\n    is_flag=True,\n    default=True,\n    help=\"Annotate results, indicating where dependencies come from\",\n)\n\nannotation_style = click.option(\n    \"--annotation-style\",\n    type=click.Choice((\"line\", \"split\")),\n    default=\"split\",\n    help=\"Choose the format of annotation comments\",\n)\n\nupgrade = click.option(\n    \"-U\",\n    \"--upgrade/--no-upgrade\",\n    is_flag=True,\n    default=False,\n    help=\"Try to upgrade all dependencies to their latest versions\",\n)\n\nupgrade_package = click.option(\n    \"-P\",\n    \"--upgrade-package\",\n    \"upgrade_packages\",\n    nargs=1,\n    multiple=True,\n    help=\"Specify a particular package to upgrade; may be used more than once\",\n)\n\noutput_file = click.option(\n    \"-o\",\n    \"--output-file\",\n    nargs=1,\n    default=None,\n    type=click.File(\"w+b\", atomic=True, lazy=True),\n    help=(\n        \"Output file name. Required if more than one input file is given. \"\n        \"Will be derived from input file otherwise.\"\n    ),\n)\n\nnewline = click.option(\n    \"--newline\",\n    type=click.Choice((\"LF\", \"CRLF\", \"native\", \"preserve\"), case_sensitive=False),\n    default=\"preserve\",\n    help=\"Override the newline control characters used\",\n)\n\nallow_unsafe = click.option(\n    \"--allow-unsafe/--no-allow-unsafe\",\n    is_flag=True,\n    default=False,\n    help=(\n        \"Pin packages considered unsafe: {}.\\n\\n\"\n        \"WARNING: Future versions of pip-tools will enable this behavior by default. \"\n        \"Use --no-allow-unsafe to keep the old behavior. It is recommended to pass the \"\n        \"--allow-unsafe now to adapt to the upcoming change.\".format(\n            \", \".join(sorted(UNSAFE_PACKAGES))\n        )\n    ),\n)\n\nstrip_extras = click.option(\n    \"--strip-extras/--no-strip-extras\",\n    is_flag=True,\n    default=None,\n    help=\"Assure output file is constraints compatible, avoiding use of extras.\",\n)\n\ngenerate_hashes = click.option(\n    \"--generate-hashes\",\n    is_flag=True,\n    default=False,\n    help=\"Generate pip 8 style hashes in the resulting requirements file.\",\n)\n\nreuse_hashes = click.option(\n    \"--reuse-hashes/--no-reuse-hashes\",\n    is_flag=True,\n    default=True,\n    help=(\n        \"Improve the speed of --generate-hashes by reusing the hashes from an \"\n        \"existing output file.\"\n    ),\n)\n\nmax_rounds = click.option(\n    \"--max-rounds\",\n    default=10,\n    help=\"Maximum number of rounds before resolving the requirements aborts.\",\n)\n\nsrc_files = click.argument(\n    \"src_files\",\n    nargs=-1,\n    type=click.Path(exists=True, allow_dash=True),\n)\n\nbuild_isolation = click.option(\n    \"--build-isolation/--no-build-isolation\",\n    is_flag=True,\n    default=True,\n    help=(\n        \"Enable isolation when building a modern source distribution. \"\n        \"Build dependencies specified by PEP 518 must be already installed \"\n        \"if build isolation is disabled.\"\n    ),\n)\n\nemit_find_links = click.option(\n    \"--emit-find-links/--no-emit-find-links\",\n    is_flag=True,\n    default=True,\n    help=\"Add the find-links option to generated file\",\n)\n\ncache_dir = click.option(\n    \"--cache-dir\",\n    help=\"Store the cache data in DIRECTORY.\",\n    default=CACHE_DIR,\n    envvar=\"PIP_TOOLS_CACHE_DIR\",\n    show_default=True,\n    show_envvar=True,\n    type=click.Path(file_okay=False, writable=True),\n)\n\npip_args = click.option(\n    \"--pip-args\",\n    \"pip_args_str\",\n    help=\"Arguments to pass directly to the pip command.\",\n)\n\nresolver = click.option(\n    \"--resolver\",\n    \"resolver_name\",\n    type=click.Choice((\"legacy\", \"backtracking\")),\n    default=\"backtracking\",\n    envvar=\"PIP_TOOLS_RESOLVER\",\n    help=\"Choose the dependency resolver.\",\n)\n\nemit_index_url = click.option(\n    \"--emit-index-url/--no-emit-index-url\",\n    is_flag=True,\n    default=True,\n    help=\"Add index URL to generated file\",\n)\n\nemit_options = click.option(\n    \"--emit-options/--no-emit-options\",\n    is_flag=True,\n    default=True,\n    help=\"Add options to generated file\",\n)\n\nunsafe_package = click.option(\n    \"--unsafe-package\",\n    multiple=True,\n    help=(\n        \"Specify a package to consider unsafe; may be used more than once. \"\n        f\"Replaces default unsafe packages: {', '.join(sorted(UNSAFE_PACKAGES))}\"\n    ),\n)\n\nconfig = click.option(\n    \"--config\",\n    type=click.Path(\n        exists=True,\n        file_okay=True,\n        dir_okay=False,\n        readable=True,\n        allow_dash=False,\n        path_type=str,\n    ),\n    help=(\n        f\"Read configuration from TOML file. By default, looks for the following \"\n        f\"files in the given order: {', '.join(DEFAULT_CONFIG_FILE_NAMES)}.\"\n    ),\n    is_eager=True,\n    callback=override_defaults_from_config_file,\n)\n\nno_config = click.option(\n    \"--no-config\",\n    is_flag=True,\n    default=False,\n    help=\"Do not read any config file.\",\n    is_eager=True,\n)\n\nconstraint = click.option(\n    \"-c\",\n    \"--constraint\",\n    multiple=True,\n    help=\"Constrain versions using the given constraints file; may be used more than once.\",\n)\n\nask = click.option(\n    \"-a\",\n    \"--ask\",\n    is_flag=True,\n    help=\"Show what would happen, then ask whether to continue\",\n)\n\nforce = click.option(\n    \"--force\", is_flag=True, help=\"Proceed even if conflicts are found\"\n)\n\npython_executable = click.option(\n    \"--python-executable\",\n    help=\"Custom python executable path if targeting an environment other than current.\",\n)\n\nuser = click.option(\n    \"--user\",\n    \"user_only\",\n    is_flag=True,\n    help=\"Restrict attention to user directory\",\n)\n\nbuild_deps_for = click.option(\n    \"--build-deps-for\",\n    \"build_deps_targets\",\n    multiple=True,\n    type=click.Choice(ALL_BUILD_TARGETS),\n    help=\"Name of a build target to extract dependencies for. \"\n    \"Static dependencies declared in 'pyproject.toml::build-system.requires' will be included as \"\n    \"well; may be used more than once.\",\n)\n\nall_build_deps = click.option(\n    \"--all-build-deps\",\n    is_flag=True,\n    default=False,\n    help=\"Extract dependencies for all build targets. \"\n    \"Static dependencies declared in 'pyproject.toml::build-system.requires' will be included as \"\n    \"well.\",\n)\n\nonly_build_deps = click.option(\n    \"--only-build-deps\",\n    is_flag=True,\n    default=False,\n    help=\"Extract a package only if it is a build dependency.\",\n)\n", "path": "piptools/scripts/options.py"}]}