-
-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use a pex to satisfy setup_requires for python_dist() targets
- Loading branch information
1 parent
495502e
commit ee99bca
Showing
9 changed files
with
138 additions
and
98 deletions.
There are no files selected for viewing
10 changes: 9 additions & 1 deletion
10
examples/src/python/example/python_distribution/hello/pants_setup_requires/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
main_file = 'main.py' | ||
|
||
python_dist( | ||
sources=globs('*.py'), | ||
sources=rglobs('*.py', exclude=[main_file]), | ||
setup_requires=[ | ||
# FIXME: this currently fails because setup_requires doesn't fetch transitive deps! | ||
'testprojects/pants-plugins/3rdparty/python/pants', | ||
], | ||
) | ||
|
||
python_binary( | ||
name='bin', | ||
sources=[main_file], | ||
dependencies=[':pants_setup_requires'], | ||
) |
Empty file.
13 changes: 13 additions & 0 deletions
13
examples/src/python/example/python_distribution/hello/pants_setup_requires/main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# coding=utf-8 | ||
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
from __future__ import absolute_import, division, print_function, unicode_literals | ||
|
||
import pkg_resources | ||
|
||
|
||
hello_module_version = pkg_resources.get_distribution('hello_again').version | ||
|
||
if __name__ == '__main__': | ||
print(hello_module_version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.