Skip to content

Commit

Permalink
Bump version to 0.1.10
Browse files Browse the repository at this point in the history
Pick up #369 to replace hardcoded version with __version__ file and bump
the version number.
  • Loading branch information
c24t committed Dec 10, 2018
1 parent fd2f4f2 commit acc2d42
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 32 deletions.
15 changes: 15 additions & 0 deletions opencensus/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2018, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = '0.1.10'
24 changes: 11 additions & 13 deletions opencensus/trace/exporters/ocagent/trace_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,29 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Export opencensus spans to ocagent"""

from threading import Lock
import datetime
import grpc
import os
import socket
from threading import Lock

from opencensus.__version__ import __version__
from opencensus.trace.exporters import base
from opencensus.trace.exporters.gen.opencensus.agent.common.v1 import (
common_pb2
)
from opencensus.trace.exporters.gen.opencensus.agent.trace.v1 import (
trace_service_pb2,
trace_service_pb2_grpc
)
from opencensus.trace.exporters.gen.opencensus.agent.common.v1 \
import common_pb2
from opencensus.trace.exporters.gen.opencensus.agent.trace.v1 \
import trace_service_pb2
from opencensus.trace.exporters.gen.opencensus.agent.trace.v1 \
import trace_service_pb2_grpc
from opencensus.trace.exporters.ocagent import utils
from opencensus.trace.exporters.transports import sync

# Default agent endpoint
DEFAULT_ENDPOINT = 'localhost:55678'

# OpenCensus Version
# TODO: https://github.com/census-instrumentation/opencensus-python/issues/296
CORE_LIBRARY_VERSION = '0.1.6'
# OCAgent exporter version
EXPORTER_VERSION = '0.0.1'


Expand Down Expand Up @@ -91,7 +89,7 @@ def __init__(
library_info=common_pb2.LibraryInfo(
language=common_pb2.LibraryInfo.Language.Value('PYTHON'),
exporter_version=EXPORTER_VERSION,
core_library_version=CORE_LIBRARY_VERSION
core_library_version=__version__
),
service_info=common_pb2.ServiceInfo(name=self.service_name))

Expand Down
12 changes: 6 additions & 6 deletions opencensus/trace/exporters/stackdriver_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
from collections import defaultdict
import os

from google.cloud.trace.client import Client

from opencensus.__version__ import __version__
from opencensus.common.monitored_resource_util.monitored_resource_util \
import MonitoredResourceUtil
from opencensus.trace import attributes_helper
from opencensus.trace import span_data
from opencensus.trace.attributes import Attributes
from opencensus.trace.exporters import base
from opencensus.trace.exporters.transports import sync
from opencensus.common.monitored_resource_util.monitored_resource_util \
import MonitoredResourceUtil

# OpenCensus Version
VERSION = '0.1.9'

# Agent
AGENT = 'opencensus-python [{}]'.format(VERSION)
AGENT = 'opencensus-python [{}]'.format(__version__)

# Environment variable set in App Engine when vm:true is set.
_APPENGINE_FLEXIBLE_ENV_VM = 'GAE_APPENGINE_HOSTNAME'
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
'google-api-core >= 1.0.0, < 2.0.0',
]

exec(open("opencensus/__version__.py").read())
setup(
name='opencensus',
version='0.1.9',
version=__version__, # noqa
author='OpenCensus Authors',
author_email='[email protected]',
classifiers=[
Expand Down
9 changes: 4 additions & 5 deletions tests/unit/trace/exporters/ocagent/test_trace_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@
import socket
import unittest

from google.protobuf.timestamp_pb2 import Timestamp

from opencensus.__version__ import __version__
from opencensus.trace import span_context as span_context_module
from opencensus.trace import span_data as span_data_module
from opencensus.trace.exporters.ocagent.trace_exporter import TraceExporter
from opencensus.trace.exporters.gen.opencensus.agent.trace.v1 import trace_service_pb2
from opencensus.trace.exporters.gen.opencensus.trace.v1 import trace_config_pb2
from opencensus.trace.exporters.ocagent.trace_exporter import TraceExporter


SERVICE_NAME = 'my-service'
Expand Down Expand Up @@ -79,7 +77,8 @@ def test_constructor_node(self):
self.assertEqual(exporter.node.service_info.name, SERVICE_NAME)
self.assertEqual(exporter.node.library_info.language, 8)
self.assertIsNotNone(exporter.node.library_info.exporter_version)
self.assertIsNotNone(exporter.node.library_info.core_library_version)
self.assertEqual(exporter.node.library_info.core_library_version,
__version__)

self.assertEqual(exporter.node.identifier.host_name,
socket.gethostname())
Expand Down
15 changes: 8 additions & 7 deletions tests/unit/trace/exporters/test_stackdriver_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import mock

from opencensus.__version__ import __version__
from opencensus.trace import span_context
from opencensus.trace import span_data as span_data_module
from opencensus.trace.exporters import stackdriver_exporter
Expand Down Expand Up @@ -106,7 +107,7 @@ def test_emit(self, monitor_resource_mock):
'string_value': {
'truncated_byte_count': 0,
'value': 'opencensus-python [{}]'.format(
stackdriver_exporter.VERSION
__version__
)
}
}
Expand Down Expand Up @@ -211,7 +212,7 @@ def test_translate_to_stackdriver(self, monitor_resource_mock):
'string_value': {
'truncated_byte_count': 0,
'value': 'opencensus-python [{}]'.format(
stackdriver_exporter.VERSION
__version__
)
}
},
Expand Down Expand Up @@ -569,7 +570,7 @@ def test_set_attributes_gae(self, monitor_resource_mock):
'string_value': {
'truncated_byte_count': 0,
'value': 'opencensus-python [{}]'.format(
stackdriver_exporter.VERSION
__version__
)
}
},
Expand Down Expand Up @@ -635,7 +636,7 @@ def test_monitored_resource_attributes_gke(self, gke_monitor_resource_mock):
'string_value': {
'truncated_byte_count': 0,
'value': 'opencensus-python [{}]'.format(
stackdriver_exporter.VERSION
__version__
)
}
},
Expand Down Expand Up @@ -720,7 +721,7 @@ def test_monitored_resource_attributes_gce(self, gce_monitor_resource_mock):
'string_value': {
'truncated_byte_count': 0,
'value': 'opencensus-python [{}]'.format(
stackdriver_exporter.VERSION
__version__
)
}
},
Expand Down Expand Up @@ -773,7 +774,7 @@ def test_monitored_resource_attributes_aws(self, aws_monitor_resource_mock):
'string_value': {
'truncated_byte_count': 0,
'value': 'opencensus-python [{}]'.format(
stackdriver_exporter.VERSION
__version__
)
}
},
Expand Down Expand Up @@ -820,7 +821,7 @@ def test_monitored_resource_attributes_None(self, monitor_resource_mock):
'string_value': {
'truncated_byte_count': 0,
'value': 'opencensus-python [{}]'.format(
stackdriver_exporter.VERSION
__version__
)
}
}
Expand Down

0 comments on commit acc2d42

Please sign in to comment.