Skip to content

Commit

Permalink
remove extraction api refs (#26)
Browse files Browse the repository at this point in the history
removed extraction api refs and added long_description_content_type
  • Loading branch information
zakagan committed Dec 2, 2020
1 parent 93bc4a1 commit de4f003
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
6 changes: 3 additions & 3 deletions dnaStreaming/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Config(object):
ENV_VAR_USER_ID = 'USER_ID'
ENV_VAR_CLIENT_ID = 'CLIENT_ID'
ENV_VAR_PASSWORD = 'PASSWORD'
ENV_VAR_EXTRACTION_API_HOST = 'EXTRACTION_API_HOST'
ENV_VAR_API_HOST = 'API_HOST'

def __init__(self, service_account_id=None, user_key=None, user_id=None, client_id=None, password=None):
self.customer_config_path = self.DEFAULT_CUST_CONFIG_PATH
Expand Down Expand Up @@ -110,7 +110,7 @@ def _fetch_jwt(self):

def get_uri_context(self):
headers = self.get_headers()
host = os.getenv(self.ENV_VAR_EXTRACTION_API_HOST, self.DEFAULT_HOST)
host = os.getenv(self.ENV_VAR_API_HOST, self.DEFAULT_HOST)
if "Authorization" in headers:
return host + '/dna'
elif 'user-key' in headers:
Expand All @@ -122,7 +122,7 @@ def get_uri_context(self):
raise Exception(msg)

# 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
# otherwise return None (the client will have to authenticate Extraction API request with an user key, i.e. the old way)
# otherwise return None (the client will have to authenticate API request with an user key, i.e. the original standard)
def oauth2_credentials(self):
creds = self._build_oauth2_credentials(
self.user_id,
Expand Down
6 changes: 3 additions & 3 deletions dnaStreaming/test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-r ../../requirements.txt
pytest=5.4.2
flake8=3.7.9
pytest-cov=2.8.1
pytest==5.4.2
flake8==3.7.9
pytest-cov==2.8.1
pytest-mock==3.1.0
pyflakes<2.2.0,>=2.1.0
2 changes: 1 addition & 1 deletion dnaStreaming/test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestConfig(TestCase):
def tearDown(self):
self.ensure_remove_environment_variable(Config.ENV_VAR_USER_KEY)
self.ensure_remove_environment_variable(Config.ENV_VAR_SUBSCRIPTION_ID)
self.ensure_remove_environment_variable(Config.ENV_VAR_EXTRACTION_API_HOST)
self.ensure_remove_environment_variable(Config.ENV_VAR_API_HOST)
self.ensure_remove_environment_variable(Config.ENV_VAR_USER_ID)
self.ensure_remove_environment_variable(Config.ENV_VAR_CLIENT_ID)
self.ensure_remove_environment_variable(Config.ENV_VAR_PASSWORD)
Expand Down
6 changes: 3 additions & 3 deletions dnaStreaming/test/test_run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

USER_KEY=$1
SUBSCRIPTION_ID=$2
ENV=$3
API_HOST=$3

${USER_KEY:?"Need to set USER_KEY environment variable."}
${SUBSCRIPTION_ID:?"Need to set SUBSCRIPTION_ID environment variable."}
${ENV:?"Need to set ENV environment variable."}
${API_HOST:=https://api.dowjones.com}

TIMEOUT=180 # NOTE: 2017-01-25: fleschec: In seconds
NAME="dj-dna-streaming-python-asdvkds-for-testing-only"
Expand All @@ -28,7 +28,7 @@ run_docker() {
--name=$NAME \
-e USER_KEY=$USER_KEY \
-e SUBSCRIPTION_ID=$SUBSCRIPTION_ID \
-e EXTRACTION_API_HOST="https://extraction-api-dot-djsyndicationhub-$ENV.appspot.com" \
-e API_HOST=$API_HOST \
-e QUIET_DEMO=true \
$NAME-tag
}
Expand Down
14 changes: 10 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
from distutils.core import setup

from setuptools import find_packages
# read the contents of your README file
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()

setup(
name='dnaStreaming',
version='2.0.1',
version='2.0.2',
description='Dow Jones DNA Streaming Project',
author='Chris Flesche',
author_email='[email protected]',
long_description=long_description,
long_description_content_type='text/x-rst',
author='Zachary Kagan',
author_email='[email protected]',
url='https://github.com/dowjones/dj-dna-streams-python',
download_url='https://github.com/dowjones/dj-dna-streams-python/archive/release-2.0.0.tar.gz',
keywords=['DOWJONES', 'FACTIVA', 'STREAMS'],
Expand Down

0 comments on commit de4f003

Please sign in to comment.