Refactoring of the Python build.

The source code is moved from src/python to
src/python/src. A setup.py is added at
src/python. The build_python.sh and
run_python.sh scripts are updated to build
and run the Python tests by building a
package and installing it in the developer's
Python 2.7 virtual environment.
pull/274/head
Nathaniel Manista 10 years ago
parent 163a2d540c
commit b8b0adfbf9
  1. 52
      src/python/setup.py
  2. 0
      src/python/src/__init__.py
  3. 0
      src/python/src/_framework/__init__.py
  4. 0
      src/python/src/_framework/base/__init__.py
  5. 0
      src/python/src/_framework/base/exceptions.py
  6. 0
      src/python/src/_framework/base/interfaces.py
  7. 0
      src/python/src/_framework/base/interfaces_test.py
  8. 0
      src/python/src/_framework/base/packets/__init__.py
  9. 0
      src/python/src/_framework/base/packets/_cancellation.py
  10. 0
      src/python/src/_framework/base/packets/_constants.py
  11. 0
      src/python/src/_framework/base/packets/_context.py
  12. 0
      src/python/src/_framework/base/packets/_emission.py
  13. 0
      src/python/src/_framework/base/packets/_ends.py
  14. 0
      src/python/src/_framework/base/packets/_expiration.py
  15. 0
      src/python/src/_framework/base/packets/_ingestion.py
  16. 0
      src/python/src/_framework/base/packets/_interfaces.py
  17. 0
      src/python/src/_framework/base/packets/_reception.py
  18. 0
      src/python/src/_framework/base/packets/_termination.py
  19. 0
      src/python/src/_framework/base/packets/_transmission.py
  20. 0
      src/python/src/_framework/base/packets/implementations.py
  21. 0
      src/python/src/_framework/base/packets/implementations_test.py
  22. 0
      src/python/src/_framework/base/packets/in_memory.py
  23. 0
      src/python/src/_framework/base/packets/interfaces.py
  24. 0
      src/python/src/_framework/base/packets/null.py
  25. 0
      src/python/src/_framework/base/packets/packets.py
  26. 0
      src/python/src/_framework/base/util.py
  27. 0
      src/python/src/_framework/common/__init__.py
  28. 0
      src/python/src/_framework/common/cardinality.py
  29. 0
      src/python/src/_framework/face/__init__.py
  30. 0
      src/python/src/_framework/face/_calls.py
  31. 0
      src/python/src/_framework/face/_control.py
  32. 0
      src/python/src/_framework/face/_service.py
  33. 0
      src/python/src/_framework/face/_test_case.py
  34. 0
      src/python/src/_framework/face/blocking_invocation_inline_service_test.py
  35. 0
      src/python/src/_framework/face/demonstration.py
  36. 0
      src/python/src/_framework/face/event_invocation_synchronous_event_service_test.py
  37. 0
      src/python/src/_framework/face/exceptions.py
  38. 0
      src/python/src/_framework/face/future_invocation_asynchronous_event_service_test.py
  39. 0
      src/python/src/_framework/face/implementations.py
  40. 0
      src/python/src/_framework/face/interfaces.py
  41. 0
      src/python/src/_framework/face/testing/__init__.py
  42. 0
      src/python/src/_framework/face/testing/base_util.py
  43. 0
      src/python/src/_framework/face/testing/blocking_invocation_inline_service_test_case.py
  44. 0
      src/python/src/_framework/face/testing/callback.py
  45. 0
      src/python/src/_framework/face/testing/control.py
  46. 0
      src/python/src/_framework/face/testing/coverage.py
  47. 0
      src/python/src/_framework/face/testing/digest.py
  48. 0
      src/python/src/_framework/face/testing/event_invocation_synchronous_event_service_test_case.py
  49. 0
      src/python/src/_framework/face/testing/future_invocation_asynchronous_event_service_test_case.py
  50. 0
      src/python/src/_framework/face/testing/interfaces.py
  51. 0
      src/python/src/_framework/face/testing/serial.py
  52. 0
      src/python/src/_framework/face/testing/service.py
  53. 0
      src/python/src/_framework/face/testing/stock_service.py
  54. 0
      src/python/src/_framework/face/testing/test_case.py
  55. 0
      src/python/src/_framework/foundation/__init__.py
  56. 0
      src/python/src/_framework/foundation/_later_test.py
  57. 0
      src/python/src/_framework/foundation/_logging_pool_test.py
  58. 0
      src/python/src/_framework/foundation/_timer_future.py
  59. 0
      src/python/src/_framework/foundation/abandonment.py
  60. 0
      src/python/src/_framework/foundation/callable_util.py
  61. 0
      src/python/src/_framework/foundation/future.py
  62. 0
      src/python/src/_framework/foundation/later.py
  63. 0
      src/python/src/_framework/foundation/logging_pool.py
  64. 0
      src/python/src/_framework/foundation/stream.py
  65. 0
      src/python/src/_framework/foundation/stream_testing.py
  66. 0
      src/python/src/_framework/foundation/stream_util.py
  67. 0
      src/python/src/_junkdrawer/__init__.py
  68. 0
      src/python/src/_junkdrawer/stock_pb2.py
  69. 2
      tools/run_tests/build_python.sh
  70. 10
      tools/run_tests/run_python.sh

@ -0,0 +1,52 @@
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""A setup module for the GRPC Python package."""
from distutils import core as _core
_PACKAGES=(
'_framework',
'_framework.base',
'_framework.base.packets',
'_framework.common',
'_framework.face',
'_framework.face.testing',
'_framework.foundation',
'_junkdrawer',
)
_PACKAGE_DIRECTORIES = {
'_framework': 'src/_framework',
'_junkdrawer': 'src/_junkdrawer',
}
_core.setup(
name='grpc', version='0.0.1', packages=_PACKAGES,
package_dir=_PACKAGE_DIRECTORIES)

@ -8,3 +8,5 @@ cd $(dirname $0)/../..
root=`pwd`
virtualenv python2.7_virtual_environment
python2.7_virtual_environment/bin/pip install enum34==1.0.4 futures==2.2.0
python2.7_virtual_environment/bin/pip install third_party/protobuf/python
python2.7_virtual_environment/bin/pip install src/python

@ -6,6 +6,12 @@ set -ex
cd $(dirname $0)/../..
root=`pwd`
PYTHONPATH=third_party/protobuf/python python2.7_virtual_environment/bin/python2.7 -B -m unittest discover -s src/python -p '*.py'
# TODO(nathaniel): Get this working again (requires 3.X-friendly protobuf)
# TODO(issue 215): Properly itemize these in run_tests.py so that they can be parallelized.
python2.7_virtual_environment/bin/python2.7 -B -m _framework.base.packets.implementations_test
python2.7_virtual_environment/bin/python2.7 -B -m _framework.face.blocking_invocation_inline_service_test
python2.7_virtual_environment/bin/python2.7 -B -m _framework.face.event_invocation_synchronous_event_service_test
python2.7_virtual_environment/bin/python2.7 -B -m _framework.face.future_invocation_asynchronous_event_service_test
python2.7_virtual_environment/bin/python2.7 -B -m _framework.foundation._later_test
python2.7_virtual_environment/bin/python2.7 -B -m _framework.foundation._logging_pool_test
# TODO(nathaniel): Get tests working under 3.4 (requires 3.X-friendly protobuf)
# python3.4 -B -m unittest discover -s src/python -p '*.py'

Loading…
Cancel
Save