Commit dd3abc57 by Clinton Blackburn

Merge pull request #13 from edx/clintonb/replace-ecommerce-api-client

Replaced ecommerce-api-client with edx-rest-api-client
parents e0d4b84b 7d1e41bd
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
from celery import shared_task from celery import shared_task
from celery.exceptions import Ignore from celery.exceptions import Ignore
from celery.utils.log import get_task_logger from celery.utils.log import get_task_logger
from ecommerce_api_client import exceptions from edx_rest_api_client import exceptions
from ecommerce_api_client.client import EcommerceApiClient from edx_rest_api_client.client import EdxRestApiClient
from ecommerce_worker.utils import get_configuration from ecommerce_worker.utils import get_configuration
...@@ -26,7 +26,7 @@ def fulfill_order(self, order_number): ...@@ -26,7 +26,7 @@ def fulfill_order(self, order_number):
issuer = get_configuration('JWT_ISSUER') issuer = get_configuration('JWT_ISSUER')
service_username = get_configuration('ECOMMERCE_SERVICE_USERNAME') service_username = get_configuration('ECOMMERCE_SERVICE_USERNAME')
api = EcommerceApiClient(ecommerce_api_root, signing_key=signing_key, issuer=issuer, username=service_username) api = EdxRestApiClient(ecommerce_api_root, signing_key=signing_key, issuer=issuer, username=service_username)
try: try:
logger.info('Requesting fulfillment of order [%s].', order_number) logger.info('Requesting fulfillment of order [%s].', order_number)
api.orders(order_number).fulfill.put() api.orders(order_number).fulfill.put()
......
...@@ -4,7 +4,7 @@ from unittest import TestCase ...@@ -4,7 +4,7 @@ from unittest import TestCase
from celery.exceptions import Ignore from celery.exceptions import Ignore
import ddt import ddt
from ecommerce_api_client import exceptions from edx_rest_api_client import exceptions
import httpretty import httpretty
import jwt import jwt
import mock import mock
......
...@@ -2,17 +2,48 @@ ...@@ -2,17 +2,48 @@
# ** DO NOT EDIT THIS FILE ** # ** DO NOT EDIT THIS FILE **
# *************************** # ***************************
# #
# It is generated by: # This file was generated by edx-lint: http://github.com/edx.edx-lint
# $ edx_lint write pylintrc
# #
# If you want to change this file, you have two choices, depending on whether
# you want to make a local change that applies only to this repo, or whether
# you want to make a central change that applies to all repos using edx-lint.
# #
# LOCAL CHANGE:
# #
# 1. Edit the local pylintrc_tweaks file to add changes just to this
# repo's file.
# #
# 2. Run:
# #
# $ edx_lint write pylintrc
# #
# 3. This will modify the local file. Submit a pull request to get it
# checked in so that others will benefit.
# #
# #
# STAY AWAY! # CENTRAL CHANGE:
#
# 1. Edit the pylintrc file in the edx-lint repo at
# https://github.com/edx/edx-lint/blob/master/edx_lint/files/pylintrc
#
# 2. Make a new version of edx_lint, which involves the usual steps of
# incrementing the version number, submitting and reviewing a pull
# request, and updating the edx-lint version reference in this repo.
#
# 3. Install the newer version of edx-lint.
#
# 4. Run:
#
# $ edx_lint write pylintrc
#
# 5. This will modify the local file. Submit a pull request to get it
# checked in so that others will benefit.
#
#
#
#
#
# STAY AWAY FROM THIS FILE!
# #
# #
# #
...@@ -22,7 +53,6 @@ ...@@ -22,7 +53,6 @@
# #
# ------------------------------ # ------------------------------
[MASTER] [MASTER]
profile = no
ignore = configuration, celery_app.py ignore = configuration, celery_app.py
persistent = yes persistent = yes
load-plugins = edx_lint.pylint load-plugins = edx_lint.pylint
...@@ -38,6 +68,7 @@ disable = ...@@ -38,6 +68,7 @@ disable =
abstract-class-little-used, abstract-class-little-used,
no-init, no-init,
fixme, fixme,
logging-format-interpolation,
too-many-lines, too-many-lines,
no-self-use, no-self-use,
too-many-ancestors, too-many-ancestors,
...@@ -56,15 +87,13 @@ output-format = text ...@@ -56,15 +87,13 @@ output-format = text
files-output = no files-output = no
reports = no reports = no
evaluation = 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) evaluation = 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
comment = no
[BASIC] [BASIC]
required-attributes =
bad-functions = map,filter,apply,input bad-functions = map,filter,apply,input
module-rgx = (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ module-rgx = (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns)$ const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns)$
class-rgx = [A-Z_][a-zA-Z0-9]+$ class-rgx = [A-Z_][a-zA-Z0-9]+$
function-rgx = ([a-z_][a-z0-9_]{2,30}|test_[a-z0-9_]+)$ function-rgx = ([a-z_][a-z0-9_]{2,40}|test_[a-z0-9_]+)$
method-rgx = ([a-z_][a-z0-9_]{2,40}|setUp|set[Uu]pClass|tearDown|tear[Dd]ownClass|assert[A-Z]\w*|maxDiff|test_[a-z0-9_]+)$ method-rgx = ([a-z_][a-z0-9_]{2,40}|setUp|set[Uu]pClass|tearDown|tear[Dd]ownClass|assert[A-Z]\w*|maxDiff|test_[a-z0-9_]+)$
attr-rgx = [a-z_][a-z0-9_]{2,30}$ attr-rgx = [a-z_][a-z0-9_]{2,30}$
argument-rgx = [a-z_][a-z0-9_]{2,30}$ argument-rgx = [a-z_][a-z0-9_]{2,30}$
...@@ -73,7 +102,7 @@ class-attribute-rgx = ([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ ...@@ -73,7 +102,7 @@ class-attribute-rgx = ([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
inlinevar-rgx = [A-Za-z_][A-Za-z0-9_]*$ inlinevar-rgx = [A-Za-z_][A-Za-z0-9_]*$
good-names = f,i,j,k,db,ex,Run,_,__ good-names = f,i,j,k,db,ex,Run,_,__
bad-names = foo,bar,baz,toto,tutu,tata bad-names = foo,bar,baz,toto,tutu,tata
no-docstring-rgx = __.*__|test_.+|setUp|tearDown no-docstring-rgx = __.*__$|test_.+|setUp$|setUpClass$|tearDown$|tearDownClass$|Meta$
docstring-min-length = -1 docstring-min-length = -1
[FORMAT] [FORMAT]
...@@ -96,7 +125,7 @@ ignore-imports = no ...@@ -96,7 +125,7 @@ ignore-imports = no
[TYPECHECK] [TYPECHECK]
ignore-mixin-members = yes ignore-mixin-members = yes
ignored-classes = SQLObject ignored-classes = SQLObject
zope = no unsafe-load-any-extension = yes
generated-members = generated-members =
REQUEST, REQUEST,
acl_users, acl_users,
...@@ -126,7 +155,6 @@ dummy-variables-rgx = _|dummy|unused|.*_unused ...@@ -126,7 +155,6 @@ dummy-variables-rgx = _|dummy|unused|.*_unused
additional-builtins = additional-builtins =
[CLASSES] [CLASSES]
ignore-iface-methods = isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
defining-attr-methods = __init__,__new__,setUp defining-attr-methods = __init__,__new__,setUp
valid-classmethod-first-arg = cls valid-classmethod-first-arg = cls
valid-metaclass-classmethod-first-arg = mcs valid-metaclass-classmethod-first-arg = mcs
...@@ -152,4 +180,4 @@ int-import-graph = ...@@ -152,4 +180,4 @@ int-import-graph =
[EXCEPTIONS] [EXCEPTIONS]
overgeneral-exceptions = Exception overgeneral-exceptions = Exception
# 5053851b5ac2d651899ebff730c1ba2610f1ad8f # 5353e34d513f08a63b08ae16cca61e3d473295b0
# Local tweaks to pylintrc. # Local tweaks to pylintrc.
[MASTER] [MASTER]
ignore=configuration, celery_app.py ignore=configuration, celery_app.py
load-plugins = edx_lint.pylint
celery==3.1.18 # Install the local package (and its requirements)
edx-ecommerce-api-client==1.1.0 .
# Optional packages # Optional packages
newrelic==2.54.0.41 newrelic==2.60.0.46
# Packages required for running tests # Packages required for running tests
-r base.txt -r base.txt
coverage==3.7.1 coverage==4.0.3
ddt==1.0.0 ddt==1.0.1
edx-lint==0.2.7 edx-lint==0.4.3
httpretty==0.8.10 httpretty==0.8.10
mock==1.3.0 mock==1.3.0
nose==1.3.7 nose==1.3.7
pep8==1.6.2 pep8==1.7.0
...@@ -6,7 +6,7 @@ with open('README.rst') as readme: ...@@ -6,7 +6,7 @@ with open('README.rst') as readme:
setup( setup(
name='edx-ecommerce-worker', name='edx-ecommerce-worker',
version='0.3.1', version='0.3.2',
description='Celery tasks supporting the operations of edX\'s ecommerce service', description='Celery tasks supporting the operations of edX\'s ecommerce service',
long_description=long_description, long_description=long_description,
classifiers=[ classifiers=[
...@@ -24,5 +24,8 @@ setup( ...@@ -24,5 +24,8 @@ setup(
author_email='oscm@edx.org', author_email='oscm@edx.org',
license='AGPL', license='AGPL',
packages=find_packages(exclude=['*.tests']), packages=find_packages(exclude=['*.tests']),
install_requires=['celery', 'edx-ecommerce-api-client'], install_requires=[
'celery>=3.1.18,<4.0.0',
'edx-rest-api-client>=1.5.0,<2.0.0'
],
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment