Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Commit 03706f1

Browse files
committed
Added linting/test workflow
1 parent f159854 commit 03706f1

File tree

5 files changed

+61
-12
lines changed

5 files changed

+61
-12
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Python package
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
max-parallel: 4
11+
matrix:
12+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
13+
os: [ubuntu-latest, macos-latest]
14+
15+
steps:
16+
- uses: actions/checkout@v1
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Lint with flake8
22+
run: |
23+
pip install flake8
24+
# stop the build if there are Python syntax errors or undefined names
25+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
26+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
27+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
28+
- name: Test with Nose
29+
run: |
30+
pip install tox tox-gh-actions
31+
tox

example.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121

2222
#To create an item
2323
item = {
24-
"fields":[
25-
{"external_id":"org-name", "values":[{"value":"The Items API sucks"}]}
26-
]
24+
"fields":[
25+
{"external_id":"org-name", "values":[{"value":"The Items API sucks"}]}
26+
]
2727
}
28-
#print c.Application.find(179652)
28+
29+
app_id = c.Application.find(179652)
2930
c.Item.create(app_id, item)
30-
31+
3132
#Undefined and created at runtime example
3233
#print c.transport.GET.user.status()
3334

pypodio2/areas.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
from urllib.parse import urlencode
1212

1313

14+
class ApiErrorException(Exception):
15+
pass
16+
17+
1418
class Area(object):
1519
"""Represents a Podio Area"""
1620
def __init__(self, transport):

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
from setuptools import setup
22

3+
extras = {
4+
'test': [
5+
'mock',
6+
'nose',
7+
'tox',
8+
]
9+
}
10+
311
setup(
412
name="pypodio2",
513
version="1.0.0b0",
@@ -13,7 +21,7 @@
1321
"httplib2",
1422
"future",
1523
],
16-
tests_require=["nose", "mock", "tox"],
24+
extras_require=extras,
1725
test_suite="nose.collector",
1826
classifiers=[
1927
"Development Status :: 4 - Beta",

tox.ini

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
[tox]
2-
envlist = py27,py35
2+
envlist = py27,py35,py36,py37,py38
3+
4+
[gh-actions]
5+
python =
6+
2.7: py27
7+
3.5: py35
8+
3.6: py36
9+
3.7: py37
10+
3.8: py38
311

412
[testenv]
5-
commands = {envpython} setup.py nosetests
6-
deps =
7-
nose
8-
mock
9-
httplib2
13+
extras = test
14+
commands = {posargs:nosetests}

0 commit comments

Comments
 (0)