Skip to content

Commit de4f003

Browse files
committed
remove extraction api refs (#26)
removed extraction api refs and added long_description_content_type
1 parent 93bc4a1 commit de4f003

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

dnaStreaming/config.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Config(object):
1616
ENV_VAR_USER_ID = 'USER_ID'
1717
ENV_VAR_CLIENT_ID = 'CLIENT_ID'
1818
ENV_VAR_PASSWORD = 'PASSWORD'
19-
ENV_VAR_EXTRACTION_API_HOST = 'EXTRACTION_API_HOST'
19+
ENV_VAR_API_HOST = 'API_HOST'
2020

2121
def __init__(self, service_account_id=None, user_key=None, user_id=None, client_id=None, password=None):
2222
self.customer_config_path = self.DEFAULT_CUST_CONFIG_PATH
@@ -110,7 +110,7 @@ def _fetch_jwt(self):
110110

111111
def get_uri_context(self):
112112
headers = self.get_headers()
113-
host = os.getenv(self.ENV_VAR_EXTRACTION_API_HOST, self.DEFAULT_HOST)
113+
host = os.getenv(self.ENV_VAR_API_HOST, self.DEFAULT_HOST)
114114
if "Authorization" in headers:
115115
return host + '/dna'
116116
elif 'user-key' in headers:
@@ -122,7 +122,7 @@ def get_uri_context(self):
122122
raise Exception(msg)
123123

124124
# return credentials (user_id, client_id, and password) for obtaining a JWT via OAuth2 if all these fields are defined in the constructor, env vars or config file
125-
# otherwise return None (the client will have to authenticate Extraction API request with an user key, i.e. the old way)
125+
# otherwise return None (the client will have to authenticate API request with an user key, i.e. the original standard)
126126
def oauth2_credentials(self):
127127
creds = self._build_oauth2_credentials(
128128
self.user_id,

dnaStreaming/test/requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-r ../../requirements.txt
2-
pytest=5.4.2
3-
flake8=3.7.9
4-
pytest-cov=2.8.1
2+
pytest==5.4.2
3+
flake8==3.7.9
4+
pytest-cov==2.8.1
55
pytest-mock==3.1.0
66
pyflakes<2.2.0,>=2.1.0

dnaStreaming/test/test_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class TestConfig(TestCase):
1212
def tearDown(self):
1313
self.ensure_remove_environment_variable(Config.ENV_VAR_USER_KEY)
1414
self.ensure_remove_environment_variable(Config.ENV_VAR_SUBSCRIPTION_ID)
15-
self.ensure_remove_environment_variable(Config.ENV_VAR_EXTRACTION_API_HOST)
15+
self.ensure_remove_environment_variable(Config.ENV_VAR_API_HOST)
1616
self.ensure_remove_environment_variable(Config.ENV_VAR_USER_ID)
1717
self.ensure_remove_environment_variable(Config.ENV_VAR_CLIENT_ID)
1818
self.ensure_remove_environment_variable(Config.ENV_VAR_PASSWORD)

dnaStreaming/test/test_run_docker.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
USER_KEY=$1
66
SUBSCRIPTION_ID=$2
7-
ENV=$3
7+
API_HOST=$3
88

99
${USER_KEY:?"Need to set USER_KEY environment variable."}
1010
${SUBSCRIPTION_ID:?"Need to set SUBSCRIPTION_ID environment variable."}
11-
${ENV:?"Need to set ENV environment variable."}
11+
${API_HOST:=https://api.dowjones.com}
1212

1313
TIMEOUT=180 # NOTE: 2017-01-25: fleschec: In seconds
1414
NAME="dj-dna-streaming-python-asdvkds-for-testing-only"
@@ -28,7 +28,7 @@ run_docker() {
2828
--name=$NAME \
2929
-e USER_KEY=$USER_KEY \
3030
-e SUBSCRIPTION_ID=$SUBSCRIPTION_ID \
31-
-e EXTRACTION_API_HOST="https://extraction-api-dot-djsyndicationhub-$ENV.appspot.com" \
31+
-e API_HOST=$API_HOST \
3232
-e QUIET_DEMO=true \
3333
$NAME-tag
3434
}

setup.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
from distutils.core import setup
2-
32
from setuptools import find_packages
3+
# read the contents of your README file
4+
from os import path
5+
this_directory = path.abspath(path.dirname(__file__))
6+
with open(path.join(this_directory, 'README.rst'), encoding='utf-8') as f:
7+
long_description = f.read()
48

59
setup(
610
name='dnaStreaming',
7-
version='2.0.1',
11+
version='2.0.2',
812
description='Dow Jones DNA Streaming Project',
9-
author='Chris Flesche',
10-
author_email='[email protected]',
13+
long_description=long_description,
14+
long_description_content_type='text/x-rst',
15+
author='Zachary Kagan',
16+
author_email='[email protected]',
1117
url='https://github.com/dowjones/dj-dna-streams-python',
1218
download_url='https://github.com/dowjones/dj-dna-streams-python/archive/release-2.0.0.tar.gz',
1319
keywords=['DOWJONES', 'FACTIVA', 'STREAMS'],

0 commit comments

Comments
 (0)