From 8db7ff77c6df83479455e768e0d5f222a60a3c0a Mon Sep 17 00:00:00 2001 From: Rafael Dohms Date: Thu, 16 Feb 2023 17:03:52 +0100 Subject: [PATCH 1/7] Include new schema endpoint in changelog --- CHANGES.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dfd29ad..348ff78 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,13 +1,17 @@ Changelog ========= +Here you find a full list of changes. + +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 ------------- From 96ca60cba539c4c001232c0edfcc5aaa19efc96b Mon Sep 17 00:00:00 2001 From: Rafael Dohms Date: Fri, 17 Feb 2023 13:38:31 +0100 Subject: [PATCH 2/7] Bumping version in code This was not documented. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 85c913f..ff24734 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ except ImportError: from distutils.core import setup -VERSION = '2.0.2' +VERSION = '2.0.3' setup( name='usabilla-api', From d2848a71808c44f0a99daa05dc9fd46dce956195 Mon Sep 17 00:00:00 2001 From: Rafael Dohms Date: Tue, 15 Aug 2023 14:54:33 +0200 Subject: [PATCH 3/7] Add Tests Setup Transitioning to maintenance mode means we have less people working on this, adding automated tests will help avoid problems. --- .github/workflows/test.yml | 25 +++++++++++++++++++++++++ README.MD | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml 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/README.MD b/README.MD index 17da6fe..84d18d0 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 From 7664ac3c7a5d17d94b9a78f415facf89be9cd0db Mon Sep 17 00:00:00 2001 From: Rafael Dohms Date: Tue, 15 Aug 2023 14:45:20 +0200 Subject: [PATCH 4/7] Drop urllib3 requirement Changes in `urllib3:2.0` made the parts we use private methods. this means we should not have been using those and that we were incompatible with v2. Replacing it with `urllib.parse` as a dependency gives us the same results but with one less library to be compatible with. --- requirements.txt | 1 - setup.py | 2 +- tests.py | 3 +++ usabilla.py | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index d126efb..6d0ef2d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,4 @@ PyYAML==4.2b1 requests==2.20.0 sh==1.11 six==1.10.0 -urllib3==1.23 mock==2.0.0 diff --git a/setup.py b/setup.py index ff24734..cad3ac4 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ 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.""" From 0499961e740d25f9e22e5581a923ead2f8debffc Mon Sep 17 00:00:00 2001 From: Rafael Dohms Date: Tue, 15 Aug 2023 14:46:44 +0200 Subject: [PATCH 5/7] Update Dependencies --- requirements.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index 6d0ef2d..b337e9f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +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 -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 From e62288878bd956960db3ab20af5b958026ee433c Mon Sep 17 00:00:00 2001 From: Rafael Dohms Date: Tue, 15 Aug 2023 14:47:01 +0200 Subject: [PATCH 6/7] Prepare release 2.0.4 --- CHANGES.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 348ff78..a091834 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,13 @@ 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 ------------- diff --git a/setup.py b/setup.py index ff24734..76c45bd 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ except ImportError: from distutils.core import setup -VERSION = '2.0.3' +VERSION = '2.0.4' setup( name='usabilla-api', From 70509976124ebd2fb8fee94d07ced8e4f2210592 Mon Sep 17 00:00:00 2001 From: Rafael Dohms Date: Tue, 15 Aug 2023 15:17:31 +0200 Subject: [PATCH 7/7] Document Release Process --- README.MD | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.MD b/README.MD index 84d18d0..c8bd259 100644 --- a/README.MD +++ b/README.MD @@ -53,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