Skip to content

Commit b09df50

Browse files
authored
Update pythonpackage.yml (#49)
* Update pythonpackage.yml * add requirements for testing * Update CI / lint comments * yaml formatting
1 parent d65485c commit b09df50

3 files changed

Lines changed: 35 additions & 3 deletions

File tree

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: ubuntu-latest
9+
strategy:
10+
max-parallel: 4
11+
matrix:
12+
python-version: [2.7, 3.5, 3.6, 3.7]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -r requirements.txt
24+
- name: Lint with flake8
25+
run: |
26+
python -m pip install flake8
27+
flake8 . --statistics
28+
- name: Test with pytest
29+
run: |
30+
python -m pip install pytest
31+
pytest

newsapi/newsapi_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __init__(self, api_key, session=None):
1414
else:
1515
self.request_method = session
1616

17-
def get_top_headlines(
17+
def get_top_headlines( # noqa: C901
1818
self, q=None, sources=None, language="en", country=None, category=None, page_size=None, page=None
1919
):
2020
"""
@@ -132,7 +132,7 @@ def get_top_headlines(
132132

133133
return r.json()
134134

135-
def get_everything(
135+
def get_everything( # noqa: C901
136136
self,
137137
q=None,
138138
sources=None,
@@ -273,7 +273,7 @@ def get_everything(
273273

274274
return r.json()
275275

276-
def get_sources(self, category=None, language=None, country=None):
276+
def get_sources(self, category=None, language=None, country=None): # noqa: C901
277277
"""
278278
Returns the subset of news publishers that top headlines...
279279

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
requests==2.21.0

0 commit comments

Comments
 (0)