You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/01/09 16:32:57 UTC
[GitHub] elsloo closed pull request #3192: Fix trafficops python client
installation
elsloo closed pull request #3192: Fix trafficops python client installation
URL: https://github.com/apache/trafficcontrol/pull/3192
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/traffic_control/clients/python/setup.py b/traffic_control/clients/python/setup.py
index cec24977e..9e1cc5397 100755
--- a/traffic_control/clients/python/setup.py
+++ b/traffic_control/clients/python/setup.py
@@ -22,14 +22,17 @@
import sys
import os
from setuptools import setup, find_packages
-from trafficops import __version__ as version
HERE = os.path.abspath(os.path.dirname(__file__))
+about = {}
+with open(os.path.join(HERE, 'trafficops', '__version__.py'), mode='r', encoding='utf-8') as f:
+ exec(f.read(), about)
+
with open(os.path.join(HERE, "README.rst")) as fd:
setup(
name="Apache-TrafficControl",
- version=version,
+ version=about["__version__"],
author="Apache Software Foundation",
author_email="dev@trafficcontrol.apache.org",
description="Python API Client for Traffic Control",
diff --git a/traffic_control/clients/python/trafficops/__init__.py b/traffic_control/clients/python/trafficops/__init__.py
index 0131aa39b..0af092d83 100644
--- a/traffic_control/clients/python/trafficops/__init__.py
+++ b/traffic_control/clients/python/trafficops/__init__.py
@@ -14,6 +14,8 @@
# limitations under the License.
#
+from .__version__ import __version__
+
# Import Local Modules into the 'trafficops' package namespace for convenience.
from .tosession import TOSession
from .restapi import InvalidJSONError, LoginError, OperationError, api_request, RestApiSession
@@ -24,6 +26,3 @@
u'OperationError',
u'api_request',
u'RestApiSession']
-
-# The Module Version
-__version__ = '1.0.0'
diff --git a/traffic_control/clients/python/trafficops/__version__.py b/traffic_control/clients/python/trafficops/__version__.py
new file mode 100644
index 000000000..25d3a3746
--- /dev/null
+++ b/traffic_control/clients/python/trafficops/__version__.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+
+#
+# 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__ = '1.0.0'
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services