Skip to content

Commit

Permalink
Rename superhello to fasthello
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Livingston committed Jan 30, 2018
1 parent 59164c1 commit b4d367c
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 28 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ matrix:
- sudo rm -rf /usr/lib/jvm/java-1.6.0-openjdk-amd64
- sudo rm -rf /usr/lib/jvm/java-6-openjdk-amd64
- jdk_switcher use oraclejdk
- sudo rm ~/.cache/pants/python_cache/requirements/CPython-2.7.14/superhello*
env:
- SHARD="Python integration tests for pants - shard 1"
script:
Expand All @@ -272,7 +271,6 @@ matrix:
- sudo rm -rf /usr/lib/jvm/java-1.6.0-openjdk-amd64
- sudo rm -rf /usr/lib/jvm/java-6-openjdk-amd64
- jdk_switcher use oraclejdk8
- sudo rm ~/.cache/pants/python_cache/requirements/CPython-2.7.14/superhello*
env:
- SHARD="Python integration tests for pants - shard 2"
script:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# python_dist allows you to use setup.py to depend on C/C++ extensions.

python_dist(
name='superhello',
name='fasthello',
sources=[
'super_greet.c',
'hello_package/hello.py',
Expand All @@ -18,6 +18,6 @@ python_binary(
name='main',
source='main.py',
dependencies=[
':superhello',
':fasthello',
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)

# hello_package is a python module within the superhello python_distribution
# hello_package is a python module within the fasthello python_distribution
from hello_package import hello


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
c_module = Extension(str('super_greet'), sources=[str('super_greet.c')])

setup(
name='superhello',
name='fasthello',
version='1.0.0',
ext_modules=[c_module],
packages=find_packages(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# Example of defining a test target that depends on a python_dist target.

python_tests(
name='superhello',
name='fasthello',
sources=[
'test_superhello.py'
'test_fasthello.py'
],
dependencies=[
'examples/src/python/example/python_distribution/hello/superhello:superhello'
'examples/src/python/example/python_distribution/hello/fasthello:fasthello'
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)

# hello_package is a python module within the superhello python_distribution.
# hello_package is a python module within the fasthello python_distribution.
from hello_package import hello


# Example of writing a test that depends on a python_dist target.
def test_superhello():
def test_fasthello():
assert hello.hello() == "Super hello"
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


python_dist(
name='superhello',
name='fasthello',
sources=[
'super_greet.c',
'hello_package/hello.py',
Expand All @@ -16,15 +16,15 @@ python_binary(
name='main_with_no_conflict',
source='main.py',
dependencies=[
':superhello',
':fasthello',
]
)

python_binary(
name='main_with_conflicting_dep',
source='main.py',
dependencies=[
':superhello',
':fasthello',
':pycountry'
]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
c_module = Extension(str('super_greet'), sources=[str('super_greet.c')])

setup(
name='superhello',
name='fasthello',
version='1.0.0',
ext_modules=[c_module],
packages=find_packages(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
class PythonDistributionIntegrationTest(PantsRunIntegrationTest):
# The paths to both a project containing a simple C extension (to be packaged into a
# whl by setup.py) and an associated test to be consumed by the pants goals tested below.
superhello_project = 'examples/src/python/example/python_distribution/hello/superhello'
superhello_tests = 'examples/tests/python/example/python_distribution/hello/test_superhello'
superhello_install_requires = 'testprojects/src/python/python_distribution/superhello_with_install_requires'
fasthello_project = 'examples/src/python/example/python_distribution/hello/fasthello'
fasthello_tests = 'examples/tests/python/example/python_distribution/hello/test_fasthello'
fasthello_install_requires = 'testprojects/src/python/python_distribution/fasthello_with_install_requires'

def test_pants_binary(self):
command=['binary', '{}:main'.format(self.superhello_project)]
command=['binary', '{}:main'.format(self.fasthello_project)]
pants_run = self.run_pants(command=command)
self.assert_success(pants_run)
# Check that the pex was built.
Expand All @@ -33,23 +33,23 @@ def test_pants_binary(self):
os.remove(pex)

def test_pants_run(self):
command=['run', '{}:main'.format(self.superhello_project)]
command=['run', '{}:main'.format(self.fasthello_project)]
pants_run = self.run_pants(command=command)
self.assert_success(pants_run)
# Check that text was properly printed to stdout.
self.assertIn('Super hello', pants_run.stdout_data)

def test_pants_test(self):
command=['test', '{}:superhello'.format(self.superhello_tests)]
command=['test', '{}:fasthello'.format(self.fasthello_tests)]
pants_run = self.run_pants(command=command)
self.assert_success(pants_run)

def test_with_install_requires(self):
command=['run', '{}:main_with_no_conflict'.format(self.superhello_install_requires)]
command=['run', '{}:main_with_no_conflict'.format(self.fasthello_install_requires)]
pants_run = self.run_pants(command=command)
self.assert_success(pants_run)
self.assertIn('United States', pants_run.stdout_data)
command=['binary', '{}:main_with_no_conflict'.format(self.superhello_install_requires)]
command=['binary', '{}:main_with_no_conflict'.format(self.fasthello_install_requires)]
pants_run = self.run_pants(command=command)
self.assert_success(pants_run)
pex = os.path.join(get_buildroot(), 'dist', 'main_with_no_conflict.pex')
Expand All @@ -58,13 +58,13 @@ def test_with_install_requires(self):
os.remove(pex)

def test_with_conflicting_transitive_deps(self):
command=['run', '{}:main_with_conflicting_dep'.format(self.superhello_install_requires)]
command=['run', '{}:main_with_conflicting_dep'.format(self.fasthello_install_requires)]
pants_run = self.run_pants(command=command)
self.assert_failure(pants_run)
self.assertIn('pycountry', pants_run.stderr_data)
self.assertIn('superhello', pants_run.stderr_data)
command=['binary', '{}:main_with_conflicting_dep'.format(self.superhello_install_requires)]
self.assertIn('fasthello', pants_run.stderr_data)
command=['binary', '{}:main_with_conflicting_dep'.format(self.fasthello_install_requires)]
pants_run = self.run_pants(command=command)
self.assert_failure(pants_run)
self.assertIn('pycountry', pants_run.stderr_data)
self.assertIn('superhello', pants_run.stderr_data)
self.assertIn('fasthello', pants_run.stderr_data)
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def targets(self):
'testprojects/tests/java/org/pantsbuild/testproject/depman:old-tests',
'testprojects/tests/java/org/pantsbuild/testproject/htmlreport:htmlreport',
'testprojects/tests/java/org/pantsbuild/testproject/parallel.*',
'testprojects/src/python/python_distribution/superhello_with_install_requires.*'
'testprojects/src/python/python_distribution/fasthello_with_install_requires.*'
]

# May not succeed without java8 installed
Expand Down

0 comments on commit b4d367c

Please sign in to comment.