-
-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--constraints in pex #335
--constraints in pex #335
Changes from 1 commit
50b009f
5bb57e9
e58c732
fb53e64
12ff104
29337d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -340,6 +340,16 @@ def configure_clp(): | |
help='Add requirements from the given requirements file. This option can be used multiple ' | ||
'times.') | ||
|
||
parser.add_option( | ||
'--constraints', | ||
dest='constraint_files', | ||
metavar='FILE', | ||
default=[], | ||
type=str, | ||
action='append', | ||
help='Add requirements from the given requirements file. This option can be used multiple ' | ||
'times.') | ||
|
||
parser.add_option( | ||
'-v', | ||
dest='verbosity', | ||
|
@@ -477,6 +487,13 @@ def build_pex(args, options, resolver_option_builder): | |
for requirements_txt in options.requirement_files: | ||
resolvables.extend(requirements_from_file(requirements_txt, resolver_option_builder)) | ||
|
||
for constraints_txt in options.constraint_files: | ||
constraints = [] | ||
for r in requirements_from_file(constraints_txt, resolver_option_builder): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pip states the constraints format is identical to requirements: https://pip.pypa.io/en/stable/user_guide/#constraints-files so I figured the way to guarantee that in pex was to share the requirements code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like a good tidbit to put into a comment |
||
r.is_constraint = True | ||
constraints.append(r) | ||
resolvables.extend(constraints) | ||
|
||
resolver_kwargs = dict(interpreter=interpreter, platform=options.platform) | ||
|
||
if options.cache_dir: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this read
Add constraints from the given constraints file
instead?