From de4f003d0325a7736317ac679e2a39ee4de13a87 Mon Sep 17 00:00:00 2001 From: Zachary Kagan Date: Tue, 1 Dec 2020 19:56:38 -0600 Subject: [PATCH] remove extraction api refs (#26) removed extraction api refs and added long_description_content_type --- dnaStreaming/config.py | 6 +++--- dnaStreaming/test/requirements.txt | 6 +++--- dnaStreaming/test/test_config.py | 2 +- dnaStreaming/test/test_run_docker.sh | 6 +++--- setup.py | 14 ++++++++++---- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/dnaStreaming/config.py b/dnaStreaming/config.py index 7f3dabe..3544caf 100644 --- a/dnaStreaming/config.py +++ b/dnaStreaming/config.py @@ -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 @@ -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: @@ -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, diff --git a/dnaStreaming/test/requirements.txt b/dnaStreaming/test/requirements.txt index d483280..c4157d9 100644 --- a/dnaStreaming/test/requirements.txt +++ b/dnaStreaming/test/requirements.txt @@ -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 diff --git a/dnaStreaming/test/test_config.py b/dnaStreaming/test/test_config.py index b4bc686..2a92102 100644 --- a/dnaStreaming/test/test_config.py +++ b/dnaStreaming/test/test_config.py @@ -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) diff --git a/dnaStreaming/test/test_run_docker.sh b/dnaStreaming/test/test_run_docker.sh index 6862218..238125c 100755 --- a/dnaStreaming/test/test_run_docker.sh +++ b/dnaStreaming/test/test_run_docker.sh @@ -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" @@ -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 } diff --git a/setup.py b/setup.py index 7f91682..292ac9d 100644 --- a/setup.py +++ b/setup.py @@ -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='chris.flesche@dowjones.com', + long_description=long_description, + long_description_content_type='text/x-rst', + author='Zachary Kagan', + author_email='zachary.kagan@dowjones.com', 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'],