Skip to content

Remove dependency on urllib3 #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------

Expand Down
3 changes: 2 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 7 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
except ImportError:
from distutils.core import setup

VERSION = '2.0.3'
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',
Expand Down
3 changes: 3 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions usabilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import hashlib
import hmac
import requests
import urllib3.request as urllib
import urllib.parse

from collections import OrderedDict

Expand Down Expand Up @@ -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."""
Expand Down