Skip to content

Commit

Permalink
Working superhello project equivalent to backends/tensorflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Livingston committed Jan 30, 2018
1 parent 5837f30 commit dd99194
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

python_binary(
dependencies=[
'examples/src/python/example/python_distribution/hello/hello2:superhello',
'examples/src/python/example/python_distribution/hello/superhello:superhello',
],
source='main.py',
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import sys

from sample import hello
from hello_package import hello


if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Like Hello world, but built with Pants. This time, with both C++ and Py sources

python_distribution(
name='superhello2'
name='superhello'
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
c_module = Extension('super_greet', sources=['c/super_greet.c'])

setup(
name='superhello2',
name='superhello',
version='1.0.0',
ext_modules=[c_module],
packages=find_packages(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Metadata-Version: 1.0
Name: superhello
Version: 1.0.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
setup.py
c/super_greet.c
hello_package/__init__.py
hello_package/hello.py
superhello.egg-info/PKG-INFO
superhello.egg-info/SOURCES.txt
superhello.egg-info/dependency_links.txt
superhello.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hello_package
super_greet
3 changes: 1 addition & 2 deletions src/python/pants/backend/python/tasks/pex_build_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def build_python_distribution_from_target(target, workdir):
os.chdir(pydist_workdir)
pex_name = "%s.pex" % target.name

args = ['--disable-cache', '/Users/clivingston/workspace/pants/examples/src/python/example/python_distribution/hello/hello2', '-o', pex_name]
args = ['--disable-cache', '/Users/clivingston/workspace/pants/examples/src/python/example/python_distribution/hello/superhello', '-o', pex_name]
try:
pex_main.main(args=args)
except SystemExit as e:
Expand All @@ -154,7 +154,6 @@ def build_python_distribution_from_target(target, workdir):
zip_ref.close()

contents = os.listdir(os.path.join(pydist_workdir, pex_name + '_chroot', '.deps'))
import pdb;pdb.set_trace()
whl_file = [wheel for wheel in contents if target.name in wheel]
whl_location = os.path.join(pydist_workdir, pex_name + '_chroot', '.deps', whl_file[0])

Expand Down

0 comments on commit dd99194

Please sign in to comment.