summaryrefslogtreecommitdiff
path: root/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/wheel.py
diff options
context:
space:
mode:
authorShubham Saini <shubham6405@gmail.com>2019-08-05 08:32:33 +0000
committerShubham Saini <shubham6405@gmail.com>2019-08-05 08:32:33 +0000
commit227b2d30a8675b44918f9d9ca89b24144a938215 (patch)
tree9f8e6a28724514b6fdf463a9ab2067a7ef309b72 /venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/wheel.py
parent842a8cfbbbdb1f92889d892e4859dbd5d40c5be8 (diff)
removing venv files
Diffstat (limited to 'venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/wheel.py')
-rw-r--r--venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/wheel.py179
1 files changed, 0 insertions, 179 deletions
diff --git a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/wheel.py b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/wheel.py
deleted file mode 100644
index ed8cdfc..0000000
--- a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/wheel.py
+++ /dev/null
@@ -1,179 +0,0 @@
1# -*- coding: utf-8 -*-
2from __future__ import absolute_import
3
4import logging
5import os
6
7from pip._internal import cmdoptions
8from pip._internal.basecommand import RequirementCommand
9from pip._internal.cache import WheelCache
10from pip._internal.exceptions import CommandError, PreviousBuildDirError
11from pip._internal.operations.prepare import RequirementPreparer
12from pip._internal.req import RequirementSet
13from pip._internal.resolve import Resolver
14from pip._internal.utils.temp_dir import TempDirectory
15from pip._internal.wheel import WheelBuilder
16
17logger = logging.getLogger(__name__)
18
19
20class WheelCommand(RequirementCommand):
21 """
22 Build Wheel archives for your requirements and dependencies.
23
24 Wheel is a built-package format, and offers the advantage of not
25 recompiling your software during every install. For more details, see the
26 wheel docs: https://wheel.readthedocs.io/en/latest/
27
28 Requirements: setuptools>=0.8, and wheel.
29
30 'pip wheel' uses the bdist_wheel setuptools extension from the wheel
31 package to build individual wheels.
32
33 """
34
35 name = 'wheel'
36 usage = """
37 %prog [options] <requirement specifier> ...
38 %prog [options] -r <requirements file> ...
39 %prog [options] [-e] <vcs project url> ...
40 %prog [options] [-e] <local project path> ...
41 %prog [options] <archive url/path> ..."""
42
43 summary = 'Build wheels from your requirements.'
44
45 def __init__(self, *args, **kw):
46 super(WheelCommand, self).__init__(*args, **kw)
47
48 cmd_opts = self.cmd_opts
49
50 cmd_opts.add_option(
51 '-w', '--wheel-dir',
52 dest='wheel_dir',
53 metavar='dir',
54 default=os.curdir,
55 help=("Build wheels into <dir>, where the default is the "
56 "current working directory."),
57 )
58 cmd_opts.add_option(cmdoptions.no_binary())
59 cmd_opts.add_option(cmdoptions.only_binary())
60 cmd_opts.add_option(
61 '--build-option',
62 dest='build_options',
63 metavar='options',
64 action='append',
65 help="Extra arguments to be supplied to 'setup.py bdist_wheel'.",
66 )
67 cmd_opts.add_option(cmdoptions.no_build_isolation())
68 cmd_opts.add_option(cmdoptions.constraints())
69 cmd_opts.add_option(cmdoptions.editable())
70 cmd_opts.add_option(cmdoptions.requirements())
71 cmd_opts.add_option(cmdoptions.src())
72 cmd_opts.add_option(cmdoptions.ignore_requires_python())
73 cmd_opts.add_option(cmdoptions.no_deps())
74 cmd_opts.add_option(cmdoptions.build_dir())
75 cmd_opts.add_option(cmdoptions.progress_bar())
76
77 cmd_opts.add_option(
78 '--global-option',
79 dest='global_options',
80 action='append',
81 metavar='options',
82 help="Extra global options to be supplied to the setup.py "
83 "call before the 'bdist_wheel' command.")
84
85 cmd_opts.add_option(
86 '--pre',
87 action='store_true',
88 default=False,
89 help=("Include pre-release and development versions. By default, "
90 "pip only finds stable versions."),
91 )
92
93 cmd_opts.add_option(cmdoptions.no_clean())
94 cmd_opts.add_option(cmdoptions.require_hashes())
95
96 index_opts = cmdoptions.make_option_group(
97 cmdoptions.index_group,
98 self.parser,
99 )
100
101 self.parser.insert_option_group(0, index_opts)
102 self.parser.insert_option_group(0, cmd_opts)
103
104 def run(self, options, args):
105 cmdoptions.check_install_build_global(options)
106
107 index_urls = [options.index_url] + options.extra_index_urls
108 if options.no_index:
109 logger.debug('Ignoring indexes: %s', ','.join(index_urls))
110 index_urls = []
111
112 if options.build_dir:
113 options.build_dir = os.path.abspath(options.build_dir)
114
115 options.src_dir = os.path.abspath(options.src_dir)
116
117 with self._build_session(options) as session:
118 finder = self._build_package_finder(options, session)
119 build_delete = (not (options.no_clean or options.build_dir))
120 wheel_cache = WheelCache(options.cache_dir, options.format_control)
121
122 with TempDirectory(
123 options.build_dir, delete=build_delete, kind="wheel"
124 ) as directory:
125 requirement_set = RequirementSet(
126 require_hashes=options.require_hashes,
127 )
128
129 try:
130 self.populate_requirement_set(
131 requirement_set, args, options, finder, session,
132 self.name, wheel_cache
133 )
134
135 preparer = RequirementPreparer(
136 build_dir=directory.path,
137 src_dir=options.src_dir,
138 download_dir=None,
139 wheel_download_dir=options.wheel_dir,
140 progress_bar=options.progress_bar,
141 build_isolation=options.build_isolation,
142 )
143
144 resolver = Resolver(
145 preparer=preparer,
146 finder=finder,
147 session=session,
148 wheel_cache=wheel_cache,
149 use_user_site=False,
150 upgrade_strategy="to-satisfy-only",
151 force_reinstall=False,
152 ignore_dependencies=options.ignore_dependencies,
153 ignore_requires_python=options.ignore_requires_python,
154 ignore_installed=True,
155 isolated=options.isolated_mode,
156 )
157 resolver.resolve(requirement_set)
158
159 # build wheels
160 wb = WheelBuilder(
161 finder, preparer, wheel_cache,
162 build_options=options.build_options or [],
163 global_options=options.global_options or [],
164 no_clean=options.no_clean,
165 )
166 wheels_built_successfully = wb.build(
167 requirement_set.requirements.values(), session=session,
168 )
169 if not wheels_built_successfully:
170 raise CommandError(
171 "Failed to build one or more wheels"
172 )
173 except PreviousBuildDirError:
174 options.no_clean = True
175 raise
176 finally:
177 if not options.no_clean:
178 requirement_set.cleanup_files()
179 wheel_cache.cleanup()