Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

move cli, explorer, tracker and ui and tools common files #1276

Merged
merged 10 commits into from
Aug 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 13 additions & 22 deletions heron/common/src/python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,20 @@ package(default_visibility = ["//visibility:public"])
load("/tools/rules/pex_rules", "pex_library")

pex_library(
name = 'common',
srcs = glob(['**/*.py']),
deps = [
'//heron/proto:proto-py',
],
reqs = [
'colorlog==2.6.1',
'tornado==4.0.2',
'pyyaml==3.10',
]
name = 'common-py',
srcs = glob(['**/*.py']),
deps = [
'//heron/proto:proto-py',
],
reqs = [
'colorlog==2.6.1',
]
)

pex_library(
name = 'tracker-access',
srcs = glob(['**/handler/access/*.py']),
deps = [],
name = 'common-log-py',
srcs = ["utils/log.py"],
reqs = [
"colorlog==2.6.1",
]
)

pex_library(
name = 'common_log',
srcs = ["utils/log.py"],
reqs = [
"colorlog==2.6.1",
]
)

7 changes: 7 additions & 0 deletions heron/common/src/python/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

# Create the logger
# pylint: disable=invalid-name
logging.basicConfig()
Log = logging.getLogger()

# time formatter - date - time - UTC offset
Expand All @@ -35,6 +36,12 @@ def configure(level=logging.INFO, logfile=None, with_time=False):
:return: None
:rtype: None
"""

# Remove all the existing StreamHandlers to avoid duplicate
for handler in Log.handlers:
if isinstance(handler, logging.StreamHandler):
Log.handlers.remove(handler)

Log.setLevel(level)

# if logfile is specified, FileHandler is used
Expand Down
20 changes: 10 additions & 10 deletions heron/common/tests/python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package(default_visibility = ["//visibility:public"])
load("/tools/rules/pex_rules", "pex_library", "pex_test")

pex_library(
name = "pytest-lib",
srcs = ["mock_protobuf.py"],
deps = [
"//heron/common/src/python:common",
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
name = "pytest-py",
srcs = ["mock_protobuf.py"],
deps = [
"//heron/common/src/python:common-py",
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
)
44 changes: 22 additions & 22 deletions heron/common/tests/python/basics/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ package(default_visibility = ["//visibility:public"])
load("/tools/rules/pex_rules", "pex_library", "pex_test")

pex_test(
name = "gateway_looper_unittest",
srcs = ["gateway_looper_unittest.py"],
deps = [
"//heron/common/src/python:common"
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
size = "small",
name = "gateway_looper_unittest",
srcs = ["gateway_looper_unittest.py"],
deps = [
"//heron/common/src/python:common-py"
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
size = "small",
)

pex_test(
name = "event_looper_unittest",
srcs = ["event_looper_unittest.py"],
deps = [
"//heron/common/src/python:common"
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
size = "small",
name = "event_looper_unittest",
srcs = ["event_looper_unittest.py"],
deps = [
"//heron/common/src/python:common-py"
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
size = "small",
)
64 changes: 32 additions & 32 deletions heron/common/tests/python/network/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@ package(default_visibility = ["//visibility:public"])
load("/tools/rules/pex_rules", "pex_library", "pex_test")

pex_library(
name = "pytest-nw-lib",
srcs = ["mock_generator.py"],
deps = [
"//heron/common/tests/python:pytest-lib",
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
name = "pytest-network-py",
srcs = ["mock_generator.py"],
deps = [
"//heron/common/tests/python:pytest-py",
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
)

pex_test(
name = "protocol_unittest",
srcs = ["protocol_unittest.py"],
deps = [
":pytest-nw-lib",
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
size = "small",
name = "protocol_unittest",
srcs = ["protocol_unittest.py"],
deps = [
":pytest-network-py",
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
size = "small",
)

pex_test(
name = "heron_client_unittest",
srcs = ["heron_client_unittest.py"],
deps = [
":pytest-nw-lib",
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
size = "small",
name = "heron_client_unittest",
srcs = ["heron_client_unittest.py"],
deps = [
":pytest-network-py",
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
size = "small",
)
22 changes: 11 additions & 11 deletions heron/common/tests/python/pex_loader/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package(default_visibility = ["//visibility:public"])
load("/tools/rules/pex_rules", "pex_library", "pex_test")

pex_test(
name = "pex_loader_unittest",
srcs = ["pex_loader_unittest.py", "constants.py"],
deps = [
"//heron/common/src/python:common",
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
size = "small",
name = "pex_loader_unittest",
srcs = ["pex_loader_unittest.py", "constants.py"],
deps = [
"//heron/common/src/python:common-py",
],
reqs = [
"py==1.4.27",
"pytest==2.6.4",
"unittest2==0.5.1",
],
size = "small",
)
Loading