Skip to content
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

Python 3.10 support (and migrate to GitHub actions) #223

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: CI
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything below Python 3.7 is EOL. I suggest to stick to supported Python releases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that'd be sensible. I don't know what the maintainers want to be supporting, though?

fail-fast: false
name: Test on Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install wheel
run: pip install wheel
- name: Install dev requirements
run: pip install -r dev-requirements.txt
- name: Clean
run: make clean
- name: pep8
run: make pep8
- name: flake8
run: make flake8
- name: check
run: make check
- name: unittest
run: make unittest
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

8 changes: 2 additions & 6 deletions pyeapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,8 @@ def make_iterable(value):
if isinstance(value, str) or isinstance(value, dict):
value = [value]

if sys.version_info <= (3, 3):
if not isinstance(value, collections.Iterable):
raise TypeError('value must be an iterable object')
else:
if not isinstance(value, collections.abc.Iterable):
raise TypeError('value must be an iterable object')
if not isinstance(value, collections.abc.Iterable):
raise TypeError('value must be an iterable object')

return value

Expand Down
6 changes: 3 additions & 3 deletions test/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ def test_load_module_raises_import_error(self, mock_import_module):

def test_make_iterable_from_string(self):
result = pyeapi.utils.make_iterable('test')
self.assertIsInstance(result, collections.Iterable)
self.assertIsInstance(result, collections.abc.Iterable)
self.assertEqual(len(result), 1)

def test_make_iterable_from_unicode(self):
result = pyeapi.utils.make_iterable(u'test')
self.assertIsInstance(result, collections.Iterable)
self.assertIsInstance(result, collections.abc.Iterable)
self.assertEqual(len(result), 1)

def test_make_iterable_from_iterable(self):
result = pyeapi.utils.make_iterable(['test'])
self.assertIsInstance(result, collections.Iterable)
self.assertIsInstance(result, collections.abc.Iterable)
self.assertEqual(len(result), 1)

def test_make_iterable_raises_type_error(self):
Expand Down