diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..3b81b65 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +name: Run Tests + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Run Tests + run: | + python tests.py \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md index dfd29ad..a091834 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,13 +1,24 @@ Changelog ========= +Here you find a full list of changes. + + +Version 2.0.4 +------------- + +- Remove usage of urllib3 which was restricted to v1 in favor of embedded urllib to simplify our dependencies +- Update dependencies + +Version 2.0.3 +------------- + +- Add support for Campaign Result Schema endpoint Version 2.0.2 ------------- - Reset query arguments after returning all items from generator -Here you find a full list of changes. - Version 2.0.1 ------------- diff --git a/README.MD b/README.MD index 17da6fe..c8bd259 100644 --- a/README.MD +++ b/README.MD @@ -33,7 +33,8 @@ For more information on resources, authorization and available API calls, please ## Installation: -Requires Python 2.7 +Requires Python 3. +Support for Python 2.7 is expected but not tested or validated. ```bash pip install usabilla-api @@ -52,3 +53,12 @@ traverses these pages for you and yields each result in the current page before ## Support The Usabilla Python Client API is maintained by Usabilla Development Team. Everyone is encouraged to file bug reports, feature requests, and pull requests through GitHub. This input is critical and will be carefully considered, but we can’t promise a specific resolution or time frame for any request. For more information please email our Support Team at support@usabilla.com. + +## Releasing [internal] + +In order to release a new version of this library, follow these steps: +- bump version in setup.py +- merge and tag the new release with `v` +- run `python -m build` +- upload release to pypi-test: `python -m twine upload --repository testpypi dist/*` +- upload release to pypi: `python -m twine upload --repository pypi dist/*` \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d126efb..b337e9f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,7 @@ -coverage==4.0.3 -python-coveralls==2.7.0 -PyYAML==4.2b1 -requests==2.20.0 -sh==1.11 -six==1.10.0 -urllib3==1.23 -mock==2.0.0 +coverage==7.3.0 +python-coveralls==2.9.3 +PyYAML==6.0.1 +requests==2.31.0 +sh==2.0.6 +six==1.16.0 +mock==5.1.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 85c913f..ece0318 100644 --- a/setup.py +++ b/setup.py @@ -3,14 +3,14 @@ except ImportError: from distutils.core import setup -VERSION = '2.0.2' +VERSION = '2.0.4' setup( name='usabilla-api', version=VERSION, description="Python client for Usabilla API", license='MIT', - install_requires=['urllib3', 'requests'], + install_requires=['requests'], packages=find_packages(), py_modules=['usabilla'], author='Usabilla', diff --git a/tests.py b/tests.py index eef1d4d..4c934b6 100644 --- a/tests.py +++ b/tests.py @@ -84,6 +84,9 @@ def test_query_parameters(self): params = {'limit': 1, 'since': 1235454} self.client.set_query_parameters(params) self.assertEqual(self.client.get_query_parameters(), 'limit=1&since=1235454') + params = {'limit': 1, 'since': 1235454, 'text': 'the little old lady'} + self.client.set_query_parameters(params) + self.assertEqual(self.client.get_query_parameters(), 'limit=1&since=1235454&text=the+little+old+lady') def test_check_resource_validity(self): with self.assertRaises(ub.GeneralError): diff --git a/usabilla.py b/usabilla.py index cf1aecc..758395d 100644 --- a/usabilla.py +++ b/usabilla.py @@ -22,7 +22,7 @@ import hashlib import hmac import requests -import urllib3.request as urllib +import urllib.parse from collections import OrderedDict @@ -153,7 +153,7 @@ def set_query_parameters(self, parameters): :type parameters: dict """ - self.query_parameters = urllib.urlencode(OrderedDict(sorted(parameters.items()))) + self.query_parameters = urllib.parse.urlencode(OrderedDict(sorted(parameters.items()))) def get_query_parameters(self): """Get the query parameters."""