diff --git a/pyavatax/__init__.py b/pyavatax/__init__.py index 3cef352..e4d91cb 100644 --- a/pyavatax/__init__.py +++ b/pyavatax/__init__.py @@ -1,4 +1,4 @@ -VERSION = (1, 3, 8) +VERSION = (1, 3, 10) def get_version(): diff --git a/pyavatax/base.py b/pyavatax/base.py index d698702..dada26d 100644 --- a/pyavatax/base.py +++ b/pyavatax/base.py @@ -110,7 +110,7 @@ def update(self, *args, **kwargs): if isinstance(_v, klass): getattr(self, k).append(_v) elif isinstance(_v, dict): - getattr(self, k).append(klass(allow_new_fields=self.allow_new_fields,**_v)) + getattr(self, k).append(klass(allow_new_fields=self.allow_new_fields, **_v)) else: self._invalid_field(k) self.clean() @@ -179,7 +179,6 @@ def _request(self, http_method, stem, data={}, params={}): data = data.replace('\\n', ' ') kwargs = { 'params': params, - 'data': data, 'headers': self.headers, 'auth': (self.username, self.password), 'proxies': self.proxies, @@ -191,6 +190,7 @@ def _request(self, http_method, stem, data={}, params={}): kwargs.pop('data') resp = requests.get(url, **kwargs) elif http_method == 'POST': + kwargs.update({'data': data}) resp = requests.post(url, **kwargs) except (requests.exceptions.ConnectionError, requests.exceptions.SSLError, requests.exceptions.HTTPError, requests.exceptions.Timeout) as e: self.logger.warning(e) @@ -602,7 +602,7 @@ class TaxOverride(AvalaraBase): OVERRIDE_AMOUNT = 'TaxAmount' OVERRIDE_DATE = 'TaxDate' OVERRIDE_EXEMPT = 'Exemption' - OVERRIDE_TYPES = ( OVERRIDE_NONE, OVERRIDE_AMOUNT, OVERRIDE_DATE, OVERRIDE_EXEMPT ) + OVERRIDE_TYPES = (OVERRIDE_NONE, OVERRIDE_AMOUNT, OVERRIDE_DATE, OVERRIDE_EXEMPT) _fields = ['TaxOverrideType', 'TaxAmount', 'TaxDate', 'Reason'] @staticmethod diff --git a/pyavatax/django_integration.py b/pyavatax/django_integration.py index 38f16f9..c9d689e 100644 --- a/pyavatax/django_integration.py +++ b/pyavatax/django_integration.py @@ -1,8 +1,5 @@ -from django.utils import timezone - - class MockDjangoRecorder(object): - + @staticmethod def failure(doc, response): pass @@ -15,6 +12,7 @@ def success(doc): def get_django_recorder(): try: import django + from django.utils import timezone from django.conf import settings from pyavatax.models import AvaTaxRecord except ImportError: diff --git a/requirements.txt b/requirements.txt index 599240b..648346c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,4 @@ pytest==2.6.4 testfixtures==4.1.2 Sphinx==1.1.3 simplejson==3.3.0 +twine==1.9.1 diff --git a/setup.py b/setup.py index db587c5..e317049 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,8 @@ #! /usr/bin/env python from setuptools import setup, find_packages # python setup.py sdist -# python setup.py sdist bdist_wininst upload +# python setup.py sdist bdist_wininst +# twine upload dist/* version = __import__('pyavatax').__version__